Skip to content

Commit 05dd253

Browse files
authored
6473 – add otel config (#108)
We are using the otel-collector mainly to be able to collect custom metrics from our Rails services. But it is a service that can be used with any of Check's services. Because it is relevant to all of our services we don't want to keep it in individual repos, but keep it in the main Check one. This is only relevant to local development. References: CV2-6473, CV2-4396 Relates to: meedan/pender#586
1 parent 439da45 commit 05dd253

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ This is a [Docker Compose](https://docs.docker.com/compose/) configuration that
4949
- Narcissus screenshot service (container `narcissus`) at [http://localhost:8687](http://localhost:8687)
5050
- Fetch fact-checking service (container `fetch`) at [http://localhost:8687/about](http://localhost:8687/about)
5151
- Search v2 prototype application (container `search`) at [http://localhost:8001](http://localhost:8001)
52+
- Otel Collector – you can configure receivers, processors and exporters in the otel-collector-config.yaml
5253

5354
## Testing
5455

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ services:
126126
extra_hosts:
127127
- "host.docker.internal:host-gateway"
128128
pender:
129+
# env_file:
130+
# - ./pender/.env
129131
build: pender
130132
platform: linux/x86_64
131133
shm_size: 1G
@@ -160,13 +162,13 @@ services:
160162
SERVER_PORT: 3200
161163
networks:
162164
- dev
165+
# If you want to run the OpenTelemetry Collector, uncomment the lines below
163166
# otel-collector:
164167
# image: otel/opentelemetry-collector-contrib
165168
# volumes:
166-
# - ./pender/config/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
167-
# depends_on:
168-
# - pender
169+
# - ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
169170
# environment:
171+
# x_honeycomb_team: ${X_HONEYCOMB_TEAM} # Set this env var in your shell before running docker-compose
170172
# RAILS_ENV: development
171173
# SERVER_PORT: 3200
172174
# networks:

otel-collector-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
memory_limiter:
12+
check_interval: 1s
13+
limit_percentage: 80
14+
spike_limit_percentage: 20
15+
batch:
16+
timeout: 200ms
17+
send_batch_size: 8192
18+
19+
exporters:
20+
otlp/metrics:
21+
endpoint: "api.honeycomb.io:443" # US instance
22+
#endpoint: "api.eu1.honeycomb.io:443" # EU instance
23+
headers:
24+
"x-honeycomb-team": ${env:x_honeycomb_team} # Honeycomb API KEY
25+
"x-honeycomb-dataset": "pender"
26+
27+
service:
28+
# telemetry:
29+
# logs:
30+
# level: "debug"
31+
pipelines:
32+
metrics:
33+
receivers: [prometheus]
34+
processors: [memory_limiter, batch]
35+
exporters: [otlp/metrics]

0 commit comments

Comments
 (0)