Documentation
¶
Index ¶
- Constants
- Variables
- func K8sAttributes(name, namespace, resource string) []attribute.KeyValue
- func MessagingLabels(destination, operation string) []attribute.KeyValue
- func WithBrokerLabels(ctx context.Context, broker types.NamespacedName) context.Context
- func WithChannelLabels(ctx context.Context, channel types.NamespacedName) context.Context
- func WithConfig(ctx context.Context, cfg *Config) context.Context
- func WithEventLabels(ctx context.Context, event *cloudevents.Event) context.Context
- func WithLabeler(ctx context.Context) context.Context
- func WithLowCardinalityMessagingLabels(ctx context.Context, destinationTemplate, operation string) context.Context
- func WithMessagingLabels(ctx context.Context, destination, operation string) context.Context
- func WithMinimalEventLabels(ctx context.Context, event *cloudevents.Event) context.Context
- func WithRequestLabels(ctx context.Context, r *http.Request) context.Context
- func WithSinkLabels(ctx context.Context, sink types.NamespacedName, kind string) context.Context
- func WithSpanData(ctx context.Context, name string, kind int, attributes []attribute.KeyValue) context.Context
- type BaseConfig
- type Config
- type MetricsConfig
- type RuntimeConfig
- type SpanData
- type TracingConfig
Constants ¶
View Source
const ( // EnableSinkEventErrorReportingKey is the CM key to enable emitting a k8s event when delivery to a sink fails EnableSinkEventErrorReportingKey = "sink-event-error-reporting.enable" // DefaultEnableSinkEventErrorReporting is used to set the default sink event error reporting value DefaultEnableSinkEventErrorReporting = false // DefaultMetricsPort is the default port used for prometheus metrics if the prometheus protocol is used DefaultMetricsPort = 9092 )
View Source
const (
KnativeMessagingSystem = "knative"
)
Variables ¶
View Source
var ( // required attributes for otel messaging span semantics: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/#conventions MessagingSystem = attributekey.String("messaging.system") MessagingOperationName = attributekey.String("messaging.operation.name") MessagingDestinationName = attributekey.String("messaging.destination.name") MessagingDestinationTemplate = attributekey.String("messaging.destination.tempate") // attributes relating to the source SourceName = attributekey.String("kn.source.name") SourceNamespace = attributekey.String("kn.source.namespace") SourceResourceGroup = attributekey.String("kn.source.resourcegroup") // attributes relating to the broker BrokerName = attributekey.String("kn.broker.name") BrokerNamespace = attributekey.String("kn.broker.namespace") // attributes relating to the channel ChannelName = attributekey.String("kn.channel.name") ChannelNamespace = attributekey.String("kn.channel.namespace") // attributes relating to the broker SinkName = attributekey.String("kn.sink.name") SinkNamespace = attributekey.String("kn.sink.namespace") SinkKind = attributekey.String("kn.sink.kind") // attributes relating to the cloudevent (not including the ID for cardinality reasons) CloudEventType = attributekey.String(ceo11y.TypeAttr) CloudEventSource = attributekey.String(ceo11y.SourceAttr) CloudEventSubject = attributekey.String(ceo11y.SubjectAttr) CloudEventDataContenttype = attributekey.String(ceo11y.DatacontenttypeAttr) CloudEventSpecVersion = attributekey.String(ceo11y.SpecversionAttr) // attributes relating to the request RequestScheme = attributekey.String("url.scheme") )
Functions ¶
func K8sAttributes ¶
K8sAttributes generates Kubernetes trace attributes for the object of the given name in the given namespace. resource identifies the object type as <singular>.<group>
func MessagingLabels ¶ added in v0.46.0
func WithBrokerLabels ¶ added in v0.46.0
func WithChannelLabels ¶ added in v0.46.0
func WithConfig ¶ added in v0.46.0
func WithEventLabels ¶ added in v0.46.0
func WithLowCardinalityMessagingLabels ¶ added in v0.46.0
func WithMessagingLabels ¶ added in v0.46.0
func WithMinimalEventLabels ¶ added in v0.46.0
WithMinimalEventLabels adds a minimal set of event labels, suitable for metrics (to keep cardinality lower)
func WithRequestLabels ¶ added in v0.46.0
func WithSinkLabels ¶ added in v0.46.0
Types ¶
type BaseConfig ¶ added in v0.46.0
type Config ¶ added in v0.46.0
type Config struct {
BaseConfig
// EnableSinkEventErrorReporting specifies whether we should emit a k8s
// event when delivery to a sink fails
EnableSinkEventErrorReporting bool `json:"enableSinkEventErrorReporting"`
}
+k8s:deepcopy-gen=true
func DefaultConfig ¶ added in v0.46.0
func DefaultConfig() *Config
func MergeWithDefaults ¶ added in v0.46.0
merge the config with the default config, setting defaults wherever config is not set
type MetricsConfig ¶ added in v0.46.0
type MetricsConfig = pkgo11y.MetricsConfig
type RuntimeConfig ¶ added in v0.46.0
type RuntimeConfig = pkgo11y.RuntimeConfig
type SpanData ¶
type SpanData struct {
// Name is the span name
Name string
// Kind is the span kind
Kind int
// Attributes is the additional set of span attributes
Attributes []attribute.KeyValue
}
SpanData contains values for creating tracing spans.
func SpanDataFromContext ¶
SpanDataFromContext gets the span values from the context
type TracingConfig ¶ added in v0.46.0
type TracingConfig = pkgo11y.TracingConfig
Click to show internal directories.
Click to hide internal directories.