Closed reillysiemens closed 1 year ago
Thanks for reporting. I wasn't aware of customEvents
. It's not possible at the moment to send those. Events are reported either as traces
or exceptions
. This used to mimic Microsoft's JavaScript and Python OpenTelemetry exporters. I'm not sure if that's still the case.
That said, supporting customEvents
sounds like a good idea.
I wonder how we could differentiate customEvents
from traces
, i.e. when do we report what? Maybe an special attribute on the event?
I'm on mobile right now. It may take a few days until I can take a proper look.
From what I understand, Application Insight's official SDKs only support the "traces" standard for Open Telemetry at this time. That is in part, because the logs API for Open Telemetry is still not considered stable
Just speculating, but I suspect that once they adopt the logs standard, they'll use the the customEvents
table for that (and metrics will go to the customMetrics
table)
I think that makes some sense, @mirdaki. Meanwhile, if it's not too much trouble, @frigus02, would it be possible to support customEvents
in a fashion similar to "exception"
with a special event name (perhaps "custom"
)? Or would you rather delay that to wait for stabilization?
Thanks for the links, @mirdaki.
Meanwhile, if it's not too much trouble, @frigus02, would it be possible to support customEvents in a fashion similar to "exception" with a special event name (perhaps "custom")?
Yeah, that sounds fine to me.
I'm still out and don't have access to my laptop. I'll have a closer look next week.
That's fine, @frigus02. No worries and no rush. I'm not yet in a position to take advantage of this, so don't let my questions push you towards an implementation sooner than you want. 🙂
Sorry for the long delay. I finally got to this: #55. The implementation was easy, but I'm not 10% happy with it, yet.
Specifying the event name as an attribute feels awkward:
Reading more of the docs, it sounds to me like customEvents are meant for business events, which may not entirely match the OpenTelemetry event.
Semantically, events may or may not be correlated to requests. However, if used properly, event telemetry is more important than requests or traces. Events represent business telemetry and should be a subject to separate, less aggressive sampling. -- https://learn.microsoft.com/en-us/azure/azure-monitor/app/data-model-event-telemetry
How to use customEvents is probably an indivual project's decision, though. Not something this crate should be too concerned about. So I'm still happy to support that.
I'm going to think about the event name thing for another day or 2. If I can't come up with anything better, I'm just going to merge and release as is. If you have any thoughts, please let me know.
Sorry for the delay again. I didn't find much time after work lately. Anyway, I just published version 0.23.0, which supports custom events.
If I understand the documentation correctly all events without
exception.{type,message,stacktrace}
as the name end up in thetraces
table in Application Insights. Is there any support for sending events to thecustomEvents
table? Most of the examples (understandably) focus on therequests
,dependencies
, andexceptions
tables, but those aren't relevant to every application.If it's possible to send
customEvents
I would be happy to submit a PR documenting how to do so in an example.