OpenTelemetry Semantic Conventions and Datadog Conventions

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください

OpenTelemetry makes use of a number of semantic conventions that specify names for different types of data. This page lists mappings for OpenTelemetry semantic conventions to Datadog’s semantic conventions.

OpenTelemetry conventionDatadog conventionType
deployment.environment 1envUnified service tagging
deployment.environment.name 2envUnified service tagging
service.nameserviceUnified service tagging
service.versionversionUnified service tagging
container.idcontainer_idContainers
container.namecontainer_nameContainers
container.image.nameimage_nameContainers
container.image.tagimage_tagContainers
cloud.providercloud_providerCloud
cloud.regionregionCloud
cloud.availability_zonezoneCloud
aws.ecs.task.familytask_familyECS
aws.ecs.task.arntask_arnECS
aws.ecs.cluster.arnecs_cluster_nameECS
aws.ecs.task.revisiontask_versionECS
aws.ecs.container.arnecs_container_nameECS
k8s.container.namekube_container_nameKubernetes
k8s.cluster.namekube_cluster_nameKubernetes
k8s.deployment.namekube_deploymentKubernetes
k8s.replicaset.namekube_replica_setKubernetes
k8s.statefulset.namekube_stateful_setKubernetes
k8s.daemonset.namekube_daemon_setKubernetes
k8s.job.namekube_jobKubernetes
k8s.cronjob.namekube_cronjobKubernetes
k8s.namespace.namekube_namespaceKubernetes
k8s.pod.namepod_nameKubernetes
app.kubernetes.io/namekube_app_nameKubernetes labels
app.kubernetes.io/instancekube_app_instanceKubernetes labels
app.kubernetes.io/versionkube_app_versionKubernetes labels
app.kuberenetes.io/componentkube_app_componentKubernetes labels
app.kubernetes.io/part-ofkube_app_part_ofKubernetes labels
app.kubernetes.io/managed-bykube_app_managed_byKubernetes labels
client.addresshttp.client_ipHTTP
http.response.body.sizehttp.response.content_lengthHTTP
http.response.header.<header-name>http.response.headers.<header-name>HTTP
http.response.status_codehttp.status_codeHTTP
http.request.body.sizehttp.request.content_lengthHTTP
http.request.header.referrerhttp.referrerHTTP
http.request.header.<header-name>http.request.headers.<header-name>HTTP
http.request.methodhttp.methodHTTP
http.routehttp.routeHTTP
network.protocol.versionhttp.versionHTTP
server.addresshttp.server_nameHTTP
url.fullhttp.urlHTTP
user_agent.originalhttp.useragentHTTP

Span type mapping

Datadog has a vendor-specific convention of “span type” represented by the span.type attribute.

Based on the attributes included in your span, the Datadog Agent and Datadog OpenTelemetry components attempt to infer the appropriate span type for better compatibility with other Datadog services. You may also explicitly set the span.type attribute on any given span to override this logic using an attributes or a transform processor, as well as by setting appropriate configuration values in OpenTelemetry SDKs.

Map OpenTelemetry span attribute to Datadog span type

The following table shows the span type mapping logic that is used if the feature flag enable_receive_resource_spans_v2 is set in the Datadog Agent or both the Datadog Exporter and Connector, if using the OpenTelemetry Collector. The chart lists mappings in order of precedence.

#Span AttributeDatadog span.type
1span.typespan.type attribute value
2Span kind serverweb
3Span kind clientsee 3a/b
3aClient span kind, db.system attribute not foundhttp
3bClient span kind, db.system attribute foundSee the table below Mapping OpenTelemetry database system type to Datadog span type
4None of above conditions were fulfilledcustom

Mapping OpenTelemetry database system type to Datadog span type

In the table above, if a span is a “client” kind and contains db.system attribute, the following mapping applies for the span type in Datadog. Setting a span.type attribute on your span overrides this logic.

db.systemDatadog span.type
SQL Type DBMS (listed below)sql
adabassql
cachesql
clickhousesql
cloudscapesql
cockroachdbsql
coldfusionsql
db2sql
derbysql
edbsql
firebirdsql
firstsqlsql
filemakersql
hanadbsql
h2sql
hsqldbsql
informixsql
ingressql
instantdbsql
interbasesql
mariadbsql
maxdbsql
mssqlsql
mysqlsql
netezzasql
oraclesql
other_sqlsql
pervasivesql
pointbasesql
postgresqlsql
progresssql
redshiftsql
sqlitesql
sybasesql
teradatasql
verticasql
Other DB typessee below
cassandracassandra
couchbasedb
couchdbdb
cosmosdbdb
dynamodbdb
elasticsearchelasticsearch
geodedb
hivedb
memcachedmemcached
mongodbmongodb
opensearchopensearch
redisredis
any db.system value not listed abovedb

Metrics attribute mapping

For metrics, by default, Datadog only maps the OpenTelemetry resource attributes listed in the previous sections to Datadog metric tags. To map all resource attributes to tags, enable the metrics::resource_attributes_as_tags setting:

exporters:
    datadog:
        # Other configuration goes here...
        metrics:
            # Add all resource attributes as tags for metrics
            resource_attributes_as_tags: true
otlp_config:
    # Other configuration goes here...
    metrics:
        # Add all resource attributes as tags for metrics
        resource_attributes_as_tags: true

Enabling this option adds both the OpenTelemetry resource attributes and the Datadog semantic conventions to the metric tags.

Further reading

PREVIEWING: guacbot/translation-pipeline