Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

semconv

Standard and custom semantic conventions for creating consistent, comparable attribute.Keys across services.

usage

Import semconv and use it exclusively for defining attribute keys in telemetry.

import (
	"github.com/getlantern/semconv"
	"go.opentelemetry.io/otel/attribute"
)

Example attribute map:

attrs := map[attribute.Key]attribute.Value{
	semconv.GeoCountryISOCodeKey: attribute.StringValue("US"),
	semconv.HostNameKey:          attribute.StringValue("phost-abcd"),
	semconv.TrackNameKey:         attribute.StringValue("nidoran"),
	semconv.ProxyProtocolKey:     attribute.StringValue("HTTPS"),
}

Example attribute slice:

attrs := []attribute.KeyValue{
	{
		Key:   semconv.GeoCountryISOCodeKey,
		Value: attribute.StringValue("US"),
	},
	{
		Key:   semconv.HostNameKey,
		Value: attribute.StringValue("phost-abcd"),
	},
	{
		Key:   semconv.TrackNameKey,
		Value: attribute.StringValue("nidoran"),
	},
	{
		Key:   semconv.ProxyProtocolKey,
		Value: attribute.StringValue("HTTPS"),
	},
}

reference

standard

custom

About

semantic conventions for telemetry

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages