Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.46k stars 4.8k forks source link

[QUERY] Enriching activity using the current request #41147

Open safakgur opened 10 months ago

safakgur commented 10 months ago

Library name and version

Azure.Monitor.OpenTelemetry.AspNetCore 1.0.0

Query/Question

I use Azure.Monitor.OpenTelemetry.AspNetCore 1.0.0 to add OTel HttpClient instrumentation and Azure Monitor exporter.

On 1.0.0-beta.7, I was able to do the following:

services.Configure<AspNetCoreInstrumentationOptions>(opts =>
{
    opts.EnrichWithHttpRequest = (activity, httpRequest) =>
    {
        // Use `httpRequest` to add tags to `activity`
    };
});

But with the new version, AspNetCoreInstrumentationOptions is made internal.

So, what's the new, recommended way of enriching the request activity?

One alternative I've been experimenting with is moving away from this do-it-all package to the following, more granular packages:

...but I'd rather keep this one if it provides the same features.

Environment

Windows 10 .NET 8.0.100 Visual Studio 17.8.0

github-actions[bot] commented 9 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzmonActionG @AzmonAlerts @AzMonEssential @AzmonLogA @dadunl @SameergMS.

github-actions[bot] commented 9 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzmonActionG @AzmonAlerts @AzMonEssential @AzmonLogA @dadunl @SameergMS.