xray

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsTraceId = "aws_trace_id"
	SpanId     = "span_id"
	TraceId    = "trace_id"
	Sampled    = "sampled"
)

Variables

This section is empty.

Functions

func Format added in v0.2.0

func Format(traceId string) string

Format converts a trace ID to the format used by AWS X-Ray.

func New added in v0.2.0

func New() func(ctx context.Context, req *http.Request) tracing.Tracing

New creates a new tracing context for HTTP requests. tracing.NewFunc is used to create a new tracing context based on the incoming HTTP request.

func RequestId added in v0.2.0

func RequestId() tracelog.RequestIdFunc

func TextMapPropagator

func TextMapPropagator() propagation.TextMapPropagator

func TracerProviderOptions

func TracerProviderOptions(ctx context.Context, attrs ...attribute.KeyValue) ([]sdktrace.TracerProviderOption, error)

TracerProviderOptions returns a slice of TracerProviderOption for configuring the OpenTelemetry TracerProvider. Deprecated: use tracers.TracerProviderOptions instead.

func WithIDGenerator added in v0.1.0

func WithIDGenerator() tracing.TracerProviderOption

WithIDGenerator X-Ray ID ジェネレーターを使用する

func WithLogGroupARNs

func WithLogGroupARNs(logGroupARNs ...string) tracing.KeyValueOption

WithLogGroupARNs ロググループARNを設定する

func WithLogGroupNames

func WithLogGroupNames(logGroupNames ...string) tracing.KeyValueOption

WithLogGroupNames ロググループ名を設定する

func WithLogStreamARNsKey

func WithLogStreamARNsKey(logStreamARNs ...string) tracing.KeyValueOption

WithLogStreamARNsKey ログストリームARNを設定する

func WithLogStreamNames

func WithLogStreamNames(logStreamNames ...string) tracing.KeyValueOption

WithLogStreamNames ログストリーム名を設定する

func WithResource added in v0.1.0

func WithResource(attr ...attribute.KeyValue) tracing.TracerProviderOption

WithResource リソース属性を設定する AWS Lambda 環境の場合は、Lambda用のリソース検出器を使用する attr 追加の属性

func WithSampler added in v0.2.1

func WithSampler(serviceName, cloudPlatform string, opt ...sampler.Option) tracing.TracerProviderOption

WithSampler X-Ray リモートサンプリングを使用する serviceName サービス名 cloudPlatform "ec2" / "ecs" / "eks" / "lambda", etc opt sampler.Option

sampler.WithEndpoint(endpoint url.URL)
sampler.WithSamplingRulesPollingInterval(polingInterval time.Duration)
sampler.WithLogger(l logr.Logger)

Types

type TracingContext added in v0.2.0

type TracingContext struct {
	Path      string
	ClientIP  string
	RequestID string
	Service   string
}

func Context added in v0.2.0

func Context(ctx context.Context) *TracingContext

func (*TracingContext) Dump added in v0.2.0

func (tc *TracingContext) Dump(ctx context.Context, log *zerolog.Event) *zerolog.Event

func (*TracingContext) WithTrace added in v0.2.0

func (tc *TracingContext) WithTrace(ctx context.Context, event *zerolog.Event) *zerolog.Event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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