OpenTelemetry Collector Service
OTLP HTTP Exporter
In the Exporters section of the workshop, we configured the otlphttp
exporter to send metrics to Splunk Observability Cloud. We now need to enable this under the metrics pipeline.
Update the exporters
section to include otlphttp/splunk
under the metrics
pipeline:
service:
pipelines:
traces:
receivers: [otlp, opencensus, jaeger, zipkin]
processors: [batch]
exporters: [logging]
metrics:
receivers: [hostmetrics, otlp, opencensus, prometheus/internal]
processors: [batch, resourcedetection/system, resourcedetection/ec2, attributes/conf]
exporters: [logging, otlphttp/splunk]
Final configuration
Tip
It is recommended that you validate your configuration file before restarting the collector. You can do this by using the built-in validate
command:
otelcol-contrib validate --config=file:/etc/otelcol-contrib/config.yaml
Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:
* error decoding 'processors': error reading configuration for "attributes/conf": 1 error(s) decoding:
* 'actions[0]' has invalid keys: actions
2023/06/29 09:41:28 collector server run finished with error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:
* error decoding 'processors': error reading configuration for "attributes/conf": 1 error(s) decoding:
* 'actions[0]' has invalid keys: actions
Now that we have a working configuration, let’s start the collector and then check to see what zPages is reporting.
otelcol-contrib --config=file:/etc/otelcol-contrib/config.yaml