serilog-contrib / serilog-sinks-applicationinsights

A Serilog sink that writes events to Microsoft Azure Application Insights
Apache License 2.0
220 stars 72 forks source link

A way to disable MessageTemplate written to root/event Name #219

Closed AcePalsgaard closed 10 months ago

AcePalsgaard commented 10 months ago

Using Azure Application Insights we have a feature called User Flows. This one uses event Name combined with Session_id from Event root and nothing from custom properties. Name is overridden with MessageTemplate and renderes the whole Azure feature useless. This is a shame. Do not confuse with Operation_name - this is a different property and not the one used in User Flows.

Supposedly overriding ForwardPropertiesToTelemetryProperties and set includeMessageTemplate to false could/should/would/hopefully do this, but thats just me hoping. Template is still inserted in EventName.

A way to control what is written to Name would be greatly appreciated, so I wont have to build my own User Flow application; especially because Microsoft already did this for me :)

Existing functionality is documented here: https://github.com/serilog-contrib/serilog-sinks-applicationinsights/blob/dev/README.md#what-does-the-sink-submit

AcePalsgaard commented 10 months ago

I might have solved it myself using the ForwardPropertiesToTelemetryProperties and a converter