Share via

How to customize the operation name displayed in the Azure application insights portal using asp.net core and applicationinsights 3.0.0

AlanStone 20 Reputation points
2026-03-17T16:09:41.37+00:00

I have an ASP .NET Core (NET 10) web application. Before the applicationinsights 3.0.0 .NET NuGet package version, one could customize the displayed operation name using a telemetry initializer that sets the name and operation name on the request telemetry object.

With applicationinsights 3.0.0 migration to OpenTelemetry, telemetry initializers have been replaced with BaseProcessor<Activity>. But Activity.OperationName is a read-only property and thus cannot be customized, and Activity.DisplayName does not seem to be used by the Azure Application Insights portal.

Is there a way to customize the displayed operation name?

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.


Answer accepted by question author
  1. Suchitra Suregaunkar 11,805 Reputation points Microsoft External Staff Moderator
    2026-03-17T19:40:57.9933333+00:00

    Hello AlanStone

    With Application Insights 3.x (OpenTelemetry‑based), you cannot override the “Operation name” the same way you did in 2.x, and there is no supported way today to arbitrarily rename it in the Azure portal. This is a known limitation of the OpenTelemetry migration, not a bug in your code.

    In Application Insights 2.x, the portal’s Operation name was derived from:

    • RequestTelemetry.Name
    • RequestTelemetry.Context.Operation.Name

    These were mutable, so a TelemetryInitializer could rewrite them.

    Application Insights 3.x is a shim on top of OpenTelemetry:

    • Requests are represented as Activity
    • The operation name is derived from the root Activity
    • Activity.OperationName is read‑only by design
    • Activity.DisplayName is ignored by the Azure Monitor exporter

    This is why:

    • BaseProcessor<Activity> cannot change it
    • Setting DisplayName has no effect in the portal

    This is by design, not an implementation gap.

    Please have a look into below supported approach:

    1. Control the operation name at Activity creation time:

    The only supported way to influence the operation name is when the Activity is started.

    If you create your own server Activities:

    private static readonly ActivitySource Source =
        new("MyCompany.MyService");
    using var activity = Source.StartActivity(
        "OrdersController.CreateOrder",
        ActivityKind.Server);
    

    That name will appear as the operation name in Application Insights. This does not override the ASP.NET Core auto‑generated request Activity. It only works for custom server spans.

    1. Use route‑based naming via ASP.NET Core instrumentation

    For HTTP requests, Azure Monitor derives the operation name from:

    • HTTP method
    • Route template (when available)

    Example:

    GET /api/orders/{id}
    

    This is the only supported way to influence request operation names for ASP.NET Core.

    Microsoft confirms that manual override is not supported in OTel mode.

    1. Add a custom dimension instead of renaming

    The recommended replacement is:

    • Keep the default operation name
    • Add a custom tag
    • Query/group by that tag in KQL

    Example:

    Activity.Current?.SetTag(
        "app.operationAlias",
        "CreateOrder");
    

    This tag:

    • Is fully supported
    • Appears in customDimensions
    • Can be used in queries and dashboards

    With Application Insights 3.x, the SDK is built on OpenTelemetry. The “Operation name” shown in the Azure portal is derived from the root Activity and cannot be overridden after creation.

    Unlike Application Insights 2.x, TelemetryInitializer is no longer available, Activity.OperationName is read‑only, and Activity.DisplayName is ignored by the Azure Monitor exporter.

    At this time, overriding the operation name is not supported when using OpenTelemetry with Application Insights.

    The supported alternatives are:

    Control the name when starting custom Activities

    Rely on ASP.NET Core route‑based naming for HTTP requests

    Add a custom tag and query/group by it instead of renaming the operation

    Thanks,

    Suchitra.


1 additional answer

Sort by: Most helpful
  1. AlanStone 20 Reputation points
    2026-03-17T16:29:09.83+00:00

    Update: it looks like the Activity.DisplayName is displayed in some parts of the Azure Application Insights portal for the request, but not in others. So I think this is just an Azure portal quirk that will hopefully get fixed at some point and that setting Activity.DisplayName is the correct approach to customizing the operation name for requests.

    In the attached image, highlight #1 shows where the original name (from Activity.OperationName) is displayed, whereas highlight #2 shows where the custom name (from Activity.DisplayName) is displayed.

    azure ai opentelemetry displayed request names

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.