Skip to content

[BUG] Excessive http.client telemetry #52674

@acu-kevinb

Description

@acu-kevinb

Library name and version

Azure.Monitor.OpenTelemetry.AspNetCore 1.3.0

Describe the bug

When using the default configuration for Azure Monitor for OpenTelemetry

            builder.Services.AddOpenTelemetry()
                .ConfigureResource(r => r.AddService("Playground"))
                .UseAzureMonitor();

An excessive amount of metrics items are published to application insights. For a project with a single downstream dependency on Microsoft Graph and around 200 requests per day, this results in over 300,000 'http.client.open_connections' metrics items per day. The issue appears to be that the metrics are dimensioned heavily, so that each combination of remote hostname, remote IP, HTTP protocol and connection state results in an individual telemetry item, and that host/IP combinations which have no active or inactive connections are still reported for the entire lifetime of the application. Meaning that if I make a single HTTP request to a downstream service on app startup, App Insights will record a telemetry item for that one per minute forever, even though I have no remaining connection to that service.

Image

Expected behavior

Metrics such as http.client.open_connections would only be reported when there is at least one active or inactive connection, but not reported if there are no connections.

Actual behavior

Metrics such as http.client.open_connections are reported one per minute even though no connection to the given service exists in any state.

Reproduction Steps

Create a asp.net core web application project and use the default configuration for azure monitor open telemetry:

            builder.Services.AddOpenTelemetry()
                .ConfigureResource(r => r.AddService("Playground"))
                .UseAzureMonitor();

Make a single HTTP request from a controller action, and invoke that action. Observe that app insights 'customMetrics' continues to grow with new metrics for that downstream connection well after the point where the connection no longer exists.

Environment

.net 9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageMonitorMonitor, Monitor Ingestion, Monitor QueryService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions