Documentation
¶
Overview ¶
Package semconv provides OpenTelemetry attribute keys and constructors for keel specific semantic conventions.
Each attribute is exposed as a go.opentelemetry.io/otel/attribute.Key constant (for example KeelServiceNameKey) and a constructor returning a go.opentelemetry.io/otel/attribute.KeyValue (for example KeelServiceName). Attributes cover keel services, jobs, closers, circuit breakers, RBAC, streams, debug state and generic values (name, value, duration, trace and span ids) that replace the legacy log fields. Use them with log.Attribute and log.Attributes to share keys between logs, metrics and traces. Prefer upstream go.opentelemetry.io/otel/semconv keys where they exist.
Index ¶
- Constants
- func ContextError(err error) attribute.KeyValue
- func DebugEnabled(v bool) attribute.KeyValuedeprecated
- func Duration(v time.Duration) attribute.KeyValue
- func KeelCircuitBreakerPreviousState(v string) attribute.KeyValue
- func KeelCircuitBreakerStateChange(v bool) attribute.KeyValue
- func KeelCloserType(closer any) attribute.KeyValue
- func KeelGracefulPeriod(v time.Duration) attribute.KeyValue
- func KeelHealthzProbeType(probe any) attribute.KeyValue
- func KeelJobStep(v string) attribute.KeyValue
- func KeelRBACAuthenticated(v bool) attribute.KeyValue
- func KeelRBACOutcome(v string) attribute.KeyValue
- func KeelRBACRoles(v []string) attribute.KeyValue
- func KeelRBACRulePath(v string) attribute.KeyValue
- func KeelServiceInst(v int) attribute.KeyValue
- func KeelServiceName(v string) attribute.KeyValue
- func KeelServiceType(v KeelServiceTypeAttr) attribute.KeyValue
- func MaxDuration(v time.Duration) attribute.KeyValue
- func Name(v string) attribute.KeyValue
- func Num(v int) attribute.KeyValue
- func SpanID(v string) attribute.KeyValue
- func TraceID(v string) attribute.KeyValue
- func Value(v any) attribute.KeyValue
- type KeelServiceTypeAttr
Constants ¶
const ( // CircuitBreakerPreviousStateKey is the key for circuit_breaker.previous_state. CircuitBreakerPreviousStateKey = attribute.Key("circuit_breaker.previous_state") // CircuitBreakerStateChangeKey is the key for circuit_breaker.state_change. CircuitBreakerStateChangeKey = attribute.Key("circuit_breaker.state_change") )
const ( // NameKey is the key for name. NameKey = attribute.Key("name") // ValueKey is the key for value. ValueKey = attribute.Key("value") // NumKey is the key for num. NumKey = attribute.Key("num") // DurationKey is the key for duration, in seconds. DurationKey = attribute.Key("duration") // MaxDurationKey is the key for max_duration, in seconds. MaxDurationKey = attribute.Key("max_duration") // TraceIDKey is the key for trace.id. TraceIDKey = attribute.Key("trace.id") // SpanIDKey is the key for span.id. SpanIDKey = attribute.Key("span.id") // ContextErrorKey is the key for context.error. ContextErrorKey = attribute.Key("context.error") )
const ( // KeelServiceTypeKey is the key for keel.service.type. KeelServiceTypeKey = attribute.Key("keel.service.type") // KeelServiceNameKey is the key for keel.service.name. KeelServiceNameKey = attribute.Key("keel.service.name") // KeelServiceInstKey is the key for keel.service.inst. KeelServiceInstKey = attribute.Key("keel.service.inst") // KeelGracefulPeriodKey is the key for keel.graceful_period, in seconds. KeelGracefulPeriodKey = attribute.Key("keel.graceful_period") // KeelJobStepKey is the key for keel.job.step. KeelJobStepKey = attribute.Key("keel.job.step") // KeelCloserTypeKey is the key for keel.closer.type. KeelCloserTypeKey = attribute.Key("keel.closer.type") // KeelHealthzProbeTypeKey is the key for keel.healthz.probe.type. KeelHealthzProbeTypeKey = attribute.Key("keel.healthz.probe.type") )
const ( // KeelRBACOutcomeKey is the key for keel.rbac.outcome. KeelRBACOutcomeKey = attribute.Key("keel.rbac.outcome") // KeelRBACAuthenticatedKey is the key for keel.rbac.authenticated. KeelRBACAuthenticatedKey = attribute.Key("keel.rbac.authenticated") // KeelRBACRolesKey is the key for keel.rbac.roles. KeelRBACRolesKey = attribute.Key("keel.rbac.roles") // KeelRBACRulePathKey is the key for keel.rbac.rule.path. KeelRBACRulePathKey = attribute.Key("keel.rbac.rule.path") )
const ( // DebugEnabledKey is the key for debug.enabled. // // Deprecated: use foomosemconv.SpanSamplingPriorityKey. DebugEnabledKey = attribute.Key("debug.enabled") )
Variables ¶
This section is empty.
Functions ¶
func ContextError ¶ added in v0.33.0
ContextError returns a new attribute.KeyValue for context.error with the message of the given context error.
func DebugEnabled
deprecated
added in
v0.30.0
func KeelCircuitBreakerPreviousState ¶ added in v0.33.0
KeelCircuitBreakerPreviousState returns a new attribute.KeyValue for circuit_breaker.previous_state.
func KeelCircuitBreakerStateChange ¶ added in v0.33.0
KeelCircuitBreakerStateChange returns a new attribute.KeyValue for circuit_breaker.state_change.
func KeelCloserType ¶ added in v0.33.0
KeelCloserType returns a new attribute.KeyValue for keel.closer.type with the Go type name of closer.
func KeelGracefulPeriod ¶ added in v0.33.0
KeelGracefulPeriod returns a new attribute.KeyValue for keel.graceful_period in seconds.
func KeelHealthzProbeType ¶ added in v0.33.0
KeelHealthzProbeType returns a new attribute.KeyValue for keel.healthz.probe.type with the Go type name of probe.
func KeelJobStep ¶ added in v0.33.0
KeelJobStep returns a new attribute.KeyValue for keel.job.step.
func KeelRBACAuthenticated ¶ added in v0.33.0
KeelRBACAuthenticated returns a new attribute.KeyValue for keel.rbac.authenticated.
func KeelRBACOutcome ¶ added in v0.33.0
KeelRBACOutcome returns a new attribute.KeyValue for keel.rbac.outcome.
func KeelRBACRoles ¶ added in v0.33.0
KeelRBACRoles returns a new attribute.KeyValue for keel.rbac.roles.
func KeelRBACRulePath ¶ added in v0.33.0
KeelRBACRulePath returns a new attribute.KeyValue for keel.rbac.rule.path.
func KeelServiceInst ¶
KeelServiceInst returns a new attribute.KeyValue for keel.service.inst.
func KeelServiceName ¶
KeelServiceName returns a new attribute.KeyValue for keel.service.name.
func KeelServiceType ¶
func KeelServiceType(v KeelServiceTypeAttr) attribute.KeyValue
KeelServiceType returns a new attribute.KeyValue for keel.service.type.
func MaxDuration ¶ added in v0.33.0
MaxDuration returns a new attribute.KeyValue for max_duration in seconds.
Types ¶
type KeelServiceTypeAttr ¶ added in v0.33.0
type KeelServiceTypeAttr string
KeelServiceTypeAttr is an enum value of keel.service.type.
const ( // KeelServiceTypeHTTP is the keel.service.type of an HTTP service. KeelServiceTypeHTTP KeelServiceTypeAttr = "http" // KeelServiceTypeGoRoutine is the keel.service.type of a goroutine service. KeelServiceTypeGoRoutine KeelServiceTypeAttr = "goroutine" // KeelServiceTypeSubscription is the keel.service.type of a subscription service. KeelServiceTypeSubscription KeelServiceTypeAttr = "sub" // KeelServiceTypeJob is the keel.service.type of a job. KeelServiceTypeJob KeelServiceTypeAttr = "job" )