From 7df2d9585cce340d261b03936a16a05c3c4a18db Mon Sep 17 00:00:00 2001 From: manu vasconcelos Date: Tue, 18 Jun 2024 14:12:14 -0300 Subject: [PATCH] add configuration for otel collector First round of trying to configure the collector. - Added otel-collector to pender's docker compose, for the first tests. When I get this working I'll look into adding it to Check. - Added a otel-collector-config.example.yaml we can use to create the otel-collector-config.yaml. And updated .gitignore so it does not track the config.yaml one. --- .gitignore | 3 ++- docker-compose.yml | 14 ++++++++++++++ otel-collector-config.example.yaml | 29 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 otel-collector-config.example.yaml diff --git a/.gitignore b/.gitignore index df916ced..7d5feb20 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ config/cookies.txt coverage .idea .byebug_history -*.env \ No newline at end of file +*.env +otel-collector-config.yaml diff --git a/docker-compose.yml b/docker-compose.yml index 6b9ce5d2..f4a91ef2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,3 +57,17 @@ services: environment: RAILS_ENV: development SERVER_PORT: 3200 + otel-collector: + image: otel/opentelemetry-collector-contrib + volumes: + - ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml + depends_on: + - pender + ports: + - 1888:1888 # pprof extension + - 8888:8888 # Prometheus metrics exposed by the Collector + - 8889:8889 # Prometheus exporter metrics + - 13133:13133 # health_check extension + - 4317:4317 # OTLP gRPC receiver + - 4318:4318 # OTLP http receiver + - 55679:55679 # zpages extension diff --git a/otel-collector-config.example.yaml b/otel-collector-config.example.yaml new file mode 100644 index 00000000..eb518b63 --- /dev/null +++ b/otel-collector-config.example.yaml @@ -0,0 +1,29 @@ +receivers: + prometheus: + config: + scrape_configs: + - job_name: "prometheus" + scrape_interval: 15s + static_configs: + - targets: ["0.0.0.0:3200"] + +processors: + batch: + +exporters: + otlp/metrics: + endpoint: "api.honeycomb.io:443" # US instance + #endpoint: "api.eu1.honeycomb.io:443" # EU instance + headers: + "x-honeycomb-team": "" + "x-honeycomb-dataset": "pender" + +service: + # telemetry: + # logs: + # level: "debug" + pipelines: + metrics: + receivers: [prometheus] + processors: [] + exporters: [otlp/metrics]