1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00

Update semconv comments (#1249)

Add comments to fix lint issues with the semconv package and add
clarifying documentation for attributes.
This commit is contained in:
Tyler Yahn 2020-10-13 12:35:10 -07:00 committed by GitHub
parent 5c21e88fde
commit 4ea0a20885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -213,6 +213,7 @@ const (
CloudZoneKey = label.Key("cloud.zone") CloudZoneKey = label.Key("cloud.zone")
) )
// Semantic conventions for common cloud provider resource attributes.
var ( var (
CloudProviderAWS = CloudProviderKey.String("aws") CloudProviderAWS = CloudProviderKey.String("aws")
CloudProviderAzure = CloudProviderKey.String("azure") CloudProviderAzure = CloudProviderKey.String("azure")

View File

@ -41,6 +41,7 @@ const (
NetHostNameKey = label.Key("net.host.name") NetHostNameKey = label.Key("net.host.name")
) )
// Semantic conventions for common transport protocol attributes.
var ( var (
NetTransportTCP = NetTransportKey.String("IP.TCP") NetTransportTCP = NetTransportKey.String("IP.TCP")
NetTransportUDP = NetTransportKey.String("IP.UDP") NetTransportUDP = NetTransportKey.String("IP.UDP")
@ -126,10 +127,13 @@ const (
HTTPResponseContentLengthUncompressedKey = label.Key("http.response_content_length_uncompressed") HTTPResponseContentLengthUncompressedKey = label.Key("http.response_content_length_uncompressed")
) )
// Semantic conventions for common HTTP attributes.
var ( var (
// Semantic conventions for HTTP(S) URI schemes.
HTTPSchemeHTTP = HTTPSchemeKey.String("http") HTTPSchemeHTTP = HTTPSchemeKey.String("http")
HTTPSchemeHTTPS = HTTPSchemeKey.String("https") HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
// Semantic conventions for HTTP protocols.
HTTPFlavor1_0 = HTTPFlavorKey.String("1.0") HTTPFlavor1_0 = HTTPFlavorKey.String("1.0")
HTTPFlavor1_1 = HTTPFlavorKey.String("1.1") HTTPFlavor1_1 = HTTPFlavorKey.String("1.1")
HTTPFlavor2 = HTTPFlavorKey.String("2") HTTPFlavor2 = HTTPFlavorKey.String("2")
@ -149,6 +153,7 @@ const (
DBUserKey = label.Key("db.user") DBUserKey = label.Key("db.user")
) )
// Semantic conventions for common database system attributes.
var ( var (
DBSystemDB2 = DBSystemKey.String("db2") // IBM DB2 DBSystemDB2 = DBSystemKey.String("db2") // IBM DB2
DBSystemDerby = DBSystemKey.String("derby") // Apache Derby DBSystemDerby = DBSystemKey.String("derby") // Apache Derby
@ -227,11 +232,15 @@ const (
RPCMessageUncompressedSizeKey = label.Key("message.uncompressed_size") RPCMessageUncompressedSizeKey = label.Key("message.uncompressed_size")
) )
// Semantic conventions for common RPC attributes.
var ( var (
// Semantic convention for gRPC as the remoting system.
RPCSystemGRPC = RPCSystemKey.String("grpc") RPCSystemGRPC = RPCSystemKey.String("grpc")
// Semantic convention for a message named message.
RPCNameMessage = RPCNameKey.String("message") RPCNameMessage = RPCNameKey.String("message")
// Semantic conventions for RPC message types.
RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") RPCMessageTypeSent = RPCMessageTypeKey.String("SENT")
RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
) )
@ -280,12 +289,18 @@ const (
MessagingRabbitMQRoutingKeyKey = label.Key("messaging.rabbitmq.routing_key") MessagingRabbitMQRoutingKeyKey = label.Key("messaging.rabbitmq.routing_key")
) )
// Semantic conventions for common messaging system attributes.
var ( var (
// Semantic conventions for message destinations.
MessagingDestinationKindKeyQueue = MessagingDestinationKindKey.String("queue") MessagingDestinationKindKeyQueue = MessagingDestinationKindKey.String("queue")
MessagingDestinationKindKeyTopic = MessagingDestinationKindKey.String("topic") MessagingDestinationKindKeyTopic = MessagingDestinationKindKey.String("topic")
// Semantic convention for message destinations that are temporary.
MessagingTempDestination = MessagingTempDestinationKey.Bool(true) MessagingTempDestination = MessagingTempDestinationKey.Bool(true)
// Semantic convention for the operation parts of message consumption.
// This does not include a "send" attribute as that is explicitly not
// allowed in the OpenTelemetry specification.
MessagingOperationReceive = MessagingOperationKey.String("receive") MessagingOperationReceive = MessagingOperationKey.String("receive")
MessagingOperationProcess = MessagingOperationKey.String("process") MessagingOperationProcess = MessagingOperationKey.String("process")
) )
@ -324,13 +339,16 @@ const (
FaaSCronKey = label.Key("faas.cron") FaaSCronKey = label.Key("faas.cron")
) )
// Semantic conventions for common FaaS system attributes.
var ( var (
// Semantic conventions for the types of triggers.
FaasTriggerDatasource = FaaSTriggerKey.String("datasource") FaasTriggerDatasource = FaaSTriggerKey.String("datasource")
FaasTriggerHTTP = FaaSTriggerKey.String("http") FaasTriggerHTTP = FaaSTriggerKey.String("http")
FaasTriggerPubSub = FaaSTriggerKey.String("pubsub") FaasTriggerPubSub = FaaSTriggerKey.String("pubsub")
FaasTriggerTimer = FaaSTriggerKey.String("timer") FaasTriggerTimer = FaaSTriggerKey.String("timer")
FaasTriggerOther = FaaSTriggerKey.String("other") FaasTriggerOther = FaaSTriggerKey.String("other")
// Semantic conventions for the types of operations performed.
FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")