Documentation
¶
Overview ¶
TODO Move this to knative/pkg's tracing package.
Index ¶
- Constants
- Variables
- func ConfigToJSON(cfg *tracingconfig.Config) (string, error)
- func FromSpanContext(sc trace.SpanContext) extensions.DistributedTracingExtension
- func JSONToConfig(jsonConfig string) (*tracingconfig.Config, error)
- func SourceDestination(resourceGroup string, src types.NamespacedName) string
- func StartChildSpan(ctx context.Context, d extensions.DistributedTracingExtension, name string, ...) (context.Context, *trace.Span)
- func SubscriptionDestination(s string) string
- func ToSpanContext(d extensions.DistributedTracingExtension) (trace.SpanContext, error)
- func WithLogging(ctx context.Context, span *trace.Span) context.Context
Constants ¶
const ( LoggingTraceKey = "logging.googleapis.com/trace" LoggingSpanIDKey = "logging.googleapis.com/spanId" LoggingTraceSampledKey = "logging.googleapis.com/trace_sampled" )
const (
PubSubProtocol = "Pub/Sub"
)
Variables ¶
var (
PubSubProtocolAttribute = tracing.MessagingProtocolAttribute(PubSubProtocol)
)
Functions ¶
func ConfigToJSON ¶
func ConfigToJSON(cfg *tracingconfig.Config) (string, error)
ConfigToJSON marshals a tracingconfig.Config to a JSON string. It should round-trip with JSONToConfig. E.g. cfg == JSONToConfig(ConfigToJSON(cfg))
func FromSpanContext ¶ added in v0.22.0
func FromSpanContext(sc trace.SpanContext) extensions.DistributedTracingExtension
FromSpanContext populates DistributedTracingExtension from a SpanContext. This is copied from cloudevents/sdk-go v2.3.1, removed in 2.4.0 by https://github.com/cloudevents/sdk-go/pull/634.
func JSONToConfig ¶
func JSONToConfig(jsonConfig string) (*tracingconfig.Config, error)
JSONToConfig converts a JSON marshaled version of the tracingconfig.Config back to the structure. It should round-trip with ConfigToJSON. E.g. cfg == JSONToConfig(ConfigToJSON(cfg))
func SourceDestination ¶ added in v0.16.0
func SourceDestination(resourceGroup string, src types.NamespacedName) string
func StartChildSpan ¶ added in v0.22.0
func StartChildSpan(ctx context.Context, d extensions.DistributedTracingExtension, name string, opts ...trace.StartOption) (context.Context, *trace.Span)
StartChildSpan adds a child span to the trace parent in the given context. This is copied from cloudevents/sdk-go v2.3.1, removed in 2.4.0 by https://github.com/cloudevents/sdk-go/pull/634.
func SubscriptionDestination ¶ added in v0.16.0
func ToSpanContext ¶ added in v0.22.0
func ToSpanContext(d extensions.DistributedTracingExtension) (trace.SpanContext, error)
ToSpanContext creates a SpanContext from a DistributedTracingExtension instance. This is copied from cloudevents/sdk-go v2.3.1, removed in 2.4.0 by https://github.com/cloudevents/sdk-go/pull/634.
Types ¶
This section is empty.