Skip to content

Commit

Permalink
Per spec, full url with query params needs to be part of the "http.url"
Browse files Browse the repository at this point in the history
span attribute.
  • Loading branch information
Kami committed Jul 23, 2019
1 parent e383d22 commit 55447e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _before_request(self):
tracer.add_attribute_to_current_span(
HTTP_METHOD, flask.request.method)
tracer.add_attribute_to_current_span(
HTTP_URL, str(flask.request.base_url))
HTTP_URL, str(flask.request.url))
execution_context.set_opencensus_attr(
'blacklist_hostnames',
self.blacklist_hostnames)
Expand Down
6 changes: 5 additions & 1 deletion contrib/opencensus-ext-flask/tests/test_flask_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ def test_query_params_are_not_included_as_part_of_span_name(self):
span = tracer.current_span()

expected_attributes = {
'http.url': u'http://localhost/path/value',
# NOTE: Query params need to be include as per spec
# https://github.com/census-instrumentation/opencensus-specs
# TODO: Open feedback PR to spec and suggestion making query
# params optional since they can contain sensitive data
'http.url': u'http://localhost/path/value?foo=bar&bar=baz',
'http.method': 'GET',
}

Expand Down

0 comments on commit 55447e2

Please sign in to comment.