ext

package
v1.49.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package ext contains a set of Datadog-specific constants. Most of them are used for setting span metadata.

Index

Constants

View Source
const (
	// DEPRECATED: Use SpanTypeWeb
	// AppTypeWeb specifies the Web span type and can be used as a tag value
	// for a span's SpanType tag.
	AppTypeWeb = "web"

	// AppTypeDB specifies the DB span type and can be used as a tag value
	// for a span's SpanType tag. If possible, use one of the SpanType*
	// constants for a more accurate indication.
	AppTypeDB = "db"

	// AppTypeCache specifies the Cache span type and can be used as a tag value
	// for a span's SpanType tag. If possible, consider using SpanTypeRedis or
	// SpanTypeMemcached.
	AppTypeCache = "cache"

	// AppTypeRPC specifies the RPC span type and can be used as a tag value
	// for a span's SpanType tag.
	AppTypeRPC = "rpc"
)

App types determine how to categorize a trace in the Datadog application. For more fine-grained behaviour, use the SpanType* constants.

View Source
const (
	// SpanTypeWeb marks a span as an HTTP server request.
	SpanTypeWeb = "web"

	// SpanTypeHTTP marks a span as an HTTP client request.
	SpanTypeHTTP = "http"

	// SpanTypeSQL marks a span as an SQL operation. These spans may
	// have an "sql.command" tag.
	SpanTypeSQL = "sql"

	// SpanTypeCassandra marks a span as a Cassandra operation. These
	// spans may have an "sql.command" tag.
	SpanTypeCassandra = "cassandra"

	// SpanTypeRedis marks a span as a Redis operation. These spans may
	// also have a "redis.raw_command" tag.
	SpanTypeRedis = "redis"

	// SpanTypeMemcached marks a span as a memcached operation.
	SpanTypeMemcached = "memcached"

	// SpanTypeMongoDB marks a span as a MongoDB operation.
	SpanTypeMongoDB = "mongodb"

	// SpanTypeElasticSearch marks a span as an ElasticSearch operation.
	// These spans may also have an "elasticsearch.body" tag.
	SpanTypeElasticSearch = "elasticsearch"

	// SpanTypeLevelDB marks a span as a leveldb operation
	SpanTypeLevelDB = "leveldb"

	// SpanTypeDNS marks a span as a DNS operation.
	SpanTypeDNS = "dns"

	// SpanTypeMessageConsumer marks a span as a queue operation
	SpanTypeMessageConsumer = "queue"

	// SpanTypeMessageProducer marks a span as a queue operation.
	SpanTypeMessageProducer = "queue"

	// SpanTypeConsul marks a span as a Consul operation.
	SpanTypeConsul = "consul"

	// SpanTypeGraphql marks a span as a graphql operation.
	SpanTypeGraphQL = "graphql"
)

Span types have similar behaviour to "app types" and help categorize traces in the Datadog application. They can also help fine grain agent level behaviours such as obfuscation and quantization, when these are enabled in the agent's configuration.

View Source
const (
	// CassandraQuery is the tag name used for cassandra queries.
	CassandraQuery = "cassandra.query"

	// CassandraBatch is the tag name used for cassandra batches.
	CassandraBatch = "cassandra.batch"

	// CassandraConsistencyLevel is the tag name to set for consitency level.
	CassandraConsistencyLevel = "cassandra.consistency_level"

	// CassandraCluster specifies the tag name that is used to set the cluster.
	CassandraCluster = "cassandra.cluster"

	// CassandraRowCount specifies the tag name to use when settings the row count.
	CassandraRowCount = "cassandra.row_count"

	// CassandraKeyspace is used as tag name for setting the key space.
	CassandraKeyspace = "cassandra.keyspace"

	// CassandraPaginated specifies the tag name for paginated queries.
	CassandraPaginated = "cassandra.paginated"
)
View Source
const (
	// DBApplication indicates the application using the database.
	DBApplication = "db.application"
	// DBName indicates the database name.
	DBName = "db.name"
	// DBType indicates the type of Database.
	DBType = "db.type"
	// DBInstance indicates the instance name of Database.
	DBInstance = "db.instance"
	// DBUser indicates the user name of Database, e.g. "readonly_user" or "reporting_user".
	DBUser = "db.user"
	// DBStatement records a database statement for the given database type.
	DBStatement = "db.statement"
)
View Source
const (
	DBSystem                   = "db.system"
	DBSystemMemcached          = "memcached"
	DBSystemMySQL              = "mysql"
	DBSystemPostgreSQL         = "postgresql"
	DBSystemMicrosoftSQLServer = "mssql"
	// DBSystemOtherSQL is used for other SQL databases not listed above.
	DBSystemOtherSQL      = "other_sql"
	DBSystemElasticsearch = "elasticsearch"
	DBSystemRedis         = "redis"
	DBSystemMongoDB       = "mongodb"
	DBSystemCassandra     = "cassandra"
	DBSystemConsulKV      = "consul"
	DBSystemLevelDB       = "leveldb"
	DBSystemBuntDB        = "buntdb"
)

DBSystem indicates the database management system (DBMS) product being used. The following list includes the tag name and all the available values for it.

View Source
const (
	// PeerHostIPV4 records IPv4 host address of the peer.
	PeerHostIPV4 = "peer.ipv4"
	// PeerHostIPV6 records the IPv6 host address of the peer.
	PeerHostIPV6 = "peer.ipv6"
	// PeerService records the service name of the peer service.
	PeerService = "peer.service"
	// PeerHostname records the host name of the peer.
	PeerHostname = "peer.hostname"
	// PeerPort records the port number of the peer.
	PeerPort = "peer.port"
)
View Source
const (
	// PriorityUserReject informs the backend that a trace should be rejected and not stored.
	// This should be used by user code or configuration overriding default priority
	PriorityUserReject = -1

	// PriorityAutoReject informs the backend that a trace should be rejected and not stored.
	// This is used by the builtin sampler.
	PriorityAutoReject = 0

	// PriorityAutoKeep informs the backend that a trace should be kept and not stored.
	// This is used by the builtin sampler.
	PriorityAutoKeep = 1

	// PriorityUserKeep informs the backend that a trace should be kept and not stored.
	// This should be used by user code or configuration overriding default priority
	PriorityUserKeep = 2
)
View Source
const (
	// RPCSystem identifies the RPC remoting system.
	RPCSystem = "rpc.system"
	// RPCService represents the full (logical) name of the service being called, including its package name,
	// if applicable. Note this is the logical name of the service from the RPC interface perspective,
	// which can be different from the name of any implementing class.
	RPCService = "rpc.service"
	// RPCMethod represents the name of the (logical) method being called. Note this is the logical name of the
	// method from the RPC interface perspective, which can be different from the name of
	// any implementing method/function.
	RPCMethod = "rpc.method"
)
View Source
const (
	// RPCSystemGRPC identifies gRPC.
	RPCSystemGRPC = "grpc"
	// RPCSystemTwirp identifies Twirp.
	RPCSystemTwirp = "twirp"
)

Well-known identifiers for rpc.system.

View Source
const (

	// SpanKindServer indicates that the span covers server-side handling of a synchronous RPC or other remote request
	// This span should not have any local parents but can have other distributed parents
	SpanKindServer = "server"

	// SpanKindClient indicates that the span describes a request to some remote service.
	// This span should not have any local children but can have other distributed children
	SpanKindClient = "client"

	// SpanKindConsumer indicates that the span describes the initiators of an asynchronous request.
	// This span should not have any local parents but can have other distributed parents
	SpanKindConsumer = "consumer"

	// SpanKindProducer indicates that the span describes a child of an asynchronous producer request.
	// This span should not have any local children but can have other distributed children
	SpanKindProducer = "producer"

	// SpanKindInternal indicates that the span represents an internal operation within an application,
	// as opposed to an operations with remote parents or children.
	// This is the default value and not explicitly set to save memory
	SpanKindInternal = "internal"
)

span_kind values are set per span following the opentelemetry standard falls under the values of client, server, producer, consumer, and internal

View Source
const (
	// TargetHost sets the target host address.
	TargetHost = "out.host"

	// TargetPort sets the target host port.
	TargetPort = "out.port"

	// SamplingPriority is the tag that marks the sampling priority of a span.
	// Deprecated in favor of ManualKeep and ManualDrop.
	SamplingPriority = "sampling.priority"

	// SQLType sets the sql type tag.
	SQLType = "sql"

	// SQLQuery sets the sql query tag on a span.
	SQLQuery = "sql.query"

	// HTTPMethod specifies the HTTP method used in a span.
	HTTPMethod = "http.method"

	// HTTPCode sets the HTTP status code as a tag.
	HTTPCode = "http.status_code"

	// HTTPRoute is the route value of the HTTP request.
	HTTPRoute = "http.route"

	// HTTPURL sets the HTTP URL for a span.
	HTTPURL = "http.url"

	// HTTPUserAgent is the user agent header value of the HTTP request.
	HTTPUserAgent = "http.useragent"

	// HTTPClientIP sets the HTTP client IP tag.
	HTTPClientIP = "http.client_ip"

	// HTTPRequestHeaders sets the HTTP request headers partial tag
	// This tag is meant to be composed, i.e http.request.headers.headerX, http.request.headers.headerY, etc...
	// See https://docs.datadoghq.com/tracing/trace_collection/tracing_naming_convention/#http-requests
	HTTPRequestHeaders = "http.request.headers"

	// SpanName is a pseudo-key for setting a span's operation name by means of
	// a tag. It is mostly here to facilitate vendor-agnostic frameworks like Opentracing
	// and OpenCensus.
	SpanName = "span.name"

	// SpanType defines the Span type (web, db, cache).
	SpanType = "span.type"

	// ServiceName defines the Service name for this Span.
	ServiceName = "service.name"

	// Version is a tag that specifies the current application version.
	Version = "version"

	// ResourceName defines the Resource name for the Span.
	ResourceName = "resource.name"

	// Error specifies the error tag. It's value is usually of type "error".
	Error = "error"

	// ErrorMsg specifies the error message.
	ErrorMsg = "error.message"

	// ErrorType specifies the error type.
	ErrorType = "error.type"

	// ErrorStack specifies the stack dump.
	ErrorStack = "error.stack"

	// ErrorDetails holds details about an error which implements a formatter.
	ErrorDetails = "error.details"

	// Environment specifies the environment to use with a trace.
	Environment = "env"

	// EventSampleRate specifies the rate at which this span will be sampled
	// as an APM event.
	EventSampleRate = "_dd1.sr.eausr"

	// AnalyticsEvent specifies whether the span should be recorded as a Trace
	// Search & Analytics event.
	AnalyticsEvent = "analytics.event"

	// ManualKeep is a tag which specifies that the trace to which this span
	// belongs to should be kept when set to true.
	ManualKeep = "manual.keep"

	// ManualDrop is a tag which specifies that the trace to which this span
	// belongs to should be dropped when set to true.
	ManualDrop = "manual.drop"

	// RuntimeID is a tag that contains a unique id for this process.
	RuntimeID = "runtime-id"

	// Component defines library integration the span originated from.
	Component = "component"

	// SpanKind defines the kind of span based on Otel requirements (client, server, producer, consumer).
	SpanKind = "span.kind"

	// MessagingSystem identifies which messaging system created this span (kafka, rabbitmq, amazonsqs, googlepubsub...)
	MessagingSystem = "messaging.system"
)
View Source
const (
	// GRPCFullMethod represents the full name of the logical method being called following the
	// format: /$package.$service/$method
	GRPCFullMethod = "rpc.grpc.full_method"
)

gRPC specific tags.

View Source
const (
	// MessagingKafkaPartition defines the Kafka partition the trace is associated with.
	MessagingKafkaPartition = "messaging.kafka.partition"
)

Messaging tags.

View Source
const (
	// MicrosoftSQLServerInstanceName indicates the Microsoft SQL Server instance name connecting to.
	MicrosoftSQLServerInstanceName = "db.mssql.instance_name"
)

MicrosoftSQLServer tags.

View Source
const (
	// MongoDBCollection indicates the collection being accessed.
	MongoDBCollection = "db.mongodb.collection"
)

MongoDB tags.

View Source
const (
	// The pid of the traced process
	Pid = "process_id"
)

Standard system metadata names

View Source
const (
	// RedisDatabaseIndex indicates the Redis database index connected to.
	RedisDatabaseIndex = "db.redis.database_index"
)

Redis tags.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL