mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 21:56:07 +08:00
27 lines
457 B
Python
27 lines
457 B
Python
"""
|
|
Standard http tags.
|
|
|
|
For example:
|
|
|
|
span.set_tag(URL, '/user/home')
|
|
span.set_tag(STATUS_CODE, 404)
|
|
"""
|
|
from . import SpanTypes
|
|
|
|
# [TODO] Deprecated, remove when we remove AppTypes
|
|
# type of the spans
|
|
TYPE = SpanTypes.HTTP
|
|
|
|
# tags
|
|
URL = 'http.url'
|
|
METHOD = 'http.method'
|
|
STATUS_CODE = 'http.status_code'
|
|
QUERY_STRING = 'http.query.string'
|
|
|
|
# template render span type
|
|
TEMPLATE = 'template'
|
|
|
|
|
|
def normalize_status_code(code):
|
|
return code.split(' ')[0]
|