Files
otel-collector/processor/signozspanmetricsprocessor/testdata/config-prometheusremotewrite.yaml

74 lines
2.2 KiB
YAML

# This example is practical application of a 3-pipeline configuration for
# writing to a remote prometheus-compatible write endpoint.
#
# The spanmetrics processor will output data on every span batch that is received,
# that could overwhelm the remote write endpoint.
#
# Therefore, a good pattern to follow is to ratelimit the metrics coming out of
# spanmetrics by adding a prometheus exporter (to expose these metrics as snapshots)
# and a prometheus receiver to scrape these snapshots at a controlled interval,
# passing these scraped metrics onto the prometheusremotewrite exporter.
#
# The added benefit of this pattern is that it provides a regular "heartbeat" of
# datapoints that prevents gaps in the timeseries.
receivers:
jaeger:
protocols:
thrift_http:
endpoint: "0.0.0.0:14278"
# Dummy receiver that's never used, because a pipeline is required to have one.
otlp/spanmetrics:
protocols:
grpc:
endpoint: "localhost:12345"
prometheus:
config:
scrape_configs:
- job_name: 'ratelimiter'
scrape_interval: 15s
static_configs:
- targets: [ "0.0.0.0:8889" ]
exporters:
prometheus:
endpoint: "0.0.0.0:8889"
jaeger:
endpoint: "localhost:14250"
tls:
insecure: true
prometheusremotewrite:
endpoint: "http://myremotewriteendpoint:1234"
headers:
Authorization: "Bearer mybearertoken"
processors:
batch:
signozspanmetrics:
metrics_exporter: prometheus
service:
pipelines:
traces:
receivers: [jaeger]
# spanmetrics will pass on span data untouched to next processor
# while also accumulating metrics to be sent to the configured 'otlp/spanmetrics' exporter.
processors: [signozspanmetrics, batch]
exporters: [jaeger]
# This pipeline acts as a proxy to the 'metrics' pipeline below,
# allowing for further metrics processing if required.
metrics/spanmetrics:
# This receiver is just a dummy and never used.
# Added to pass validation requiring at least one receiver in a pipeline.
receivers: [otlp/spanmetrics]
exporters: [prometheus]
metrics:
receivers: [prometheus]
# The metrics_exporter must be present in this list.
exporters: [prometheusremotewrite]