Skip to content

Commit

Permalink
http.target in old sem metric attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
GonzaloGuasch committed Jul 18, 2024
1 parent c8d9555 commit 7d3c150
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ def _start_response(status, response_headers, *args, **kwargs):
)

if wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY, None):
duration_attrs_old[HTTP_ROUTE] = wrapped_app_environ.get(
_ENVIRON_REQUEST_ROUTE_KEY
)
duration_attrs_old[HTTP_TARGET] = wrapped_app_environ.get(
_ENVIRON_REQUEST_ROUTE_KEY
)
Expand All @@ -418,9 +415,6 @@ def _start_response(status, response_headers, *args, **kwargs):
duration_attrs_new[HTTP_ROUTE] = wrapped_app_environ.get(
_ENVIRON_REQUEST_ROUTE_KEY
)
duration_attrs_new[HTTP_TARGET] = wrapped_app_environ.get(
_ENVIRON_REQUEST_ROUTE_KEY
)

duration_histogram_new.record(
max(duration_s, 0), duration_attrs_new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ def expected_attributes_new(override_attributes):


_server_duration_attrs_old_copy = _server_duration_attrs_old.copy()
_server_duration_attrs_old_copy.append("http.route")
_server_duration_attrs_old_copy.append("http.target")

_server_duration_attrs_new_copy = _server_duration_attrs_new.copy()
_server_duration_attrs_new_copy.append("http.target")
_server_duration_attrs_new_copy.append("http.route")

_expected_metric_names_old = [
"http.server.active_requests",
Expand Down Expand Up @@ -577,7 +576,6 @@ def test_basic_metric_success(self):
self.client.get("/hello/756")
expected_duration_attributes = {
"http.method": "GET",
"http.route": "/hello/<int:helloid>",
"http.target": "/hello/<int:helloid>",
"http.host": "localhost",
"http.scheme": "http",
Expand Down Expand Up @@ -605,7 +603,6 @@ def test_basic_metric_success_new_semconv(self):
"http.request.method": "GET",
"url.scheme": "http",
"http.route": "/hello/<int:helloid>",
"http.target": "/hello/<int:helloid>",
"network.protocol.version": "1.1",
"http.response.status_code": 200,
}
Expand Down

0 comments on commit 7d3c150

Please sign in to comment.