Opentelemetry-go: How to export metrics and traces to OpenTelemetry Agent or Collector?

Created on 17 Apr 2020  路  3Comments  路  Source: open-telemetry/opentelemetry-go

I can find examples of exporting metrics directory to Prometheus and traces directory to Jaeger. How can I export metrics and traces to an OpenTelemetry agent or a collector cluster and then export from collector to Prometheus and Jaeger?

metrics documentation good first issue exporter

All 3 comments

I started working on a prototype for this, and will try to write some docs and a proper example for illustrating it. At the moment I'm a bit stuck because of the otel-collector issue #815.

As a quick example for exporting traces to Jaeger, assuming you have the otel-collector and Jaeger running:
1) add the otlp receiver to the otel-collector configuration: receivers: otlp: {}. This will create the otlp receiver on the default port 55680
2) Open up the 55680 port on your collector deployment if using k8s or docker
3) make sure you have the Jaeger exporter endpoint in the otel-collector configuration: exporters: jaeger: endpoint: "simplest-collector.default.svc.cluster.local:14250" Replace with a real endpoint.
3) Follow this example to create an application that connects to the otel-collector's otlp receiver.
4) Run the example, and you should see Jaeger starting to complain that "process is empty for the span". (#815)

I think the trick, and what is not documented, is that you have to create the otlp receiver on the otel-collector (step 1). Once this is up and running, you can connect to it from your application, and start sending data to the collector/agent. The rest of the pipeline is simply otel-collector exporting the traces to Jaeger. The same I assume would work for metrics also.

You can find a short example here: https://github.com/stefanprisca/opentelemetry-go/tree/otel-collector-demo/example/otel-collector

does this issue need any additional help? I would like to work on this as a first issue

I don't think think there is much left to do. There is already a PR (#711) with the demo application.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrAlias picture MrAlias  路  6Comments

MrAlias picture MrAlias  路  4Comments

johananl picture johananl  路  6Comments

Aneurysm9 picture Aneurysm9  路  4Comments

MrAlias picture MrAlias  路  6Comments