Skip to content

Commit

Permalink
integration/e2e: adapt tempo-query test
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <[email protected]>
  • Loading branch information
frzifus committed Aug 29, 2024
1 parent 18177c5 commit c80ca5d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
1 change: 1 addition & 0 deletions integration/e2e/config-tempo-query.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
address: "0.0.0.0:7777"
backend: tempo:3200
services_query_duration: 1h
16 changes: 10 additions & 6 deletions integration/e2e/query_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ func TestSearchUsingJaegerPlugin(t *testing.T) {

tempo := util.NewTempoAllInOne()
tempoQuery := util.NewTempoQuery()
jaegerQuery := util.NewJaegerQuery()

require.NoError(t, s.StartAndWaitReady(tempo))
require.NoError(t, s.StartAndWaitReady(tempoQuery))
require.NoError(t, s.StartAndWaitReady(jaegerQuery))

jaegerClient, err := util.NewJaegerGRPCClient(tempo.Endpoint(14250))
require.NoError(t, err)
Expand All @@ -45,32 +47,32 @@ func TestSearchUsingJaegerPlugin(t *testing.T) {
// Wait for the traces to be written to the WAL
time.Sleep(time.Second * 3)

callJaegerQuerySearchServicesAssert(t, tempoQuery, servicesOrOpJaegerQueryResponse{
callJaegerQuerySearchServicesAssert(t, jaegerQuery, servicesOrOpJaegerQueryResponse{
Data: []string{
"frontend",
"backend",
},
Total: 2,
})

callJaegerQuerySearchOperationAssert(t, tempoQuery, "frontend", servicesOrOpJaegerQueryResponse{
callJaegerQuerySearchOperationAssert(t, jaegerQuery, "frontend", servicesOrOpJaegerQueryResponse{
Data: []string{
"execute",
"request",
},
Total: 2,
})

callJaegerQuerySearchOperationAssert(t, tempoQuery, "backend", servicesOrOpJaegerQueryResponse{
callJaegerQuerySearchOperationAssert(t, jaegerQuery, "backend", servicesOrOpJaegerQueryResponse{
Data: []string{
"execute",
"request",
},
Total: 2,
})

callJaegerQuerySearchTraceAssert(t, tempoQuery, "request", "frontend")
callJaegerQuerySearchTraceAssert(t, tempoQuery, "execute", "backend")
callJaegerQuerySearchTraceAssert(t, jaegerQuery, "request", "frontend")
callJaegerQuerySearchTraceAssert(t, jaegerQuery, "execute", "backend")
}

func TestSearchUsingBackendTagsService(t *testing.T) {
Expand All @@ -83,9 +85,11 @@ func TestSearchUsingBackendTagsService(t *testing.T) {

tempo := util.NewTempoAllInOne()
tempoQuery := util.NewTempoQuery()
jaegerQuery := util.NewJaegerQuery()

require.NoError(t, s.StartAndWaitReady(tempo))
require.NoError(t, s.StartAndWaitReady(tempoQuery))
require.NoError(t, s.StartAndWaitReady(jaegerQuery))

jaegerClient, err := util.NewJaegerGRPCClient(tempo.Endpoint(14250))
require.NoError(t, err)
Expand All @@ -104,7 +108,7 @@ func TestSearchUsingBackendTagsService(t *testing.T) {
time.Sleep(time.Second * 1)
util.CallFlush(t, tempo)

callJaegerQuerySearchServicesAssert(t, tempoQuery, servicesOrOpJaegerQueryResponse{
callJaegerQuerySearchServicesAssert(t, jaegerQuery, servicesOrOpJaegerQueryResponse{
Data: []string{
"frontend",
"backend",
Expand Down
29 changes: 23 additions & 6 deletions integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ import (
)

const (
image = "tempo:latest"
debugImage = "tempo-debug:latest"
queryImage = "tempo-query:latest"
image = "tempo:latest"
debugImage = "tempo-debug:latest"
queryImage = "tempo-query:latest"
jaegerImage = "jaegertracing/jaeger-query:1.60"
)

// GetExtraArgs returns the extra args to pass to the Docker command used to run Tempo.
Expand Down Expand Up @@ -249,20 +250,36 @@ func NewTempoScalableSingleBinary(replica int, extraArgs ...string) *e2e.HTTPSer

func NewTempoQuery() *e2e.HTTPService {
args := []string{
"--query.base-path=/",
"--grpc-storage-plugin.configuration-file=" + filepath.Join(e2e.ContainerSharedDir, "config-tempo-query.yaml"),
"-config=" + filepath.Join(e2e.ContainerSharedDir, "config-tempo-query.yaml"),
}

s := e2e.NewHTTPService(
"tempo-query",
queryImage,
e2e.NewCommandWithoutEntrypoint("/tempo-query", args...),
e2e.NewTCPReadinessProbe(7777),
7777,
)

s.SetBackoff(TempoBackoff())
return s
}

func NewJaegerQuery() *e2e.HTTPService {
args := []string{
"--grpc-storage.server=tempo-query:7777",
"--span-storage.type=grpc",
}

s := e2e.NewHTTPService(
"jaeger-query",
jaegerImage,
e2e.NewCommandWithoutEntrypoint("/go/bin/query-linux", args...),
e2e.NewHTTPReadinessProbe(16686, "/", 200, 299),
16686,
)

s.SetBackoff(TempoBackoff())

return s
}

Expand Down

0 comments on commit c80ca5d

Please sign in to comment.