trace

package
v0.42.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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

View Source
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

func ExtractTraceparent(ctx context.Context) string

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

func SetAsyncResultStatus(result ctrl.Result, span trace.Span)

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.

func WithTraceparent

func WithTraceparent(ctx context.Context, traceparent string) context.Context

WithTraceparent creates a new context with the given traceparent string.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL