This repository has been archived by the owner on May 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e79bb85
commit eaa2524
Showing
2 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import opentracing "github.com/opentracing/opentracing-go" | |
// | ||
var ( | ||
////////////////////////////////////////////////////////////////////// | ||
// SpanKind (client/server) | ||
// SpanKind (client/server or producer/consumer) | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
// SpanKind hints at relationship between spans, e.g. client/server | ||
|
@@ -31,6 +31,16 @@ var ( | |
SpanKindRPCServerEnum = SpanKindEnum("server") | ||
SpanKindRPCServer = opentracing.Tag{Key: string(SpanKind), Value: SpanKindRPCServerEnum} | ||
|
||
// SpanKindProducer marks a span representing the producer-side of a | ||
// message bus | ||
SpanKindProducerEnum = SpanKindEnum("producer") | ||
SpanKindProducer = opentracing.Tag{Key: string(SpanKind), Value: SpanKindProducerEnum} | ||
|
||
// SpanKindConsumer marks a span representing the consumer-side of a | ||
// message bus | ||
SpanKindConsumerEnum = SpanKindEnum("consumer") | ||
SpanKindConsumer = opentracing.Tag{Key: string(SpanKind), Value: SpanKindConsumerEnum} | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// Component name | ||
////////////////////////////////////////////////////////////////////// | ||
|
@@ -52,9 +62,14 @@ var ( | |
// communications, like an RPC call. | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
// PeerService records the service name of the peer | ||
// PeerService records the service name of the peer. | ||
PeerService = stringTagName("peer.service") | ||
|
||
// PeerAddress records the address name of the peer. This may be a "ip:port", | ||
// a bare "hostname", a FQDN or even a database DSN substring | ||
// like "mysql://[email protected]:3306/dbname" | ||
PeerAddress = stringTagName("peer.address") | ||
|
||
// PeerHostname records the host name of the peer | ||
PeerHostname = stringTagName("peer.hostname") | ||
|
||
|
@@ -82,6 +97,31 @@ var ( | |
// HTTP response. | ||
HTTPStatusCode = uint16TagName("http.status_code") | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// DB Tags | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
// DBInstance is database instance name. | ||
DBInstance = stringTagName("db.instance") | ||
|
||
// DBStatement is a database statement for the given database type. | ||
// It can be a query or a prepared statement (i.e., before substitution). | ||
DBStatement = stringTagName("db.statement") | ||
|
||
// DBType is a database type. For any SQL database, "sql". | ||
// For others, the lower-case database category, e.g. "redis" | ||
DBType = stringTagName("db.type") | ||
|
||
// DBUser is a username for accessing database. | ||
DBUser = stringTagName("db.user") | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// Message Bus Tag | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
// MessageBusDestination is an address at which messages can be exchanged | ||
MessageBusDestination = stringTagName("message_bus.destination") | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// Error Tag | ||
////////////////////////////////////////////////////////////////////// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters