Repository navigation
feat: allow HTTP operations to be configurable via environment variable - #1352
Merged
ezhang6811 merged 8 commits intoApr 10, 2026
Merged
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1352 +/- ##
=============================================
- Coverage 85.71% 69.39% -16.33%
- Complexity 19 704 +685
=============================================
Files 3 63 +60
Lines 49 3437 +3388
Branches 5 487 +482
=============================================
+ Hits 42 2385 +2343
- Misses 3 861 +858
- Partials 4 191 +187 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ezhang6811
force-pushed
the
zhaez/http-operation-config
branch
from
April 9, 2026 23:18
b48fb3f to
d04032d
Compare
ezhang6811
force-pushed
the
zhaez/http-operation-config
branch
from
April 9, 2026 23:20
d04032d to
f1f70bb
Compare
ezhang6811
force-pushed
the
zhaez/http-operation-config
branch
from
April 10, 2026 19:42
1a0a171 to
1b546fc
Compare
ezhang6811
marked this pull request as ready for review
April 10, 2026 19:46
wangzlei
previously approved these changes
Apr 10, 2026
wangzlei
approved these changes
Apr 10, 2026
ezhang6811
added a commit
to aws-observability/aws-otel-python-instrumentation
that referenced
this pull request
Apr 15, 2026
…le (#718) *Issue #, if available:* *Description of changes:* Same as aws-observability/aws-otel-java-instrumentation#1352 When HTTP span names don't contain a URL path, we generate the HTTP operation by truncating the URL path to only the first trailing value to preserve low cardinality (i.e. /api/v1/users -> /api). This can result in overly broad operation groupings for services with endpoint paths of various depths. This PR introduces an environment variable configuration, `OTEL_AWS_HTTP_OPERATION_PATHS`, which allows users to configure their own HTTP endpoint paths. If this variable is provided, the span name's URL path will resolve to the longest matching path. Wildcards are supported with the following syntaxes: `{version}`, `:version`, or simply `*`. This way, users can decide how their service endpoint are grouped into operation names shown in CloudWatch. Added unit and integration tests to verify behavior, and did some E2E testing with an instrumented HTTP server. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: ADOT Patch workflow <adot-patch-workflow@github.com>
ezhang6811
added a commit
to aws-observability/aws-otel-js-instrumentation
that referenced
this pull request
Apr 15, 2026
…le (#388) *Issue #, if available:* *Description of changes:* Same as aws-observability/aws-otel-java-instrumentation#1352 When HTTP span names don't contain a URL path, we generate the HTTP operation by truncating the URL path to only the first trailing value to preserve low cardinality (i.e. /api/v1/users -> /api). This can result in overly broad operation groupings for services with endpoint paths of various depths. This PR introduces an environment variable configuration, `OTEL_AWS_HTTP_OPERATION_PATHS`, which allows users to configure their own HTTP endpoint paths. If this variable is provided, the span name's URL path will resolve to the longest matching path. Wildcards are supported with the following syntaxes: `{version}`, `:version`, or simply `*`. This way, users can decide how their service endpoint are grouped into operation names shown in CloudWatch. Added unit tests to verify behavior, and did some E2E testing with an instrumented HTTP server. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Lei Wang <66336933+wangzlei@users.noreply.github.com>
ezhang6811
added a commit
to aws-observability/aws-otel-dotnet-instrumentation
that referenced
this pull request
Apr 15, 2026
…le (#392) *Issue #, if available:* *Description of changes:* Same as aws-observability/aws-otel-java-instrumentation#1352 When HTTP span names don't contain a URL path, we generate the HTTP operation by truncating the URL path to only the first trailing value to preserve low cardinality (i.e. /api/v1/users -> /api). This can result in overly broad operation groupings for services with endpoint paths of various depths. This PR introduces an environment variable configuration, `OTEL_AWS_HTTP_OPERATION_PATHS`, which allows users to configure their own HTTP endpoint paths. If this variable is provided, the span name's URL path will resolve to the longest matching path. Wildcards are supported with the following syntaxes: `{version}`, `:version`, or simply `*`. This way, users can decide how their service endpoint are grouped into operation names shown in CloudWatch. Added unit tests to verify behavior, and did some E2E testing with an instrumented HTTP server. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
ezhang6811
added a commit
that referenced
this pull request
Apr 16, 2026
…le (#1352) *Issue #, if available:* *Description of changes:* When HTTP span names don't contain a URL path, we generate the HTTP operation by truncating the URL path to only the first trailing value to preserve low cardinality (i.e. /api/v1/users -> /api). This can result in overly broad operation groupings for services with endpoint paths of various depths. This PR introduces an environment variable configuration, `OTEL_AWS_HTTP_OPERATION_PATHS`, which allows users to configure their own HTTP endpoint paths. If this variable is provided, the span name's URL path will resolve to the longest matching path. Wildcards are supported with the following syntaxes: `{version}`, `:version`, or simply `*`. This way, users can decide how their service endpoint are grouped into operation names shown in CloudWatch. Added unit and integration tests to verify behavior, and did some E2E testing with an instrumented HTTP server. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
ezhang6811
added a commit
that referenced
this pull request
Apr 16, 2026
… variab… (#1359) Backpatch #1352 to release 2.26.x branch. *Issue #, if available:* *Description of changes:* When HTTP span names don't contain a URL path, we generate the HTTP operation by truncating the URL path to only the first trailing value to preserve low cardinality (i.e. /api/v1/users -> /api). This can result in overly broad operation groupings for services with endpoint paths of various depths. This PR introduces an environment variable configuration, `OTEL_AWS_HTTP_OPERATION_PATHS`, which allows users to configure their own HTTP endpoint paths. If this variable is provided, the span name's URL path will resolve to the longest matching path. Wildcards are supported with the following syntaxes: `{version}`, `:version`, or simply `*`. This way, users can decide how their service endpoint are grouped into operation names shown in CloudWatch. Added unit and integration tests to verify behavior, and did some E2E testing with an instrumented HTTP server. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. *Issue #, if available:* *Description of changes:* By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
ezhang6811
added a commit
to aws-observability/aws-otel-dotnet-instrumentation
that referenced
this pull request
Aug 5, 2026
…SP.NET Core spans (#441) ## Description For ASP.NET Core server spans, `GetIngressOperation` always took the `HttpContextWeakRef` branch and derived the operation from the framework route template, overwriting the `DisplayName` that `ApplyOperationPathSpanName` set from `OTEL_AWS_HTTP_OPERATION_PATHS`. As a result the configuration had **no effect** on `aws.local.operation` in .NET, unlike Java ([#1352](aws-observability/aws-otel-java-instrumentation#1352)) and Python ([#718](aws-observability/aws-otel-python-instrumentation#718)). This resolves the configured operation path in `GetIngressOperation` **before** the route-template branch, so a configured path takes precedence, matching the other languages. `ApplyOperationPathSpanName` now shares the same matching logic via `GetOperationPathOverride`. ## Testing Added a unit test verifying the configured path wins over the ASP.NET Core route template when `HttpContextWeakRef` is present. Full suite passes on net8.0 and net10.0. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
When HTTP span names don't contain a URL path, we generate the HTTP operation by truncating the URL path to only the first trailing value to preserve low cardinality (i.e. /api/v1/users -> /api). This can result in overly broad operation groupings for services with endpoint paths of various depths.
This PR introduces an environment variable configuration,
OTEL_AWS_HTTP_OPERATION_PATHS, which allows users to configure their own HTTP endpoint paths. If this variable is provided, the span name's URL path will resolve to the longest matching path. Wildcards are supported with the following syntaxes:{version},:version, or simply*. This way, users can decide how their service endpoint are grouped into operation names shown in CloudWatch.Added unit and integration tests to verify behavior, and did some E2E testing with an instrumented HTTP server.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.