# Elastic APM instrumentation vs OpenTelemetry instrumentation

**URL:** <https://discuss.elastic.co/t/elastic-apm-instrumentation-vs-opentelemetry-instrumentation/344785>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [October 11, 2023, 5:44am UTC](https://discuss.elastic.co/t/elastic-apm-instrumentation-vs-opentelemetry-instrumentation/344785 "2023-10-11T05:44:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deastr](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@deastr](https://discuss.elastic.co/u/deastr)\
**Post date:** [October 11, 2023, 5:44am UTC](https://discuss.elastic.co/t/elastic-apm-instrumentation-vs-opentelemetry-instrumentation/344785/1 "2023-10-11T05:44:30Z")

</div>

I'm trying OpenTelemetry client with Elastic APM to log into Elastic APM server. There are several instrumentations that exists both in OTEL client and Elastic APM client, for example `AspNetCoreInstrumentation`. Do these do the same thing? Do I need to use both or either of them?

Sample:

```auto
services.AddOpenTelemetry()
                .ConfigureResource(resource => resource
                    .AddService(serviceName))
                .WithTracing(tracing => tracing
                    .AddSource(serviceName)
                    .AddAspNetCoreInstrumentation()); // <--

...
hostbuilder.UseElasticApm(new AspNetCoreDiagnosticSubscriber()); // <--

```

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [November 2, 2023, 3:00pm UTC](https://discuss.elastic.co/t/elastic-apm-instrumentation-vs-opentelemetry-instrumentation/344785/2 "2023-11-02T15:00:50Z")

</div>

Hi, @deastr.

Generally, you'd choose one agent that best suits your needs. Both support similar instrumentations, although equally, both have some unique support right now. You can see what Elastic APM .NET agent supports [here](https://www.elastic.co/guide/en/apm/agent/dotnet/current/supported-technologies.html). We also have some features such as central config, span compression etc. which are not part of OTel.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 30, 2023, 3:00pm UTC](https://discuss.elastic.co/t/elastic-apm-instrumentation-vs-opentelemetry-instrumentation/344785/3 "2023-11-30T15:00:52Z")

</div>

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