mirror of
https://github.com/fosrl/gerbil.git
synced 2026-05-15 12:49:56 +00:00
Add OpenTelemetry and Prometheus metrics infrastructure
This commit is contained in:
46
examples/otel-collector-config.yaml
Normal file
46
examples/otel-collector-config.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
receivers:
|
||||
otlp:
|
||||
protocols:
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
http:
|
||||
endpoint: 0.0.0.0:4318
|
||||
|
||||
processors:
|
||||
batch:
|
||||
timeout: 10s
|
||||
send_batch_size: 1024
|
||||
|
||||
# Add resource attributes
|
||||
resource:
|
||||
attributes:
|
||||
- key: service.environment
|
||||
value: "development"
|
||||
action: insert
|
||||
|
||||
exporters:
|
||||
# Prometheus exporter for scraping
|
||||
prometheus:
|
||||
endpoint: "0.0.0.0:8889"
|
||||
namespace: "gerbil"
|
||||
send_timestamps: true
|
||||
metric_expiration: 5m
|
||||
resource_to_telemetry_conversion:
|
||||
enabled: true
|
||||
|
||||
# Prometheus remote write (optional)
|
||||
prometheusremotewrite:
|
||||
endpoint: "http://prometheus:9090/api/v1/write"
|
||||
tls:
|
||||
insecure: true
|
||||
|
||||
# Debug exporter for debugging
|
||||
debug:
|
||||
verbosity: normal
|
||||
|
||||
service:
|
||||
pipelines:
|
||||
metrics:
|
||||
receivers: [otlp]
|
||||
processors: [batch, resource]
|
||||
exporters: [prometheus, prometheusremotewrite, debug]
|
||||
24
examples/prometheus.yml
Normal file
24
examples/prometheus.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
external_labels:
|
||||
cluster: 'gerbil-dev'
|
||||
|
||||
scrape_configs:
|
||||
# Scrape Gerbil's /metrics endpoint directly
|
||||
- job_name: 'gerbil'
|
||||
static_configs:
|
||||
- targets: ['gerbil:3003']
|
||||
labels:
|
||||
service: 'gerbil'
|
||||
environment: 'development'
|
||||
|
||||
# Scrape OpenTelemetry Collector metrics
|
||||
- job_name: 'otel-collector'
|
||||
static_configs:
|
||||
- targets: ['otel-collector:8888']
|
||||
labels:
|
||||
service: 'otel-collector'
|
||||
- targets: ['otel-collector:8889']
|
||||
labels:
|
||||
service: 'otel-collector-prometheus-exporter'
|
||||
Reference in New Issue
Block a user