Skip to content

Populate HttpMethod field from http.request.method for consistency with .NET/Node SDKs #4623

@evmimagina

Description

@evmimagina

Is your feature request related to a problem? Please describe.

When using Application Insights Java Agent 3.x, the HttpMethod field in the
requests table is always empty. The HTTP method is only available embedded
in the name field (e.g., "GET /api/users").

This is frustrating because:

  1. KQL queries using HttpMethod return no results for Java services
  2. Cross-service queries don't work uniformly (.NET services have HttpMethod, Java doesn't)
  3. Existing dashboards and alerts that filter by HttpMethod break when adding Java services
  4. The field exists but is empty, which looks like a bug rather than expected behavior

Describe the solution you would like

Map the OpenTelemetry http.request.method attribute to the legacy HttpMethod
field in Application Insights request telemetry.

This would make Java Agent 3.x consistent with .NET and Node.js SDKs, which
populate this field.


Describe alternatives you have considered

Current workaround is parsing the method from the name field in KQL:

requests
| extend HttpMethod = tostring(split(name, " ")[0])

This works but requires modifying all existing queries, dashboards, and alerts.
It also adds overhead and is error-prone if the name format changes.


Additional context

  • Java Agent version: 3.7.7 (and likely all 3.x versions)
  • The change to OpenTelemetry semantic conventions (http.method → http.request.method)
    happened in Nov 2023, but the HttpMethod field was never mapped
  • This affects mixed-language environments where consistent telemetry querying is important

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions