Code Monkey home page Code Monkey logo

Comments (4)

marcinbudny avatar marcinbudny commented on July 20, 2024

Hi, the name of the operation is constructed here: https://github.com/marcinbudny/applicationinsights-owinextensions/blob/develop/src/ApplicationInsights.OwinExtensions/HttpRequestTrackingMiddleware.cs#L108
and later on attached to the telemetry. Please verify your OWIN pipeline setup.

from applicationinsights-owinextensions.

kaftw avatar kaftw commented on July 20, 2024

The request operation name is recorded for requests, which is why I changed the name of the issue after I saw that. But when tracking events, it is no longer populated as it used to be prior to moving to OWIN and this package.

My current setup is invoking the UseApplicationInsights extension method for IAppBuilder, which uses the HttpRequestTrackingMiddleware class you linked to. However, that class is only recording the operation name when tracking a request and not for events tracked during a request.

We're using this method specifically: https://docs.microsoft.com/en-us/dotnet/api/microsoft.applicationinsights.telemetryclient.trackevent.

from applicationinsights-owinextensions.

marcinbudny avatar marcinbudny commented on July 20, 2024

This library does not support putting operation name on custom events. With OWIN hosting, the ambient HttpContext is not available. Information about current request is hard to extract unless you have direct access to the OWIN context (e.g. you are creating the event in a middleware or MVC controller). You could try to build your own telemetry initializer and store the information in a similar way to what OperationIdTelemetryInitializer does.
Also it should be possible to correlate all the events within one request by operation id, so maybe you don't need to put this info on all events.

from applicationinsights-owinextensions.

kaftw avatar kaftw commented on July 20, 2024

Thanks!

from applicationinsights-owinextensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.