feat: add opentelemetry collector
parent
99f02db4a4
commit
18135851d1
|
@ -0,0 +1,10 @@
|
||||||
|
services:
|
||||||
|
collector:
|
||||||
|
image: otel/opentelemetry-collector-contrib:latest
|
||||||
|
ports:
|
||||||
|
- "4317:4317" # OTLP gRPC
|
||||||
|
- "55681:55681" # OTLP HTTP
|
||||||
|
- "8888:8888" # Prometheus metrics endpoint
|
||||||
|
volumes:
|
||||||
|
- ./config.yaml:/etc/otel/config.yaml
|
||||||
|
command: ["--config", "/etc/otel/config.yaml"]
|
|
@ -0,0 +1,45 @@
|
||||||
|
receivers:
|
||||||
|
mysql:
|
||||||
|
endpoint: "mysql-primary.eigen-erp-test.svc.cluster.local:3306" # Replace with your MySQL host and port
|
||||||
|
username: "root" # The dedicated MySQL user
|
||||||
|
password: "eigen3m!" # Use environment variable for password for security
|
||||||
|
collection_interval: 10s # How frequently to collect metrics (e.g., 10 seconds)
|
||||||
|
initial_delay: 1s # Initial delay before starting collection
|
||||||
|
# Optional: Configure statement events for detailed query metrics
|
||||||
|
statement_events:
|
||||||
|
digest_text_limit: 120
|
||||||
|
time_limit: 24h
|
||||||
|
limit: 250
|
||||||
|
|
||||||
|
processors:
|
||||||
|
# metricstransform:
|
||||||
|
# transforms:
|
||||||
|
# - include: mysql.* # Include all MySQL metrics
|
||||||
|
# match_type: regexp
|
||||||
|
# action: insert
|
||||||
|
# operations:
|
||||||
|
# - action: add_label
|
||||||
|
# new_label: cluster
|
||||||
|
# new_value: "internal.eigen.local"
|
||||||
|
batch:
|
||||||
|
send_batch_size: 10000
|
||||||
|
timeout: 10s
|
||||||
|
|
||||||
|
exporters:
|
||||||
|
# otlp:
|
||||||
|
# endpoint: "172.10.10.6:30641" # Or your OTLP backend endpoint (e.g., a tracing/metrics backend like Jaeger, Prometheus, or a vendor's OTLP endpoint)
|
||||||
|
# tls:
|
||||||
|
# insecure: true # Set to false and configure proper TLS for production
|
||||||
|
prometheusremotewrite:
|
||||||
|
endpoint: "http://172.10.10.6:30291/api/v1/receive" # Or your Prometheus remote write endpoint
|
||||||
|
external_labels:
|
||||||
|
cluster: internal.eigen.local
|
||||||
|
|
||||||
|
service:
|
||||||
|
pipelines:
|
||||||
|
metrics:
|
||||||
|
receivers: [mysql]
|
||||||
|
processors: [batch]
|
||||||
|
exporters: [prometheusremotewrite]
|
||||||
|
# If you also want to collect logs or traces from other sources, you'd add
|
||||||
|
# log and trace pipelines here as well.
|
Loading…
Reference in New Issue