Deploy OpenTelemetry Collector

Kibana version : 7.6

Elasticsearch version : 7.6

APM Server version : 7.3.2

APM Agent language and version : java 1.9.0

Fresh install or upgraded from other version? fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. :----no

I have converted my opentracing spans to Open telemetry.

I have placed the collector code in my code base and overwrote the elastic exporter. I am not seeing my spans in APM.

I am wondering how the data reaches the collector ? I made the Yaml changes. But not understanding how the collector is invoked? Do we need an opentelemetry agent. Is the collector like a normal repository and agent directly send data to collector ?

I am wondering how the data reaches the collector ? I made the Yaml changes. But not understanding how the collector is invoked? Do we need an opentelemetry agent. Is the collector like a normal repository and agent directly send data to collector ?

https://www.elastic.co/guide/en/apm/get-started/current/open-telemetry-elastic.html shows the flow of data from your application, instrumented with the OpenTelemetry SDK, through the OpenTelemetry Collector ("contrib" distribution), and from there to Elastic APM. If you haven't already, please read that. If you have read it, which part are you unsure about?

If you can share your opentelemetry-collector-contrib configuration then we may be able to help debug.

Hi ,

Thanks for reply . I already read through that. I m unsure about the collector part. Am I supposed to download the collector or is it already integrated with ELk and just need to do config chnge?

Also is there a need to have an opentelemetry agent to talk to collector?

Thanks for reply . I already read through that. I m unsure about the collector part. Am I supposed to download the collector or is it already integrated with ELk and just need to do config chnge?

Yes, you will need to download and run OpenTelemetry Collector separately. See https://www.elastic.co/guide/en/apm/get-started/current/open-telemetry-elastic-get-started.html#open-telemetry-elastic-download

Also is there a need to have an opentelemetry agent to talk to collector?

You will need the following:

  • Elastic APM Server (+Elasticsearch, Kibana)
  • OpenTelemetry Collector (contrib), with the Elastic exporter configured to export traces to your Elastic APM Server
  • OpenTelemetry SDK (to instrument your application), configured to export traces to the OpenTelemetry Collector

You can run the OpenTelemetry Collector in multiple modes, depending on your needs. Please refer to the "Deployment" section of the OpenTelemetry Collector docs: https://opentelemetry.io/docs/collector/about/

The documentation from open telemetry is pretty generalzed angvague.
I tried to do set up and was not successful.

Would have been great if i could follow a better documentation. The elastic docs were like a breeze which lay man can even follow.

OK, we currently don't have any docs going into detail on OpenTelemetry Collector. Perhaps when things have stabilised more we would have a more detailed quick-start guide.

In the mean time: aside from the links above, you might find this quick-start example helpful:

In it you will find a docker-compose.yml which sets up:

  • Elasticsearch, Kibana, APM Server
  • OpenTelemetry Collector (contrib distribution)
  • a Go service instrumented with the Elastic APM Agent
  • Python and Node.js services instrumented with the OpenTelemetry SDKs

I just went and updated that repo, as I found the "latest" Docker image of OpenTelemetry Collector has some breaking changes. Perhaps this is why you have had troubles getting things working? Make sure you use the most recent release tag, 0.9.0.

Thx @axw, I was able to use docker-compose (Elastic + OP Collector) and send traces to APM with Java OpenTelemetry lib (without agent).

What about metrics?
I tried to extend collector config with:

metrics:
receivers: [otlp]
exporters: [elastic]
processors: [batch, queued_retry]

But getting error in collector logs:

application run finished with error: cannot setup pipelines: cannot build builtExporters: pipeline "metrics" of data type "metrics" has an exporter "elastic", which does not support that data type

Do I use the wrong config or this functionality not implemented yet?

Thx

@AlexeyPirogov welcome to the forum!

Glad to hear you were able to get it working. Metrics support is not yet implemented. Please subscribe to https://github.com/elastic/apm/issues/337 for updates on that.

1 Like