tracing

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "jaeger"

Variables

View Source
var File_tracing_conf_proto protoreflect.FileDescriptor

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Client returns a new client middleware for OpenTelemetry.

func Server

func Server(opts ...Option) middleware.Middleware

Server returns a new server middleware for OpenTelemetry.

func SpanID

func SpanID() log.Valuer

SpanID returns a spanid valuer.

func TraceID

func TraceID() log.Valuer

TraceID returns a traceid valuer.

Types

type ClientHandler

type ClientHandler struct{}

ClientHandler is tracing ClientHandler

func (*ClientHandler) HandleConn

func (c *ClientHandler) HandleConn(ctx context.Context, cs stats.ConnStats)

HandleConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) HandleRPC

func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)

HandleRPC implements per-RPC tracing and stats instrumentation.

func (*ClientHandler) TagConn

TagConn exists to satisfy gRPC stats.Handler.

func (*ClientHandler) TagRPC

TagRPC implements per-RPC context management.

type Conf

type Conf struct {
	Jaeger *Jaeger `protobuf:"bytes,1,opt,name=jaeger,proto3" json:"jaeger,omitempty"`
	Stdout *Stdout `protobuf:"bytes,2,opt,name=stdout,proto3" json:"stdout,omitempty"`
	// contains filtered or unexported fields
}

func (*Conf) Descriptor deprecated

func (*Conf) Descriptor() ([]byte, []int)

Deprecated: Use Conf.ProtoReflect.Descriptor instead.

func (*Conf) GetJaeger added in v0.0.3

func (x *Conf) GetJaeger() *Jaeger

func (*Conf) GetStdout added in v0.0.3

func (x *Conf) GetStdout() *Stdout

func (*Conf) ProtoMessage

func (*Conf) ProtoMessage()

func (*Conf) ProtoReflect

func (x *Conf) ProtoReflect() protoreflect.Message

func (*Conf) Reset

func (x *Conf) Reset()

func (*Conf) String

func (x *Conf) String() string

func (*Conf) Validate

func (m *Conf) Validate() error

Validate checks the field values on Conf with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ConfValidationError

type ConfValidationError struct {
	// contains filtered or unexported fields
}

ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.

func (ConfValidationError) Cause

func (e ConfValidationError) Cause() error

Cause function returns cause value.

func (ConfValidationError) Error

func (e ConfValidationError) Error() string

Error satisfies the builtin error interface

func (ConfValidationError) ErrorName

func (e ConfValidationError) ErrorName() string

ErrorName returns error name.

func (ConfValidationError) Field

func (e ConfValidationError) Field() string

Field function returns field value.

func (ConfValidationError) Key

func (e ConfValidationError) Key() bool

Key function returns key value.

func (ConfValidationError) Reason

func (e ConfValidationError) Reason() string

Reason function returns reason value.

type Jaeger added in v0.0.3

type Jaeger struct {
	Enable   bool   `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	Metrics  bool   `protobuf:"varint,3,opt,name=metrics,proto3" json:"metrics,omitempty"`
	Traces   bool   `protobuf:"varint,4,opt,name=traces,proto3" json:"traces,omitempty"`
	// contains filtered or unexported fields
}

func (*Jaeger) Descriptor deprecated added in v0.0.3

func (*Jaeger) Descriptor() ([]byte, []int)

Deprecated: Use Jaeger.ProtoReflect.Descriptor instead.

func (*Jaeger) GetEnable added in v0.0.3

func (x *Jaeger) GetEnable() bool

func (*Jaeger) GetEndpoint added in v0.0.3

func (x *Jaeger) GetEndpoint() string

func (*Jaeger) GetMetrics added in v0.0.3

func (x *Jaeger) GetMetrics() bool

func (*Jaeger) GetTraces added in v0.0.3

func (x *Jaeger) GetTraces() bool

func (*Jaeger) ProtoMessage added in v0.0.3

func (*Jaeger) ProtoMessage()

func (*Jaeger) ProtoReflect added in v0.0.3

func (x *Jaeger) ProtoReflect() protoreflect.Message

func (*Jaeger) Reset added in v0.0.3

func (x *Jaeger) Reset()

func (*Jaeger) String added in v0.0.3

func (x *Jaeger) String() string

func (*Jaeger) Validate added in v0.0.3

func (m *Jaeger) Validate() error

Validate checks the field values on Jaeger with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type JaegerValidationError added in v0.0.3

type JaegerValidationError struct {
	// contains filtered or unexported fields
}

JaegerValidationError is the validation error returned by Jaeger.Validate if the designated constraints aren't met.

func (JaegerValidationError) Cause added in v0.0.3

func (e JaegerValidationError) Cause() error

Cause function returns cause value.

func (JaegerValidationError) Error added in v0.0.3

func (e JaegerValidationError) Error() string

Error satisfies the builtin error interface

func (JaegerValidationError) ErrorName added in v0.0.3

func (e JaegerValidationError) ErrorName() string

ErrorName returns error name.

func (JaegerValidationError) Field added in v0.0.3

func (e JaegerValidationError) Field() string

Field function returns field value.

func (JaegerValidationError) Key added in v0.0.3

func (e JaegerValidationError) Key() bool

Key function returns key value.

func (JaegerValidationError) Reason added in v0.0.3

func (e JaegerValidationError) Reason() string

Reason function returns reason value.

type Metadata

type Metadata struct{}

Metadata is tracing metadata propagator

func (Metadata) Extract

func (b Metadata) Extract(parent context.Context, carrier propagation.TextMapCarrier) context.Context

Extract returns a copy of parent with the metadata from the carrier added.

func (Metadata) Fields

func (b Metadata) Fields() []string

Fields returns the keys who's values are set with Inject.

func (Metadata) Inject

func (b Metadata) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject sets metadata key-values from ctx into the carrier.

type Option

type Option func(*options)

Option is tracing option.

func WithPropagator

func WithPropagator(propagator propagation.TextMapPropagator) Option

WithPropagator with tracer propagator.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider with tracer provider. Deprecated: use otel.SetTracerProvider(provider) instead.

type Provider added in v0.0.3

type Provider struct {
	// contains filtered or unexported fields
}

func MustNewProvider added in v0.0.3

func MustNewProvider(c *Conf, serviceName string, uuid string) *Provider

func NewProvider added in v0.0.3

func NewProvider(c *Conf, serviceName string, uuid string) (*Provider, error)

NewProvider Get trace provider

func (*Provider) Close added in v0.0.3

func (o *Provider) Close()

type Stdout added in v0.0.3

type Stdout struct {
	Enable  bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	Metrics bool `protobuf:"varint,3,opt,name=metrics,proto3" json:"metrics,omitempty"`
	Traces  bool `protobuf:"varint,4,opt,name=traces,proto3" json:"traces,omitempty"`
	// contains filtered or unexported fields
}

func (*Stdout) Descriptor deprecated added in v0.0.3

func (*Stdout) Descriptor() ([]byte, []int)

Deprecated: Use Stdout.ProtoReflect.Descriptor instead.

func (*Stdout) GetEnable added in v0.0.3

func (x *Stdout) GetEnable() bool

func (*Stdout) GetMetrics added in v0.0.3

func (x *Stdout) GetMetrics() bool

func (*Stdout) GetTraces added in v0.0.3

func (x *Stdout) GetTraces() bool

func (*Stdout) ProtoMessage added in v0.0.3

func (*Stdout) ProtoMessage()

func (*Stdout) ProtoReflect added in v0.0.3

func (x *Stdout) ProtoReflect() protoreflect.Message

func (*Stdout) Reset added in v0.0.3

func (x *Stdout) Reset()

func (*Stdout) String added in v0.0.3

func (x *Stdout) String() string

func (*Stdout) Validate added in v0.0.3

func (m *Stdout) Validate() error

Validate checks the field values on Stdout with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type StdoutValidationError added in v0.0.3

type StdoutValidationError struct {
	// contains filtered or unexported fields
}

StdoutValidationError is the validation error returned by Stdout.Validate if the designated constraints aren't met.

func (StdoutValidationError) Cause added in v0.0.3

func (e StdoutValidationError) Cause() error

Cause function returns cause value.

func (StdoutValidationError) Error added in v0.0.3

func (e StdoutValidationError) Error() string

Error satisfies the builtin error interface

func (StdoutValidationError) ErrorName added in v0.0.3

func (e StdoutValidationError) ErrorName() string

ErrorName returns error name.

func (StdoutValidationError) Field added in v0.0.3

func (e StdoutValidationError) Field() string

Field function returns field value.

func (StdoutValidationError) Key added in v0.0.3

func (e StdoutValidationError) Key() bool

Key function returns key value.

func (StdoutValidationError) Reason added in v0.0.3

func (e StdoutValidationError) Reason() string

Reason function returns reason value.

type TraceContext

type TraceContext struct{}

TraceContext is a propagator that supports the W3C Trace Context format (https://www.w3.org/TR/trace-context/)

This propagator will propagate the traceparent and tracestate headers to guarantee traces are not broken. It is up to the users of this propagator to choose if they want to participate in a trace by modifying the traceparent header and relevant parts of the tracestate header containing their proprietary information.

func (TraceContext) Extract

Extract reads tracecontext from the carrier into a returned Context.

The returned Context will be a copy of ctx and contain the extracted tracecontext as the remote SpanContext. If the extracted tracecontext is invalid, the passed ctx will be returned directly instead.

func (TraceContext) Fields

func (tc TraceContext) Fields() []string

Fields returns the keys who's values are set with Inject.

func (TraceContext) Inject

func (tc TraceContext) Inject(ctx context.Context, carrier propagation.TextMapCarrier)

Inject set tracecontext from the Context into the carrier.

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer is otel span tracer

func NewTracer

func NewTracer(kind trace.SpanKind, opts ...Option) *Tracer

NewTracer create tracer instance

func (*Tracer) End

func (t *Tracer) End(ctx context.Context, span trace.Span, m interface{}, err error)

End finish tracing span

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, operation string, carrier propagation.TextMapCarrier) (context.Context, trace.Span)

Start start tracing span

Jump to

Keyboard shortcuts

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