diff --git a/README.md b/README.md index 0b27d80..6218860 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ This is a [Docker Compose](https://docs.docker.com/compose/) configuration that - Narcissus screenshot service (container `narcissus`) at [http://localhost:8687](http://localhost:8687) - Fetch fact-checking service (container `fetch`) at [http://localhost:8687/about](http://localhost:8687/about) - Search v2 prototype application (container `search`) at [http://localhost:8001](http://localhost:8001) +- Otel Collector – you can configure receivers, processors and exporters in the otel-collector-config.yaml ## Testing diff --git a/docker-compose.yml b/docker-compose.yml index 16fcdbd..162bfe6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -126,6 +126,8 @@ services: extra_hosts: - "host.docker.internal:host-gateway" pender: + # env_file: + # - ./pender/.env build: pender platform: linux/x86_64 shm_size: 1G @@ -160,13 +162,13 @@ services: SERVER_PORT: 3200 networks: - dev + # If you want to run the OpenTelemetry Collector, uncomment the lines below # otel-collector: # image: otel/opentelemetry-collector-contrib # volumes: - # - ./pender/config/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml - # depends_on: - # - pender + # - ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml # environment: + # x_honeycomb_team: ${X_HONEYCOMB_TEAM} # Set this env var in your shell before running docker-compose # RAILS_ENV: development # SERVER_PORT: 3200 # networks: diff --git a/otel-collector-config.yaml b/otel-collector-config.yaml new file mode 100644 index 0000000..0c852e5 --- /dev/null +++ b/otel-collector-config.yaml @@ -0,0 +1,35 @@ +receivers: + prometheus: + config: + scrape_configs: + - job_name: "prometheus" + scrape_interval: 15s + static_configs: + - targets: ["pender:3200"] + +processors: + memory_limiter: + check_interval: 1s + limit_percentage: 80 + spike_limit_percentage: 20 + batch: + timeout: 200ms + send_batch_size: 8192 + +exporters: + otlp/metrics: + endpoint: "api.honeycomb.io:443" # US instance + #endpoint: "api.eu1.honeycomb.io:443" # EU instance + headers: + "x-honeycomb-team": ${env:x_honeycomb_team} # Honeycomb API KEY + "x-honeycomb-dataset": "pender" + +service: + # telemetry: + # logs: + # level: "debug" + pipelines: + metrics: + receivers: [prometheus] + processors: [memory_limiter, batch] + exporters: [otlp/metrics]