From fc9e8ff2e93d7d93484d9bd78720e014c9a05737 Mon Sep 17 00:00:00 2001 From: Jay Camp Date: Wed, 2 Sep 2020 11:28:40 -0400 Subject: [PATCH 1/2] order attributes --- translator/conventions/opentelemetry.go | 204 ++++++++++++------------ 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/translator/conventions/opentelemetry.go b/translator/conventions/opentelemetry.go index a13dfa60e3e..debfd8ed012 100644 --- a/translator/conventions/opentelemetry.go +++ b/translator/conventions/opentelemetry.go @@ -17,96 +17,96 @@ package conventions // OpenTelemetry Semantic Convention values for Resource attribute names. // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/README.md const ( - AttributeServiceName = "service.name" - AttributeServiceNamespace = "service.namespace" - AttributeServiceInstance = "service.instance.id" - AttributeServiceVersion = "service.version" - AttributeTelemetrySDKName = "telemetry.sdk.name" - AttributeTelemetrySDKLanguage = "telemetry.sdk.language" - AttributeTelemetrySDKVersion = "telemetry.sdk.version" - AttributeTelemetryAutoVersion = "telemetry.auto.version" - AttributeContainerName = "container.name" + AttributeCloudAccount = "cloud.account.id" + AttributeCloudProvider = "cloud.provider" + AttributeCloudRegion = "cloud.region" + AttributeCloudZone = "cloud.zone" AttributeContainerID = "container.id" AttributeContainerImage = "container.image.name" + AttributeContainerName = "container.name" AttributeContainerTag = "container.image.tag" - AttributeFaasName = "faas.name" AttributeFaasID = "faas.id" - AttributeFaasVersion = "faas.version" AttributeFaasInstance = "faas.instance" + AttributeFaasName = "faas.name" + AttributeFaasVersion = "faas.version" + AttributeHostHostname = "host.hostname" + AttributeHostID = "host.id" + AttributeHostImageID = "host.image.id" + AttributeHostImageName = "host.image.name" + AttributeHostImageVersion = "host.image.version" + AttributeHostName = "host.name" + AttributeHostType = "host.type" AttributeK8sCluster = "k8s.cluster.name" - AttributeK8sNamespace = "k8s.namespace.name" AttributeK8sContainer = "k8s.container.name" - AttributeK8sPod = "k8s.pod.name" - AttributeK8sPodUID = "k8s.pod.uid" AttributeK8sCronJob = "k8s.cronjob.name" AttributeK8sCronJobUID = "k8s.cronjob.uid" - AttributeK8sJob = "k8s.job.name" - AttributeK8sJobUID = "k8s.job.uid" - AttributeK8sDeployment = "k8s.deployment.name" - AttributeK8sDeploymentUID = "k8s.deployment.uid" AttributeK8sDaemonSet = "k8s.daemonset.name" AttributeK8sDaemonSetUID = "k8s.daemonset.uid" + AttributeK8sDeployment = "k8s.deployment.name" + AttributeK8sDeploymentUID = "k8s.deployment.uid" + AttributeK8sJob = "k8s.job.name" + AttributeK8sJobUID = "k8s.job.uid" + AttributeK8sNamespace = "k8s.namespace.name" + AttributeK8sPod = "k8s.pod.name" + AttributeK8sPodUID = "k8s.pod.uid" AttributeK8sReplicaSet = "k8s.replicaset.name" AttributeK8sReplicaSetUID = "k8s.replicaset.uid" AttributeK8sStatefulSet = "k8s.statefulset.name" AttributeK8sStatefulSetUID = "k8s.statefulset.uid" - AttributeHostHostname = "host.hostname" - AttributeHostID = "host.id" - AttributeHostName = "host.name" - AttributeHostType = "host.type" - AttributeHostImageName = "host.image.name" - AttributeHostImageID = "host.image.id" - AttributeHostImageVersion = "host.image.version" - AttributeProcessID = "process.pid" - AttributeProcessExecutableName = "process.executable.name" - AttributeProcessExecutablePath = "process.executable.path" AttributeProcessCommand = "process.command" AttributeProcessCommandLine = "process.command_line" + AttributeProcessExecutableName = "process.executable.name" + AttributeProcessExecutablePath = "process.executable.path" + AttributeProcessID = "process.pid" AttributeProcessOwner = "process.owner" - AttributeCloudProvider = "cloud.provider" - AttributeCloudAccount = "cloud.account.id" - AttributeCloudRegion = "cloud.region" - AttributeCloudZone = "cloud.zone" + AttributeServiceInstance = "service.instance.id" + AttributeServiceName = "service.name" + AttributeServiceNamespace = "service.namespace" + AttributeServiceVersion = "service.version" + AttributeTelemetryAutoVersion = "telemetry.auto.version" + AttributeTelemetrySDKLanguage = "telemetry.sdk.language" + AttributeTelemetrySDKName = "telemetry.sdk.name" + AttributeTelemetrySDKVersion = "telemetry.sdk.version" ) // GetResourceSemanticConventionAttributeNames a slice with all the Resource Semantic Conventions attribute names. func GetResourceSemanticConventionAttributeNames() []string { return []string{ - AttributeServiceName, - AttributeServiceNamespace, - AttributeServiceInstance, - AttributeServiceVersion, - AttributeTelemetrySDKName, - AttributeTelemetrySDKLanguage, - AttributeTelemetrySDKVersion, - AttributeContainerName, + AttributeCloudAccount, + AttributeCloudProvider, + AttributeCloudRegion, + AttributeCloudZone, AttributeContainerImage, + AttributeContainerName, AttributeContainerTag, - AttributeFaasName, AttributeFaasID, - AttributeFaasVersion, AttributeFaasInstance, - AttributeK8sCluster, - AttributeK8sNamespace, - AttributeK8sPod, - AttributeK8sDeployment, + AttributeFaasName, + AttributeFaasVersion, AttributeHostHostname, AttributeHostID, - AttributeHostName, - AttributeHostType, - AttributeHostImageName, AttributeHostImageID, + AttributeHostImageName, AttributeHostImageVersion, - AttributeProcessID, - AttributeProcessExecutableName, - AttributeProcessExecutablePath, + AttributeHostName, + AttributeHostType, + AttributeK8sCluster, + AttributeK8sDeployment, + AttributeK8sNamespace, + AttributeK8sPod, AttributeProcessCommand, AttributeProcessCommandLine, + AttributeProcessExecutableName, + AttributeProcessExecutablePath, + AttributeProcessID, AttributeProcessOwner, - AttributeCloudProvider, - AttributeCloudAccount, - AttributeCloudRegion, - AttributeCloudZone, + AttributeServiceInstance, + AttributeServiceName, + AttributeServiceNamespace, + AttributeServiceVersion, + AttributeTelemetrySDKLanguage, + AttributeTelemetrySDKName, + AttributeTelemetrySDKVersion, } } @@ -114,16 +114,16 @@ func GetResourceSemanticConventionAttributeNames() []string { // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/span-general.md const ( AttributeComponent = "component" - AttributeNetTransport = "net.transport" - AttributeNetPeerIP = "net.peer.ip" - AttributeNetPeerPort = "net.peer.port" - AttributeNetPeerName = "net.peer.name" - AttributeNetHostIP = "net.host.ip" - AttributeNetHostPort = "net.host.port" - AttributeNetHostName = "net.host.name" AttributeEnduserID = "enduser.id" AttributeEnduserRole = "enduser.role" AttributeEnduserScope = "enduser.scope" + AttributeNetHostIP = "net.host.ip" + AttributeNetHostName = "net.host.name" + AttributeNetHostPort = "net.host.port" + AttributeNetPeerIP = "net.peer.ip" + AttributeNetPeerName = "net.peer.name" + AttributeNetPeerPort = "net.peer.port" + AttributeNetTransport = "net.transport" AttributePeerService = "peer.service" ) @@ -137,100 +137,100 @@ const ( // OpenTelemetry Semantic Convention attribute names for HTTP related attributes // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md const ( - AttributeHTTPMethod = "http.method" - AttributeHTTPURL = "http.url" - AttributeHTTPTarget = "http.target" - AttributeHTTPHost = "http.host" - AttributeHTTPScheme = "http.scheme" - AttributeHTTPStatusCode = "http.status_code" - AttributeHTTPStatusText = "http.status_text" + AttributeHTTPClientIP = "http.client_ip" AttributeHTTPFlavor = "http.flavor" - AttributeHTTPServerName = "http.server_name" + AttributeHTTPHost = "http.host" AttributeHTTPHostName = "host.name" AttributeHTTPHostPort = "host.port" - AttributeHTTPRoute = "http.route" - AttributeHTTPClientIP = "http.client_ip" - AttributeHTTPUserAgent = "http.user_agent" + AttributeHTTPMethod = "http.method" AttributeHTTPRequestContentLength = "http.request_content_length" AttributeHTTPRequestContentLengthUncompressed = "http.request_content_length_uncompressed" AttributeHTTPResponseContentLength = "http.response_content_length" AttributeHTTPResponseContentLengthUncompressed = "http.response_content_length_uncompressed" + AttributeHTTPRoute = "http.route" + AttributeHTTPScheme = "http.scheme" + AttributeHTTPServerName = "http.server_name" + AttributeHTTPStatusCode = "http.status_code" + AttributeHTTPStatusText = "http.status_text" + AttributeHTTPTarget = "http.target" + AttributeHTTPURL = "http.url" + AttributeHTTPUserAgent = "http.user_agent" ) // OpenTelemetry Semantic Convention attribute names for database related attributes // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/database.md const ( - AttributeDBSystem = "db.system" AttributeDBConnectionString = "db.connection_string" - AttributeDBUser = "db.user" - - AttributeDBName = "db.name" - AttributeDBStatement = "db.statement" - AttributeDBOperation = "db.operation" - AttributeDBMsSQLInstanceName = "db.mssql.instance_name" - AttributeDBJDBCDriverClassname = "db.jdbc.driver_classname" AttributeDBCassandraKeyspace = "db.cassandra.keyspace" AttributeDBHBaseNamespace = "db.hbase.namespace" - AttributeDBRedisDatabaseIndex = "db.redis.database_index" + AttributeDBJDBCDriverClassname = "db.jdbc.driver_classname" AttributeDBMongoDBCollection = "db.mongodb.collection" + AttributeDBMsSQLInstanceName = "db.mssql.instance_name" + + AttributeDBName = "db.name" + AttributeDBOperation = "db.operation" + AttributeDBRedisDatabaseIndex = "db.redis.database_index" + AttributeDBStatement = "db.statement" + AttributeDBSystem = "db.system" + AttributeDBUser = "db.user" ) // OpenTelemetry Semantic Convention attribute names for gRPC related attributes // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/rpc.md const ( - AttributeRPCSystem = "rpc.system" - AttributeRPCService = "rpc.service" + AttributeMessageCompressedSize = "message.compressed_size" + AttributeMessageID = "message.id" + AttributeMessageType = "message.type" + AttributeMessageUncompressedSize = "message.uncompressed_size" AttributeRPCMethod = "rpc.method" + AttributeRPCService = "rpc.service" + AttributeRPCSystem = "rpc.system" EventTypeMessage = "message" - AttributeMessageType = "message.type" MessageTypeReceived = "RECEIVED" MessageTypeSent = "SENT" - AttributeMessageID = "message.id" - AttributeMessageCompressedSize = "message.compressed_size" - AttributeMessageUncompressedSize = "message.uncompressed_size" ) // OpenTelemetry Semantic Convention attribute names for FaaS related attributes // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/faas.md const ( - AttributeFaaSTrigger = "faas.trigger" - AttributeFaaSExecution = "faas.execution" + AttributeFaaSCron = "faas.cron" AttributeFaaSDocumentCollection = "faas.document.collection" + AttributeFaaSDocumentName = "faas.document.name" AttributeFaaSDocumentOperation = "faas.document.operation" AttributeFaaSDocumentTime = "faas.document.time" - AttributeFaaSDocumentName = "faas.document.name" + AttributeFaaSExecution = "faas.execution" AttributeFaaSTime = "faas.time" - AttributeFaaSCron = "faas.cron" + AttributeFaaSTrigger = "faas.trigger" FaaSTriggerDataSource = "datasource" FaaSTriggerHTTP = "http" + FaaSTriggerOther = "other" FaaSTriggerPubSub = "pubsub" FaaSTriggerTimer = "timer" - FaaSTriggerOther = "other" ) // OpenTelemetry Semantic Convention attribute names for messaging system related attributes // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md const ( - AttributeMessagingSystem = "messaging.system" + AttributeMessagingConversationID = "messaging.conversation_id" AttributeMessagingDestination = "messaging.destination" AttributeMessagingDestinationKind = "messaging.destination_kind" - AttributeMessagingTempDestination = "messaging.temp_destination" + AttributeMessagingMessageID = "messaging.message_id" + AttributeMessagingOperation = "messaging.operation" + AttributeMessagingPayloadCompressedSize = "messaging.message_payload_compressed_size_bytes" + AttributeMessagingPayloadSize = "messaging.message_payload_size_bytes" AttributeMessagingProtocol = "messaging.protocol" AttributeMessagingProtocolVersion = "messaging.protocol_version" + AttributeMessagingSystem = "messaging.system" + AttributeMessagingTempDestination = "messaging.temp_destination" AttributeMessagingURL = "messaging.url" - AttributeMessagingMessageID = "messaging.message_id" - AttributeMessagingConversationID = "messaging.conversation_id" - AttributeMessagingPayloadSize = "messaging.message_payload_size_bytes" - AttributeMessagingPayloadCompressedSize = "messaging.message_payload_compressed_size_bytes" - AttributeMessagingOperation = "messaging.operation" ) // OpenTelemetry Semantic Convention attribute names for exceptions // See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/exceptions.md const ( AttributeExceptionEventName = "exception" - AttributeExceptionType = "exception.type" AttributeExceptionMessage = "exception.message" AttributeExceptionStacktrace = "exception.stacktrace" + AttributeExceptionType = "exception.type" ) From b7198a78cf465d159fd972fa0a6deaaacb867e2f Mon Sep 17 00:00:00 2001 From: Jay Camp Date: Wed, 2 Sep 2020 11:30:04 -0400 Subject: [PATCH 2/2] add deployment environment semantic convention https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/deployment_environment.md Also sorted everything first (done in separate commit, see last commit for net-new change) --- translator/conventions/opentelemetry.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/translator/conventions/opentelemetry.go b/translator/conventions/opentelemetry.go index debfd8ed012..5e9f3ad98ea 100644 --- a/translator/conventions/opentelemetry.go +++ b/translator/conventions/opentelemetry.go @@ -25,6 +25,7 @@ const ( AttributeContainerImage = "container.image.name" AttributeContainerName = "container.name" AttributeContainerTag = "container.image.tag" + AttributeDeploymentEnvironment = "deployment.environment" AttributeFaasID = "faas.id" AttributeFaasInstance = "faas.instance" AttributeFaasName = "faas.name" @@ -79,6 +80,7 @@ func GetResourceSemanticConventionAttributeNames() []string { AttributeContainerImage, AttributeContainerName, AttributeContainerTag, + AttributeDeploymentEnvironment, AttributeFaasID, AttributeFaasInstance, AttributeFaasName,