| 1 |
# Copyright The OpenTracing Authors |
| 2 |
# Copyright Uber Technologies, Inc |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
# you may not use this file except in compliance with the License. |
| 6 |
# You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
|
| 16 |
from __future__ import absolute_import |
| 17 |
|
| 18 |
# The following tags are described in greater detail at the following url: |
| 19 |
# https://github.com/opentracing/specification/blob/master/semantic_conventions.md |
| 20 |
|
| 21 |
# Here we define standard names for tags that can be added to spans by the |
| 22 |
# instrumentation code. The actual tracing systems are not required to |
| 23 |
# retain these as tags in the stored spans if they have other means of |
| 24 |
# representing the same data. For example, the SPAN_KIND='server' can be |
| 25 |
# inferred from a Zipkin span by the presence of ss/sr annotations. |
| 26 |
|
| 27 |
# --------------------------------------------------------------------------- |
| 28 |
# SPAN_KIND hints at relationship between spans, e.g. client/server |
| 29 |
# --------------------------------------------------------------------------- |
| 30 |
SPAN_KIND = 'span.kind' |
| 31 |
|
| 32 |
# Marks a span representing the client-side of an RPC or other remote call |
| 33 |
SPAN_KIND_RPC_CLIENT = 'client' |
| 34 |
|
| 35 |
# Marks a span representing the server-side of an RPC or other remote call |
| 36 |
SPAN_KIND_RPC_SERVER = 'server' |
| 37 |
|
| 38 |
# Marks a span representing the consumer-side of a messaging call |
| 39 |
SPAN_KIND_CONSUMER = 'consumer' |
| 40 |
|
| 41 |
# Marks a span representing the producer-side of a messaging call |
| 42 |
SPAN_KIND_PRODUCER = 'producer' |
| 43 |
|
| 44 |
# --------------------------------------------------------------------------- |
| 45 |
# SERVICE indicates the service name for a span, which overrides any default |
| 46 |
# "service name" property defined in a tracer's config. The meaning of |
| 47 |
# service should correspond to the value set in peer.service, except it is |
| 48 |
# applied to the current span. This tag is meant to only be used when a |
| 49 |
# tracer is reporting spans on behalf of another service. This tag does not |
| 50 |
# need to be used when reporting spans for the service the tracer is running |
| 51 |
# in. |
| 52 |
# --------------------------------------------------------------------------- |
| 53 |
SERVICE = 'service' |
| 54 |
|
| 55 |
# --------------------------------------------------------------------------- |
| 56 |
# ERROR indicates whether a Span ended in an error state. |
| 57 |
# --------------------------------------------------------------------------- |
| 58 |
ERROR = 'error' |
| 59 |
|
| 60 |
# --------------------------------------------------------------------------- |
| 61 |
# COMPONENT (string) ia s low-cardinality identifier of the module, library, |
| 62 |
# or package that is generating a span. |
| 63 |
# --------------------------------------------------------------------------- |
| 64 |
COMPONENT = 'component' |
| 65 |
|
| 66 |
# --------------------------------------------------------------------------- |
| 67 |
# SAMPLING_PRIORITY (uint16) determines the priority of sampling this Span. |
| 68 |
# --------------------------------------------------------------------------- |
| 69 |
SAMPLING_PRIORITY = 'sampling.priority' |
| 70 |
|
| 71 |
# --------------------------------------------------------------------------- |
| 72 |
# PEER_* tags can be emitted by either client-side of server-side to describe |
| 73 |
# the other side/service in a peer-to-peer communications, like an RPC call. |
| 74 |
# --------------------------------------------------------------------------- |
| 75 |
|
| 76 |
# PEER_SERVICE (string) records the service name of the peer |
| 77 |
PEER_SERVICE = 'peer.service' |
| 78 |
|
| 79 |
# PEER_HOSTNAME (string) records the host name of the peer |
| 80 |
PEER_HOSTNAME = 'peer.hostname' |
| 81 |
|
| 82 |
# PEER_ADDRESS (string) suitable for use in a networking client library. |
| 83 |
# This may be a "ip:port", a bare "hostname", a FQDN, or even a |
| 84 |
# JDBC substring like "mysql://prod-db:3306" |
| 85 |
PEER_ADDRESS = 'peer.address' |
| 86 |
|
| 87 |
# PEER_HOST_IPV4 (uint32) records IP v4 host address of the peer |
| 88 |
PEER_HOST_IPV4 = 'peer.ipv4' |
| 89 |
|
| 90 |
# PEER_HOST_IPV6 (string) records IP v6 host address of the peer |
| 91 |
PEER_HOST_IPV6 = 'peer.ipv6' |
| 92 |
|
| 93 |
# PEER_PORT (uint16) records port number of the peer |
| 94 |
PEER_PORT = 'peer.port' |
| 95 |
|
| 96 |
# --------------------------------------------------------------------------- |
| 97 |
# HTTP tags |
| 98 |
# --------------------------------------------------------------------------- |
| 99 |
|
| 100 |
# HTTP_URL (string) should be the URL of the request being handled in this |
| 101 |
# segment of the trace, in standard URI format. The protocol is optional. |
| 102 |
HTTP_URL = 'http.url' |
| 103 |
|
| 104 |
# HTTP_METHOD (string) is the HTTP method of the request. |
| 105 |
# Both upper/lower case values are allowed. |
| 106 |
HTTP_METHOD = 'http.method' |
| 107 |
|
| 108 |
# HTTP_STATUS_CODE (int) is the numeric HTTP status code (200, 404, etc) |
| 109 |
# of the HTTP response. |
| 110 |
HTTP_STATUS_CODE = 'http.status_code' |
| 111 |
|
| 112 |
# --------------------------------------------------------------------------- |
| 113 |
# DATABASE tags |
| 114 |
# --------------------------------------------------------------------------- |
| 115 |
|
| 116 |
# DATABASE_INSTANCE (string) The database instance name. E.g., In java, if |
| 117 |
# the jdbc.url="jdbc:mysql://127.0.0.1:3306/customers", the instance |
| 118 |
# name is "customers" |
| 119 |
DATABASE_INSTANCE = 'db.instance' |
| 120 |
|
| 121 |
# DATABASE_STATEMENT (string) A database statement for the given database |
| 122 |
# type. E.g., for db.type="SQL", "SELECT * FROM user_table"; |
| 123 |
# for db.type="redis", "SET mykey 'WuValue'". |
| 124 |
DATABASE_STATEMENT = 'db.statement' |
| 125 |
|
| 126 |
# DATABASE_TYPE (string) For any SQL database, "sql". For others, |
| 127 |
# the lower-case database category, e.g. "cassandra", "hbase", or "redis". |
| 128 |
DATABASE_TYPE = 'db.type' |
| 129 |
|
| 130 |
# DATABASE_USER (string) Username for accessing database. E.g., |
| 131 |
# "readonly_user" or "reporting_user" |
| 132 |
DATABASE_USER = 'db.user' |
| 133 |
|
| 134 |
# --------------------------------------------------------------------------- |
| 135 |
# MESSAGE_BUS tags |
| 136 |
# --------------------------------------------------------------------------- |
| 137 |
|
| 138 |
# MESSAGE_BUS_DESTINATION (string) An address at which messages can be |
| 139 |
# exchanged. E.g. A Kafka record has an associated "topic name" that can |
| 140 |
# be extracted by the instrumented producer or consumer and stored |
| 141 |
# using this tag. |
| 142 |
MESSAGE_BUS_DESTINATION = 'message_bus.destination' |