Skip to content

Commit

Permalink
fix format of changelog and test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Shi, Stone <[email protected]>
  • Loading branch information
shijiadong2022 committed Aug 13, 2024
1 parent 88ef2c7 commit 14b0bc5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2750](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2750))
- `opentelemetry-instrumentation-django` Fix regression - `http.target` re-added back to old semconv duration metrics
([#2746](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2746))
- `opentelemetry-instrumentation-asgi` do not set url.full attribute for server spans
- `opentelemetry-instrumentation-asgi` do not set `url.full` attribute for server spans
([#2735](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2735))
- `opentelemetry-instrumentation-grpc` Fixes the issue with the gRPC instrumentation not working with the 1.63.0 and higher version of gRPC
([#2483](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2484))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,17 @@ def test_query_string(self):
attrs[SpanAttributes.HTTP_URL], "http://127.0.0.1/?foo=bar"
)

def test_query_string_new_semconv(self):
self.scope["query_string"] = b"foo=bar"
attrs = otel_asgi.collect_request_attributes(
self.scope,
_HTTPStabilityMode.HTTP,
)
self.assertEqual(attrs[URL_SCHEME], "http")
self.assertEqual(attrs[SERVER_ADDRESS], "127.0.0.1")
self.assertEqual(attrs[URL_PATH], "/")
self.assertEqual(attrs[URL_QUERY], "foo=bar")

def test_query_string_both_semconv(self):
self.scope["query_string"] = b"foo=bar"
attrs = otel_asgi.collect_request_attributes(
Expand All @@ -1692,6 +1703,10 @@ def test_query_string_both_semconv(self):
self.assertEqual(
attrs[SpanAttributes.HTTP_URL], "http://127.0.0.1/?foo=bar"
)
self.assertEqual(attrs[URL_SCHEME], "http")
self.assertEqual(attrs[SERVER_ADDRESS], "127.0.0.1")
self.assertEqual(attrs[URL_PATH], "/")
self.assertEqual(attrs[URL_QUERY], "foo=bar")

def test_query_string_percent_bytes(self):
self.scope["query_string"] = b"foo%3Dbar"
Expand Down

0 comments on commit 14b0bc5

Please sign in to comment.