MCPcopy
hub / github.com/grafana/tempo / runEventLinkInstrumentationSearchTest

Function runEventLinkInstrumentationSearchTest

tempodb/tempodb_search_test.go:1978–2093  ·  tempodb/tempodb_search_test.go::runEventLinkInstrumentationSearchTest
(t *testing.T, blockVersion string)

Source from the content-addressed store, hash-verified

1976}
1977
1978func runEventLinkInstrumentationSearchTest(t *testing.T, blockVersion string) {
1979 // only run this test for vparquet4
1980 if blockVersion != vparquet4.VersionString && blockVersion != vparquet5.VersionString {
1981 return
1982 }
1983
1984 tempDir := t.TempDir()
1985
1986 dc := backend.DedicatedColumns{
1987 {Scope: "resource", Name: "res-dedicated.01", Type: "string"},
1988 {Scope: "resource", Name: "res-dedicated.02", Type: "string"},
1989 {Scope: "span", Name: "span-dedicated.01", Type: "string"},
1990 {Scope: "span", Name: "span-dedicated.02", Type: "string"},
1991 {Scope: "event", Name: "event-dedicated.01", Type: "string"},
1992 }
1993
1994 r, w, c, err := New(testingConfig(tempDir, blockVersion, dc), nil, log.NewNopLogger())
1995 require.NoError(t, err)
1996
1997 err = c.EnableCompaction(context.Background(), testingCompactorConfig, &mockSharder{}, &mockOverrides{})
1998 require.NoError(t, err)
1999
2000 ctx := context.Background()
2001 r.EnablePolling(ctx, &mockJobSharder{}, false)
2002 rw := r.(*readerWriter)
2003
2004 wantID, wantTr, start, end, wantMeta := makeExpectedTrace(nil)
2005 wantIDText := util.TraceIDToHexString(wantID)
2006
2007 searchesThatMatch := []*tempopb.SearchRequest{
2008 {
2009 // Event generic attribute
2010 Query: "{ event.exception.message = `random error` }",
2011 },
2012 {
2013 // Dedicated column
2014 Query: "{ event.event-dedicated.01 = `event-1a` }",
2015 },
2016 {
2017 Query: "{ event:name = `event name` }",
2018 },
2019 {
2020 Query: "{ event:timeSinceStart > 10ms }",
2021 },
2022 {
2023 Query: "{ link.relation = `child-of` }",
2024 },
2025 {
2026 Query: "{ link:traceID = `" + wantIDText + "` }",
2027 },
2028 {
2029 Query: "{ instrumentation:name = `scope-1` }",
2030 },
2031 {
2032 Query: "{ instrumentation:version = `version-1` }",
2033 },
2034 {
2035 Query: "{ instrumentation.scope-attr-str = `scope-attr-1` }",

Callers 1

TestSearchCompleteBlockFunction · 0.85

Calls 15

ExecuteSearchMethod · 0.95
TraceIDToHexStringFunction · 0.92
NewUUIDFunction · 0.92
MustNewSegmentDecoderFunction · 0.92
ValidTraceIDFunction · 0.92
MakeTraceFunction · 0.92
NewEngineFunction · 0.92
NewSpansetFetcherWrapperFunction · 0.92
DefaultSearchOptionsFunction · 0.92
testingConfigFunction · 0.85
makeExpectedTraceFunction · 0.85
actualForExpectedMetaFunction · 0.85

Tested by

no test coverage detected