How to export from OpenTelemetry to Observability APM

Kibana version:
8.6.2

Elasticsearch version:
8.6.2

APM Server version:
8.6.2

APM Agent language and version:

Original install method (e.g. download page, yum, deb, from source, etc.) and version:

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs?

Nothing special, we have our elastic stack hosted in a Kubernetes cluster.

I'm working on a .NET 7 application that has been instrumented with OpenTelemetry. I'm trying to see my traces in Kibana. Here are my settings

// OpenTelemetry
            services
                .AddOpenTelemetry()
                .ConfigureResource(
                    resourceBuilder => resourceBuilder.AddService(DiagnosticsConfig.ServiceName)
                )
                .WithTracing(
                    tracerProviderBuilder =>
                        tracerProviderBuilder
                            .AddSource(DiagnosticsConfig.ActivitySource.Name)
                            .AddConsoleExporter()
                            .AddOtlpExporter(opt =>
                            {
                                opt.Protocol = OpenTelemetry
                                    .Exporter
                                    .OtlpExportProtocol
                                    .HttpProtobuf;
                                opt.Endpoint = new Uri(
                                    "https://elastic-apm.dev.blahblah.com"
                                );
                            })
                );

When I go to my elastic APM services, I do not see my service.

I have followed the instructions here. The issue comes when I try to implement this. My config file looks like this

receivers:
  otlp:
    protocols:
      grpc:
      http:

exporters:
  logging:
    loglevel: debug

  elasticsearch/trace:
    endpoints: [http://apm-server.local:8200]
    user:
    password:
    api_key:
    tls:
      insecure_skip_verify: true

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [elasticsearch/trace]

I do not know what to this file in the context of my environment. For more context, the .net 7 app is deployed in a kubernetes cluster with a docker file. I do not manage the elastic stack.

Can you try with these settings for the exporters section:

exporters:
  logging:
    loglevel: debug 
  elasticsearch/trace: 
    endpoint: "apm-server.local:8200"  
    headers:
      Authorization: "ApiKey <your-api-key>"

Getting Started | OpenTelemetry describes how to use the config file.

If data still do not show up, please check the apm-server log files to see if requests are even sent to the server and if there are any errors logged.

I was able to get my traces exported to elastic without using the config file. All I did was remove the line

.AddConsoleExporter()

and it worked.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.