Skip to content
← Back to activity

Solution skill

In Asp.Net Core Can't export traces from OpenTelemetry exporter to elastic apm

Version 3Sign in to save

Complete solution

In Asp.Net Core Can't export traces from OpenTelemetry exporter to elastic apm. After some search, reinstall and debug I found my fault. Use when hitting this exact issue. Not for unrelated errors or different features.

TL;DR

After some search, reinstall and debug I found my fault. I Downloaded AspNetCore sample from OpenTelemetry .net samples and I found that I should add next line in my code: AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

The error

In Asp.Net Core Can't export traces from OpenTelemetry exporter to elastic apm

Fix

  1. After some search, reinstall and debug I found my fault. Expected: You get the expected result; the problem is gone.

  2. I Downloaded AspNetCore sample from OpenTelemetry .net samples and I found that I should add next line in my code: AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); Expected: You get the expected result; the problem is gone.

  3. Re-run the original operation and confirm the error is gone. Expected: no error, normal output.

When to use

  • You hit this exact error.
  • The symptom matches: In Asp.Net Core Can't export traces from OpenTelemetry exporter to elastic apm.

When NOT to use

  • A different error message; the cause here is specific to this error.
  • Unrelated issues with a different cause.
  • You need general documentation for the tool; check the official docs instead.

Compatibility

Reported per the linked source. Source: https://stackoverflow.com/questions/71222918/in-asp-net-core-cant-export-traces-from-opentelemetry-exporter-to-elastic-a.

Variant phrasings

In Asp.Net Core Can't export traces from OpenTelemetry exporter to elastic apm

Why it happens

Recently, I found OpenTelemetry, and I like to use it in my application. First, I created a new Asp.Net Core 5 web API and exported traces on the console. After that, I tried OpenTelemetry.Exporter.OpenTelemetryProtocol for export traces to Elastic APM, but I couldn't see log or traces at elastic. In 3rd step, I used Elastic.Apm.NetCoreAll, and I successfully sent traces to APM. So I think my Elastic APM configurations are correct, but some configurations at asp are wrong. Ca

Edge cases

  • If your error message differs even slightly, this is probably a different issue; search the exact text.
  • If the fix does not help, capture the full error output and check the source link for updates.

Source

https://stackoverflow.com/questions/71222918/in-asp-net-core-cant-export-traces-from-opentelemetry-exporter-to-elastic-apm

Evidence

Source: Recently, I found OpenTelemetry, and I like to use it in my application. First, I created a new Asp.Net Core 5 web API and exported traces on the console. After that, I tried OpenTelemetry.Exporter.OpenTelemetryProtocol for export traces to Elastic APM, but I couldn't see log or traces at elastic. In 3rd step, I used Elastic.Apm.NetCoreAll, and I successfully sent traces to APM. So I think my Elastic APM configurations are correct, but some configurations at asp are wrong. Ca

Verified resolution: After some search, reinstall and debug I found my fault. I Downloaded AspNetCore sample from OpenTelemetry .net samples and I found that I should add next line in my code: AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

Source URL: https://stackoverflow.com/questions/71222918/in-asp-net-core-cant-export-traces-from-opentelemetry-exporter-to-elastic-apm

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_XnOEMS3pPUDxU1r-cV0kfQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">In Asp.Net Core Can&#39;t export traces from OpenTelemetry exporter to elastic apm <span>— Vectle</span></a>