Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] IncludeScopes set to false is disregarded #47621

Open
mpodonyi opened this issue Dec 19, 2024 · 0 comments
Open

[BUG] IncludeScopes set to false is disregarded #47621

mpodonyi opened this issue Dec 19, 2024 · 0 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Distro Monitor OpenTelemetry Distro needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service This issue points to a problem in the service.

Comments

@mpodonyi
Copy link

Library name and version

Azure.Monitor.OpenTelemetry.AspNetCore V1.3.0-beta.2

Describe the bug

I set IncludeScopes explicitly to false but i still see the the Scopes included in Azure Monitor.
In version 1.2.0 this was working:

   public static IHostBuilder MyUseLogging(this IHostBuilder hostBuilder)
    {
        hostBuilder.ConfigureServices((context, services) =>
        {
            var loggingConfiguration = context.Configuration.GetSection(nameof(LoggingConfiguration)).Get<LoggingConfiguration>()!;
            
            services.Configure<OpenTelemetryLoggerOptions>(opt => { opt.IncludeScopes = false; });

            services.AddOpenTelemetry().UseAzureMonitor(o => { o.ConnectionString = loggingConfiguration.ApplicationInsightsConnectionString; });
        });


        return hostBuilder;
    }

Expected behavior

I should not see scopes in Azure AppInsights when I log with scope:

using (_logger.BeginScope("ScopeId: {ScopeId}", Guid.NewGuid()))
        {
            
            _logger.LogInformation("Default Get");
        }

Actual behavior

I see the scope ScopeId appearing as custom Property in Azure App Insights.

Reproduction Steps

See code above.

Environment

No response

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 19, 2024
@mpodonyi mpodonyi changed the title [BUG] IncludeScopes is disregarded [BUG] IncludeScopes set to false is disregarded Dec 19, 2024
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service This issue points to a problem in the service. Monitor - Distro Monitor OpenTelemetry Distro and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor - Distro Monitor OpenTelemetry Distro needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service This issue points to a problem in the service.
Projects
None yet
Development

No branches or pull requests

2 participants