tracing

package
v1.9.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// engine attributes
	PolicyGroupKey     = attribute.Key("kyverno.policy.group")
	PolicyVersionKey   = attribute.Key("kyverno.policy.version")
	PolicyKindKey      = attribute.Key("kyverno.policy.kind")
	PolicyNameKey      = attribute.Key("kyverno.policy.name")
	PolicyNamespaceKey = attribute.Key("kyverno.policy.namespace")
	RuleNameKey        = attribute.Key("kyverno.rule.name")
	// admission resource attributes
	// ResourceNameKey       = attribute.Key("admission.resource.name")
	// ResourceNamespaceKey  = attribute.Key("admission.resource.namespace")
	// ResourceGroupKey      = attribute.Key("admission.resource.group")
	// ResourceVersionKey    = attribute.Key("admission.resource.version")
	// ResourceKindKey       = attribute.Key("admission.resource.kind")
	// ResourceUidKey        = attribute.Key("admission.resource.uid")
	// admission request attributes
	RequestNameKey                    = attribute.Key("admission.request.name")
	RequestNamespaceKey               = attribute.Key("admission.request.namespace")
	RequestUidKey                     = attribute.Key("admission.request.uid")
	RequestOperationKey               = attribute.Key("admission.request.operation")
	RequestDryRunKey                  = attribute.Key("admission.request.dryrun")
	RequestKindGroupKey               = attribute.Key("admission.request.kind.group")
	RequestKindVersionKey             = attribute.Key("admission.request.kind.version")
	RequestKindKindKey                = attribute.Key("admission.request.kind.kind")
	RequestSubResourceKey             = attribute.Key("admission.request.subresource")
	RequestRequestKindGroupKey        = attribute.Key("admission.request.requestkind.group")
	RequestRequestKindVersionKey      = attribute.Key("admission.request.requestkind.version")
	RequestRequestKindKindKey         = attribute.Key("admission.request.requestkind.kind")
	RequestRequestSubResourceKey      = attribute.Key("admission.request.requestsubresource")
	RequestResourceGroupKey           = attribute.Key("admission.request.resource.group")
	RequestResourceVersionKey         = attribute.Key("admission.request.resource.version")
	RequestResourceResourceKey        = attribute.Key("admission.request.resource.resource")
	RequestRequestResourceGroupKey    = attribute.Key("admission.request.requestresource.group")
	RequestRequestResourceVersionKey  = attribute.Key("admission.request.requestresource.version")
	RequestRequestResourceResourceKey = attribute.Key("admission.request.requestresource.resource")
	RequestUserNameKey                = attribute.Key("admission.request.user.name")
	RequestUserUidKey                 = attribute.Key("admission.request.user.uid")
	RequestUserGroupsKey              = attribute.Key("admission.request.user.groups")
	// admission response attributes
	ResponseUidKey           = attribute.Key("admission.response.uid")
	ResponseAllowedKey       = attribute.Key("admission.response.allowed")
	ResponseWarningsKey      = attribute.Key("admission.response.warnings")
	ResponseResultStatusKey  = attribute.Key("admission.response.result.status")
	ResponseResultMessageKey = attribute.Key("admission.response.result.message")
	ResponseResultReasonKey  = attribute.Key("admission.response.result.reason")
	ResponseResultCodeKey    = attribute.Key("admission.response.result.code")
	ResponsePatchTypeKey     = attribute.Key("admission.response.patchtype")
	// kube client attributes
	KubeClientGroupKey     = attribute.Key("kube.client.group")
	KubeClientKindKey      = attribute.Key("kube.client.kind")
	KubeClientOperationKey = attribute.Key("kube.client.operation")
	KubeClientNamespaceKey = attribute.Key("kube.client.namespace")
)

Variables

This section is empty.

Functions

func ChildSpan added in v1.9.0

func ChildSpan(
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span),
	opts ...trace.SpanStartOption,
)

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func ChildSpan1 added in v1.9.0

func ChildSpan1[T1 any](
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span) T1,
	opts ...trace.SpanStartOption,
) T1

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func ChildSpan2 added in v1.9.0

func ChildSpan2[T1 any, T2 any](
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span) (T1, T2),
	opts ...trace.SpanStartOption,
) (T1, T2)

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func ChildSpan3 added in v1.9.0

func ChildSpan3[T1 any, T2 any, T3 any](
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span) (T1, T2, T3),
	opts ...trace.SpanStartOption,
) (T1, T2, T3)

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func CurrentSpan added in v1.9.0

func CurrentSpan(ctx context.Context) trace.Span

func IsInSpan added in v1.9.0

func IsInSpan(ctx context.Context) bool

func NewTraceConfig

func NewTraceConfig(log logr.Logger, tracerName, address, certs string, kubeClient kubernetes.Interface) (func(), error)

NewTraceConfig generates the initial tracing configuration with 'address' as the endpoint to connect to the Opentelemetry Collector

func RequestFilterIsInSpan added in v1.9.0

func RequestFilterIsInSpan(request *http.Request) bool

func SetHttpStatus added in v1.9.0

func SetHttpStatus(ctx context.Context, err error, code int)

func SetSpanStatus added in v1.9.0

func SetSpanStatus(span trace.Span, err error)

func SetStatus added in v1.9.0

func SetStatus(ctx context.Context, err error)

func Span added in v1.9.0

func Span(
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span),
	opts ...trace.SpanStartOption,
)

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func Span1 added in v1.9.0

func Span1[T1 any](
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span) T1,
	opts ...trace.SpanStartOption,
) T1

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func Span2 added in v1.9.0

func Span2[T1 any, T2 any](
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span) (T1, T2),
	opts ...trace.SpanStartOption,
) (T1, T2)

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func Span3 added in v1.9.0

func Span3[T1 any, T2 any, T3 any](
	ctx context.Context,
	tracerName string,
	operationName string,
	doFn func(context.Context, trace.Span) (T1, T2, T3),
	opts ...trace.SpanStartOption,
) (T1, T2, T3)

Span executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any.

func StartChildSpan added in v1.9.0

func StartChildSpan(
	ctx context.Context,
	tracerName string,
	operationName string,
	opts ...trace.SpanStartOption,
) (context.Context, trace.Span)

StartSpan creates a span from a context with `operationName` name

func StartSpan

func StartSpan(
	ctx context.Context,
	tracerName string,
	operationName string,
	opts ...trace.SpanStartOption,
) (context.Context, trace.Span)

StartSpan creates a span from a context with `operationName` name

func Transport added in v1.9.0

func Transport(base http.RoundTripper, opts ...otelhttp.Option) *otelhttp.Transport

Types

This section is empty.

Jump to

Keyboard shortcuts

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