Skip to content

Commit 03510fc

Browse files
authored
4755 – Add otel collector (#456)
This adds otel-collector. It scrapes the Prometheus endpoint for our metrics and sends it to Honeycomb. I added the bare minimum configuration for it to work. There are features that might be interesting, but I think we could add those as we add the metrics and understand what makes sense for us. - Adding a batch processor might be interesting: https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md - Maybe activating internal telemetry? https://opentelemetry.io/docs/collector/internal-telemetry#activate-internal-telemetry-in-the-collector Resources - https://docs.honeycomb.io/integrations/metrics/prometheus/ - https://docs.honeycomb.io/send-data/opentelemetry/collector/ - https://github.com/open-telemetry/opentelemetry-collector - https://opentelemetry.io/docs/collector/quick-start/ - https://opentelemetry.io/docs/collector/installation/ References: 4755, 4396 PR: 456
1 parent f952a1a commit 03510fc

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ config/cookies.txt
2626
coverage
2727
.idea
2828
.byebug_history
29-
*.env
29+
*.env
30+
otel-collector-config.yaml
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
receivers:
2+
prometheus:
3+
config:
4+
scrape_configs:
5+
- job_name: "prometheus"
6+
scrape_interval: 15s
7+
static_configs:
8+
- targets: ["pender:3200"]
9+
10+
processors:
11+
batch:
12+
13+
exporters:
14+
otlp/metrics:
15+
endpoint: "api.honeycomb.io:443" # US instance
16+
#endpoint: "api.eu1.honeycomb.io:443" # EU instance
17+
headers:
18+
"x-honeycomb-team": "<Honeycomb API KEY>"
19+
"x-honeycomb-dataset": "pender"
20+
21+
service:
22+
# telemetry:
23+
# logs:
24+
# level: "debug"
25+
pipelines:
26+
metrics:
27+
receivers: [prometheus]
28+
processors: []
29+
exporters: [otlp/metrics]

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ services:
5757
environment:
5858
RAILS_ENV: development
5959
SERVER_PORT: 3200
60+
otel-collector:
61+
image: otel/opentelemetry-collector-contrib
62+
volumes:
63+
- ./config/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
64+
depends_on:
65+
- pender

0 commit comments

Comments
 (0)