ApplicationInsights-dotnet icon indicating copy to clipboard operation
ApplicationInsights-dotnet copied to clipboard

NLog ApplicationInsightsTarget with support for IncludeMldc

Open snakefoot opened this issue 5 years ago • 8 comments

Add support for NLog Mapped Diagnostic Logical Context (MDLC)

Changes

  • Updated to NLog 4.7.15 with support for writing into existing property-bag.
  • Inheriting from TargetWithContext

Checklist

  • [ ] I ran Unit Tests locally.
  • [ ] CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • [ ] Design discussion issue #
  • [ ] Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

snakefoot avatar Oct 30 '20 22:10 snakefoot

@TimothyMothra why has this never get merged? Or has received any feedback?

304NotModified avatar Aug 17 '22 14:08 304NotModified

Should I interpret the staleness of this PR to mean that there is a very low likelihood of https://github.com/microsoft/ApplicationInsights-dotnet/issues/2785 being resolved?

TheXenocide avatar Jun 08 '23 21:06 TheXenocide

I'm guessing Microsoft wanted to invite existing NLog users to try the fruits of ApplicationInsights, which give birth to this NLog Target.

Microsoft is probably putting most of their energy into their pure Microsoft Extension Logging integration with ApplicationInsights, and not any hybrid modes.

Microsoft probably believes that one would not use NLog, after having started using Microsoft Extensions Logging.

snakefoot avatar Jun 11 '23 20:06 snakefoot

Maybe we should fork this repo and release it as a NLog package. Not perfect, but I dont like getting ghosted.

304NotModified avatar Jun 12 '23 06:06 304NotModified

Maybe we should fork this repo and release it as a NLog package. Not perfect, but I dont like getting ghosted.

Would prefer if someone with extensive knowledge about ApplicationInsights (along with its telemetry capture) took up the challenge. Since right now this NLog-target package cannot stand on its own (doesn't capture/forward all application-performance keyfigures).

snakefoot avatar Jun 12 '23 15:06 snakefoot

From what I could see, I suspect maybe the App Insights team has been focused on other platforms (e.g. Python, etc.) for a little while, plus MS has been dedicating resources to integrating OpenTelemetry (which is a less proprietary design for similar functionality) to both .NET and App Insights so I'm hopeful it has just been a matter of lacking resources to dedicate to this side for now, though it does seem this has been here quite a while. I've also recently learned that .NET 8 is introducing a new Microsoft.Extensions.Telemetry set of abstractions so maybe there are some major refactorings coming? Not sure what to expect, just yet, as there's no documentation or road map about this very recent announcement and I haven't read the source yet.

Either way, without knowing what implementation we could possibly pursue with those things yet, we find ourselves missing needed functionality to properly implement App Insights at the immediate moment, since all of our logging goes through NLog and we don't have a current enough bridge to bring our traces and exceptions from there into App Insights.

TheXenocide avatar Jun 12 '23 21:06 TheXenocide

The overview linked there has the following excerpt which makes me wonder where we should be focusing our effort for the next release:

While we see OpenTelemetry as our future direction, we have no plans to stop collecting data from older SDKs. We still have a way to go before our Azure OpenTelemetry Distros reach feature parity with our Application Insights SDKs. In many cases, customers will continue to choose to use Application Insights SDKs for quite some time.

TheXenocide avatar Jun 20 '23 20:06 TheXenocide