From 5530febeef7c6decc8e3e599f3a22626ebea52d2 Mon Sep 17 00:00:00 2001 From: Curtis Robert Date: Thu, 21 Dec 2023 13:23:01 -0800 Subject: [PATCH] [chore][exporter/clickhouse] Fix broken makefile command for examples (#30161) **Description:** The ClickHouse exporter contains a docker example with `telemetrygen` generating traces to send to the otel collector, which then sends to the ClickHouse backend. Grafana is then used to view traces. The make commands were broken due being in the wrong directory when executing, as well as the deprecation of `tracegen` in favor of `telemetrygen traces`. **Link to tracking Issue:** Resolves #30159 **Testing:** Both `make` commands are working and everything's up and running. Also confirmed `telemetrygen` is properly sending traces to the collector. Note: I'm not familiar enough with Grafana or ClickHouse to be able to validate clickhouse exporter functionality in the example. A code owner or user will have to verify the example still works. --- exporter/clickhouseexporter/Makefile | 4 ++-- exporter/clickhouseexporter/README.md | 2 +- exporter/clickhouseexporter/example/docker-compose.yml | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/exporter/clickhouseexporter/Makefile b/exporter/clickhouseexporter/Makefile index b25a796464ef..f462514a2d6c 100644 --- a/exporter/clickhouseexporter/Makefile +++ b/exporter/clickhouseexporter/Makefile @@ -1,8 +1,8 @@ include ../../Makefile.Common local-run-example: - cd ../../ && GOOS=linux go build -o ./local/otelcontribcol ./cmd/otelcontribcol + cd ../../cmd/otelcontribcol && GOOS=linux go build -o ../../local/otelcontribcol cd example && docker-compose up -d recreate-otel-collector: - cd ../../ && GOOS=linux go build -o ./local/otelcontribcol ./cmd/otelcontribcol + cd ../../ && make otelcontribcol cd example && docker-compose up --build otelcollector diff --git a/exporter/clickhouseexporter/README.md b/exporter/clickhouseexporter/README.md index 03b0f8a1d2b8..207f3c1640cb 100644 --- a/exporter/clickhouseexporter/README.md +++ b/exporter/clickhouseexporter/README.md @@ -140,7 +140,7 @@ SELECT Timestamp as log_time, toString(Links.TraceId) FROM otel_traces WHERE ServiceName = 'clickhouse-exporter' - AND SpanAttributes['peer.service'] = 'tracegen-server' + AND SpanAttributes['peer.service'] = 'telemetrygen-server' AND Timestamp >= NOW() - INTERVAL 1 HOUR Limit 100; ``` diff --git a/exporter/clickhouseexporter/example/docker-compose.yml b/exporter/clickhouseexporter/example/docker-compose.yml index 3160a3b7404a..709d554f8679 100644 --- a/exporter/clickhouseexporter/example/docker-compose.yml +++ b/exporter/clickhouseexporter/example/docker-compose.yml @@ -69,10 +69,11 @@ services: stop_signal: SIGKILL # Traces generator - tracegen: + telemetrygen: build: - context: ../../../cmd/tracegen/ + context: ../../../cmd/telemetrygen/ command: + - traces - --otlp-endpoint=otelcollector:4317 - --otlp-insecure - --rate=100