mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-18 12:20:24 +00:00
40ad4163cb
Bumps the github-dependencies group with 2 updates: [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang). Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.30.7 to 1.31.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.31.1/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mgn/v1.30.7...service/s3/v1.31.1) Updates `github.com/prometheus/client_golang` from 1.20.3 to 1.20.4 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
96 lines
2.3 KiB
Go
96 lines
2.3 KiB
Go
// Package tracing defines tracing APIs to be used by Smithy clients.
|
|
package tracing
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/aws/smithy-go"
|
|
)
|
|
|
|
// SpanStatus records the "success" state of an observed span.
|
|
type SpanStatus int
|
|
|
|
// Enumeration of SpanStatus.
|
|
const (
|
|
SpanStatusUnset SpanStatus = iota
|
|
SpanStatusOK
|
|
SpanStatusError
|
|
)
|
|
|
|
// SpanKind indicates the nature of the work being performed.
|
|
type SpanKind int
|
|
|
|
// Enumeration of SpanKind.
|
|
const (
|
|
SpanKindInternal SpanKind = iota
|
|
SpanKindClient
|
|
SpanKindServer
|
|
SpanKindProducer
|
|
SpanKindConsumer
|
|
)
|
|
|
|
// TracerProvider is the entry point for creating client traces.
|
|
type TracerProvider interface {
|
|
Tracer(scope string, opts ...TracerOption) Tracer
|
|
}
|
|
|
|
// TracerOption applies configuration to a tracer.
|
|
type TracerOption func(o *TracerOptions)
|
|
|
|
// TracerOptions represent configuration for tracers.
|
|
type TracerOptions struct {
|
|
Properties smithy.Properties
|
|
}
|
|
|
|
// Tracer is the entry point for creating observed client Spans.
|
|
//
|
|
// Spans created by tracers propagate by existing on the Context. Consumers of
|
|
// the API can use [GetSpan] to pull the active Span from a Context.
|
|
//
|
|
// Creation of child Spans is implicit through Context persistence. If
|
|
// CreateSpan is called with a Context that holds a Span, the result will be a
|
|
// child of that Span.
|
|
type Tracer interface {
|
|
StartSpan(ctx context.Context, name string, opts ...SpanOption) (context.Context, Span)
|
|
}
|
|
|
|
// SpanOption applies configuration to a span.
|
|
type SpanOption func(o *SpanOptions)
|
|
|
|
// SpanOptions represent configuration for span events.
|
|
type SpanOptions struct {
|
|
Kind SpanKind
|
|
Properties smithy.Properties
|
|
}
|
|
|
|
// Span records a conceptually individual unit of work that takes place in a
|
|
// Smithy client operation.
|
|
type Span interface {
|
|
Name() string
|
|
Context() SpanContext
|
|
AddEvent(name string, opts ...EventOption)
|
|
SetStatus(status SpanStatus)
|
|
SetProperty(k, v any)
|
|
End()
|
|
}
|
|
|
|
// EventOption applies configuration to a span event.
|
|
type EventOption func(o *EventOptions)
|
|
|
|
// EventOptions represent configuration for span events.
|
|
type EventOptions struct {
|
|
Properties smithy.Properties
|
|
}
|
|
|
|
// SpanContext uniquely identifies a Span.
|
|
type SpanContext struct {
|
|
TraceID string
|
|
SpanID string
|
|
IsRemote bool
|
|
}
|
|
|
|
// IsValid is true when a span has nonzero trace and span IDs.
|
|
func (ctx *SpanContext) IsValid() bool {
|
|
return len(ctx.TraceID) != 0 && len(ctx.SpanID) != 0
|
|
}
|