(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestQueryRangeExemplars(t *testing.T) { |
| 57 | util.RunIntegrationTests(t, util.TestHarnessConfig{ |
| 58 | ConfigOverlay: configQueryRangeExemplars, |
| 59 | }, func(h *util.TempoHarness) { |
| 60 | h.WaitTracesWritable(t) |
| 61 | |
| 62 | ticker := time.NewTicker(500 * time.Millisecond) |
| 63 | defer ticker.Stop() |
| 64 | timer := time.NewTimer(10 * time.Second) |
| 65 | defer timer.Stop() |
| 66 | |
| 67 | tracesSent := 0 |
| 68 | |
| 69 | // send one batch every 500ms for 10 seconds |
| 70 | sendLoop: |
| 71 | for { |
| 72 | select { |
| 73 | case <-ticker.C: |
| 74 | require.NoError(t, h.WriteJaegerBatch( |
| 75 | util.MakeThriftBatchWithSpanCountAttributeAndName( |
| 76 | 1, "my operation", |
| 77 | "res_val", "span_val", |
| 78 | "res_attr", "span_attr", |
| 79 | ), ""), |
| 80 | ) |
| 81 | require.NoError(t, h.WriteJaegerBatch( |
| 82 | util.MakeThriftBatchWithSpanCountAttributeAndName( |
| 83 | 1, "my operation", |
| 84 | "res_val2", "span_val2", |
| 85 | "res_attr", "span_attr", |
| 86 | ), ""), |
| 87 | ) |
| 88 | require.NoError(t, h.WriteJaegerBatch( |
| 89 | util.MakeThriftBatchWithSpanCountAttributeAndName( |
| 90 | 1, "operation with high cardinality", |
| 91 | uuid.New().String(), uuid.New().String(), |
| 92 | "res_high_cardinality", "span_high_cardinality", |
| 93 | ), ""), |
| 94 | ) |
| 95 | tracesSent += 3 |
| 96 | case <-timer.C: |
| 97 | break sendLoop |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | h.WaitTracesQueryable(t, tracesSent) |
| 102 | |
| 103 | for _, exemplarsCase := range []struct { |
| 104 | name string |
| 105 | exemplars int |
| 106 | expectedExemplars int |
| 107 | }{ |
| 108 | { |
| 109 | name: "default", |
| 110 | exemplars: 0, |
| 111 | expectedExemplars: 100, // if set to 0, then limits to 100 |
| 112 | }, |
| 113 | { |
nothing calls this directly
no test coverage detected