Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
test-target:
[
test-e2e,
test-e2e-api,
test-integration-poller,
test-e2e-deployments,
test-e2e-serverless,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/tempodb/encoding/benchmark_block
private-key.key
integration/e2e/e2e_integration_test[0-9]*
integration/e2e/api/e2e_integration_test[0-9]*
integration/e2e/deployments/e2e_integration_test[0-9]*
.tempo.yaml
/tmp
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,19 @@ test-e2e-serverless: tools docker-tempo docker-serverless ## Run serverless end
test-e2e-deployments: tools docker-tempo docker-tempo-query ## Run end to end tests for deployments
$(GOTEST) -v $(GOTEST_OPT) ./integration/e2e/deployments

# runs only api e2e tests
.PHONY: test-e2e-api
test-e2e-api: tools docker-tempo docker-tempo-query ## Run end to end tests for api
$(GOTEST) -v $(GOTEST_OPT) ./integration/e2e/api

# runs only poller integration tests
.PHONY: test-integration-poller
test-integration-poller: tools ## Run poller integration tests
$(GOTEST) -v $(GOTEST_OPT) ./integration/poller

# test-all/bench use a docker image so build it first to make sure we're up to date
.PHONY: test-all ## Run all tests
test-all: test-with-cover test-e2e test-e2e-serverless test-e2e-deployments test-integration-poller
test-all: test-with-cover test-e2e test-e2e-serverless test-e2e-deployments test-e2e-api test-integration-poller

.PHONY: test-bench
test-bench: tools docker-tempo ## Run all benchmarks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"context"
Expand All @@ -23,8 +23,9 @@ import (
)

const (
spanX = "span.x"
resourceX = "resource.xx"
configAllInOneLocal = "../deployments/config-all-in-one-local.yaml"
spanX = "span.x"
resourceX = "resource.xx"
)

func TestSearchTagsV2(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"compress/gzip"
Expand All @@ -17,7 +17,7 @@ import (
)

const (
configCompression = "deployments/config-all-in-one-local.yaml"
configCompression = "../deployments/config-all-in-one-local.yaml"
)

func TestCompression(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"context"
Expand Down Expand Up @@ -66,7 +66,8 @@ func testSearch(t *testing.T, tenant string, tenantSize int) {

require.NoError(t, util.CopyFileToSharedDir(s, configMultiTenant, "config.yaml"))
tempo := util.NewTempoAllInOne()
require.NoError(t, s.StartAndWaitReady(tempo, newPrometheus()))
prometheus := util.NewPrometheus()
require.NoError(t, s.StartAndWaitReady(tempo, prometheus))

// Get port for the Jaeger gRPC receiver endpoint
c, err := util.NewJaegerGRPCClient(tempo.Endpoint(14250))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package e2e
package api

import (
"context"
Expand Down
15 changes: 2 additions & 13 deletions integration/e2e/metrics_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
const (
configMetricsGenerator = "config-metrics-generator.yaml"
configMetricsGeneratorTargetInfo = "config-metrics-generator-targetinfo.yaml"
prometheusImage = "prom/prometheus:latest"
)

func TestMetricsGenerator(t *testing.T) {
Expand All @@ -36,7 +35,7 @@ func TestMetricsGenerator(t *testing.T) {
tempoDistributor := util.NewTempoDistributor()
tempoIngester := util.NewTempoIngester(1)
tempoMetricsGenerator := util.NewTempoMetricsGenerator()
prometheus := newPrometheus()
prometheus := util.NewPrometheus()
require.NoError(t, s.StartAndWaitReady(tempoDistributor, tempoIngester, tempoMetricsGenerator, prometheus))

// Wait until ingester and metrics-generator are active
Expand Down Expand Up @@ -225,7 +224,7 @@ func TestMetricsGeneratorTargetInfoEnabled(t *testing.T) {
tempoDistributor := util.NewTempoDistributor()
tempoIngester := util.NewTempoIngester(1)
tempoMetricsGenerator := util.NewTempoMetricsGenerator()
prometheus := newPrometheus()
prometheus := util.NewPrometheus()
require.NoError(t, s.StartAndWaitReady(tempoDistributor, tempoIngester, tempoMetricsGenerator, prometheus))

// Wait until ingester and metrics-generator are active
Expand Down Expand Up @@ -387,16 +386,6 @@ func TestMetricsGeneratorTargetInfoEnabled(t *testing.T) {
assert.NoError(t, tempoMetricsGenerator.WaitSumMetrics(e2e.Equals(25), "tempo_metrics_generator_registry_series_added_total"))
}

func newPrometheus() *e2e.HTTPService {
return e2e.NewHTTPService(
"prometheus",
prometheusImage,
e2e.NewCommandWithoutEntrypoint("/bin/prometheus", "--config.file=/etc/prometheus/prometheus.yml", "--web.enable-remote-write-receiver"),
e2e.NewHTTPReadinessProbe(9090, "/-/ready", 200, 299),
9090,
)
}

// extractMetricsFromPrometheus extracts metrics stored in Prometheus using the /federate endpoint.
func extractMetricsFromPrometheus(prometheus *e2e.HTTPService, matcher string) (map[string]*io_prometheus_client.MetricFamily, error) {
url := fmt.Sprintf("http://%s/federate?match[]=%s", prometheus.HTTPEndpoint(), url.QueryEscape(matcher))
Expand Down
19 changes: 15 additions & 4 deletions integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ import (
)

const (
image = "tempo:latest"
debugImage = "tempo-debug:latest"
queryImage = "tempo-query:latest"
jaegerImage = "jaegertracing/jaeger-query:1.64.0"
image = "tempo:latest"
debugImage = "tempo-debug:latest"
queryImage = "tempo-query:latest"
jaegerImage = "jaegertracing/jaeger-query:1.64.0"
prometheusImage = "prom/prometheus:latest"
)

// GetExtraArgs returns the extra args to pass to the Docker command used to run Tempo.
Expand Down Expand Up @@ -640,3 +641,13 @@ func SpanCount(a *tempopb.Trace) float64 {

return float64(count)
}

func NewPrometheus() *e2e.HTTPService {
return e2e.NewHTTPService(
"prometheus",
prometheusImage,
e2e.NewCommandWithoutEntrypoint("/bin/prometheus", "--config.file=/etc/prometheus/prometheus.yml", "--web.enable-remote-write-receiver"),
e2e.NewHTTPReadinessProbe(9090, "/-/ready", 200, 299),
9090,
)
}
Loading