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

Function traceQLStructural

tempodb/tempodb_search_test.go:540–1111  ·  view source on GitHub ↗
(t *testing.T, _ *tempopb.Trace, wantMeta *tempopb.TraceSearchMetadata, _, _ []*tempopb.SearchRequest, meta *backend.BlockMeta, r Reader, _ common.BackendBlock)

Source from the content-addressed store, hash-verified

538}
539
540func traceQLStructural(t *testing.T, _ *tempopb.Trace, wantMeta *tempopb.TraceSearchMetadata, _, _ []*tempopb.SearchRequest, meta *backend.BlockMeta, r Reader, _ common.BackendBlock) {
541 ctx := context.Background()
542 e := traceql.NewEngine()
543
544 type test struct {
545 req *tempopb.SearchRequest
546 expected []*tempopb.TraceSearchMetadata
547 }
548
549 searchesThatMatch := []*test{
550 {
551 req: &tempopb.SearchRequest{Query: "{ .parent } >> { .child }"},
552 expected: []*tempopb.TraceSearchMetadata{
553 {
554 SpanSets: []*tempopb.SpanSet{
555 {
556 Spans: []*tempopb.Span{
557 {
558 SpanID: "0000000000010203",
559 StartTimeUnixNano: 1000000000000,
560 DurationNanos: 1000000000,
561 Name: "",
562 Attributes: []*v1_common.KeyValue{
563 {Key: "child", Value: &v1_common.AnyValue{Value: &v1_common.AnyValue_BoolValue{BoolValue: true}}},
564 },
565 },
566 },
567 Matched: 1,
568 },
569 },
570 },
571 },
572 },
573 {
574 req: &tempopb.SearchRequest{Query: "{ .child } << { .parent }"},
575 expected: []*tempopb.TraceSearchMetadata{
576 {
577 SpanSets: []*tempopb.SpanSet{
578 {
579 Spans: []*tempopb.Span{
580 {
581 SpanID: "0000000000040506",
582 StartTimeUnixNano: 1000000000000,
583 DurationNanos: 2000000000,
584 Name: "",
585 Attributes: []*v1_common.KeyValue{
586 {Key: "parent", Value: &v1_common.AnyValue{Value: &v1_common.AnyValue_BoolValue{BoolValue: true}}},
587 },
588 },
589 },
590 Matched: 1,
591 },
592 },
593 },
594 },
595 },
596 {
597 req: &tempopb.SearchRequest{Query: "{ .parent } > { .child }"},

Callers

nothing calls this directly

Calls 7

ExecuteSearchMethod · 0.95
NewEngineFunction · 0.92
NewSpansetFetcherWrapperFunction · 0.92
DefaultSearchOptionsFunction · 0.92
actualForExpectedMetaFunction · 0.85
FetchMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected