Documentation ¶
Overview ¶
Copyright 2023 The Radius Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func ExtractTraceparent(ctx context.Context) string
- func SetAsyncResultStatus(result ctrl.Result, span trace.Span)
- func StartConsumerSpan(ctx context.Context, spanName string, tracerName string) (context.Context, trace.Span)
- func StartCustomSpan(ctx context.Context, spanName string, tracerName string, ...) (context.Context, trace.Span)
- func StartProducerSpan(ctx context.Context, spanName string, tracerName string) (context.Context, trace.Span)
- func WithTraceparent(ctx context.Context, traceparent string) context.Context
Constants ¶
const ( // FrontendTracerName represents the name of frontend tracer name. FrontendTracerName string = "radius-frontend-tracer" // BackendTracerName represents the name of backend tracer name. BackendTracerName string = "radius-backend-tracer" )
Variables ¶
This section is empty.
Functions ¶
func ExtractTraceparent ¶
ExtractTraceparent extracts the traceparent header from the context. Retrieve the current span context from context and serialize it to its w3c string representation using propagator. ref: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md
func SetAsyncResultStatus ¶
SetAsyncResultStatus sets the status of the span based on the result and adds an exception event if the result contains an error.
func StartConsumerSpan ¶
func StartConsumerSpan(ctx context.Context, spanName string, tracerName string) (context.Context, trace.Span)
StartConsumerSpan creates a new span with SpanKindConsumer for dequeing async operations. It creates the span with the given spanName and tracerName, and adds the given attributes.
func StartCustomSpan ¶
func StartCustomSpan(ctx context.Context, spanName string, tracerName string, attrs []attribute.KeyValue, opts ...trace.SpanStartOption) (context.Context, trace.Span)
StartCustomSpan creates a new span with the given name, tracer name and attributes and returns a context and the span.
func StartProducerSpan ¶
func StartProducerSpan(ctx context.Context, spanName string, tracerName string) (context.Context, trace.Span)
StartProducerSpan creates a new span with SpanKindProducer for enqueuing async operations. It creates the span with the given spanName and tracerName, and adds the given attributes.
Types ¶
This section is empty.