question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] Export trace events as Event Telemetry

See original GitHub issue

Library name and version

Azure.Monitor.OpenTelemetry.Exporter 1.0.0-beta.8

Query/Question

In a .Net 6 Web Api controller action I added an event to the current span with the expectation it would end up as an event in Application Insights. The following code is executed

Tracer.CurrentSpan.AddEvent("Event");

However, it ends up as a trace in Application Insights. Looking at the code of the exporter it seems events have no place (yet). Is this by design?

Environment

No response

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Expechocommented, Mar 27, 2023

@vishweshbankwar First of all, thank you for taking time to react to my query. I am sorry to see it is closed immediately as I have a follow-up question and proposal. For a starter, can you explain what you mean with “There is no equivalent for CustomEvents available right now.”?

I assume it has to do with the fact that according to the OTEL spec events are just a special type of LogRecords but in the context of Application Insights (AI) it would make sense to export them as a CustomEvents record. I have a lot of applications that are instrumented using the AI SDK. For new applications I am tempted to use the OTEL SDK as it gives us more flexibility regarding the backend of our traces.

For now we do use the Events telemetry type a lot, given the way they can be analyzed in AI. How about making it optional (and disabled by default) to export events as CustomEvents? Also, given the current state it is near impossible to distinct a trace from an event in AI. I hope you see the reasoning behind my question.

I would be more than happy to draft out a PR to facilitate this using the AzureMonitorExporterOptions or any other way you might seem as a better fit.

(If you rather want me to create a new issue for this, please let me know)

0reactions
mattmcclearycommented, Apr 11, 2023

Hi Peter,

I appreciate your feedback.

We use it to log business events, like “Invoice Downloaded”. According to the docs this is what events should be used for. I got the feeling this is not the case when OTEL is used. What is your thought about that?

Not today, though the OTel community understands the need for these kinds of business events. The question is whether it should be an extension to existing language logging APIs or an altogether new OpenTelemetry events API. Does this make a difference to you or is it just technical jargon? (i.e., just give me a way)

In the meantime as Azure we need to decide if our OpenTelemetry Distro should wait for OTel to catch up or if we should build some sort of temporary back compat shim that temporarily supports Track.Event from the App Insights API. If Azure offered some sort of temporary vender-specific business events OTel extension, would you be interested?

If you go ahead and build your own mechanism, would it be a custom SDK? Would you still drop your events in Azure? Would would be the reporting experience? Is this something you’d switch over to OTel standard in the future when available?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Insights API for custom events and metrics
Use the Application Insights core telemetry API to send custom events and metrics and your own versions of standard telemetry.
Read more >
Telemetry Event IDs in Application Insights
Event ID Area Message AL0000E24 Job Queue Lifecycle Job queue entry enqueued: AL0000E25 Job Queue Lifecycle Job queue entry started: AL0000E26 Job Queue Lifecycle Job queue...
Read more >
Uniting Tracing and Logs With OpenTelemetry Span Events
See how you can look at logging-shaped information and tracing information in the same place using Honeycomb.
Read more >
What Are Traces, and How SQL (Yes, ...
The OpenTelemetry tracing specification defines the data model for a trace. Technically, a trace is a directed acyclic graph of Spans with ...
Read more >
Traces
Trace Exporters send traces to a consumer. This consumer can be standard output for debugging and development-time, the OpenTelemetry Collector, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found