otel

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const ServiceHeader = "x-md-service-name"

Variables

View Source
var (
	ProviderType_name = map[int32]string{
		0: "Unkown",
		1: "Jaeger",
		2: "Stdout",
		3: "Otlp",
		4: "Prometheus",
	}
	ProviderType_value = map[string]int32{
		"Unkown":     0,
		"Jaeger":     1,
		"Stdout":     2,
		"Otlp":       3,
		"Prometheus": 4,
	}
)

Enum value maps for ProviderType.

View Source
var (
	Type_name = map[int32]string{
		0: "Unkown1",
		1: "Traces",
		2: "Metrics",
	}
	Type_value = map[string]int32{
		"Unkown1": 0,
		"Traces":  1,
		"Metrics": 2,
	}
)

Enum value maps for Type.

View Source
var File_otel_conf_proto protoreflect.FileDescriptor

Functions

func Create added in v0.0.36

func Create(c *Conf, serviceName string, uuid string) error

Create instantiates a discovery based on `discoveryDSN`.

func Register added in v0.0.36

func Register(name string, factory Factory)

Register registers one discovery.

Types

type Conf

type Conf struct {
	ProviderType ProviderType `protobuf:"varint,1,opt,name=providerType,proto3,enum=otel.ProviderType" json:"providerType,omitempty"`
	Type         Type         `protobuf:"varint,2,opt,name=type,proto3,enum=otel.Type" json:"type,omitempty"`
	Endpoint     string       `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	Xray         bool         `protobuf:"varint,5,opt,name=xray,proto3" json:"xray,omitempty"`
	// contains filtered or unexported fields
}

func (*Conf) Descriptor deprecated

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

Deprecated: Use Conf.ProtoReflect.Descriptor instead.

func (*Conf) GetEndpoint added in v0.0.36

func (x *Conf) GetEndpoint() string

func (*Conf) GetProviderType added in v0.0.36

func (x *Conf) GetProviderType() ProviderType

func (*Conf) GetType added in v0.0.36

func (x *Conf) GetType() Type

func (*Conf) GetXray added in v0.0.36

func (x *Conf) GetXray() bool

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, the first error encountered is returned, or nil if there are no violations.

func (*Conf) ValidateAll

func (m *Conf) ValidateAll() error

ValidateAll checks the field values on Conf with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ConfMultiError, or nil if none found.

type ConfMultiError

type ConfMultiError []error

ConfMultiError is an error wrapping multiple validation errors returned by Conf.ValidateAll() if the designated constraints aren't met.

func (ConfMultiError) AllErrors

func (m ConfMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ConfMultiError) Error

func (m ConfMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

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 Factory added in v0.0.36

type Factory func(c *Conf, serviceName string, uuid string) error

type Metadata

type Metadata struct{}

Metadata is otel 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 ProviderType added in v0.0.36

type ProviderType int32
const (
	ProviderType_Unkown     ProviderType = 0
	ProviderType_Jaeger     ProviderType = 1
	ProviderType_Stdout     ProviderType = 2
	ProviderType_Otlp       ProviderType = 3
	ProviderType_Prometheus ProviderType = 4
)

func (ProviderType) Descriptor added in v0.0.36

func (ProviderType) Enum added in v0.0.36

func (x ProviderType) Enum() *ProviderType

func (ProviderType) EnumDescriptor deprecated added in v0.0.36

func (ProviderType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ProviderType.Descriptor instead.

func (ProviderType) Number added in v0.0.36

func (ProviderType) String added in v0.0.36

func (x ProviderType) String() string

func (ProviderType) Type added in v0.0.36

type Registry added in v0.0.36

type Registry interface {
	Register(name string, factory Factory)
	Create(c *Conf, serviceName string, uuid string) error
}

Registry is the interface for callers to get registered middleware.

func NewRegistry added in v0.0.36

func NewRegistry() Registry

NewRegistry returns a new middleware registry.

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 Type added in v0.0.36

type Type int32
const (
	Type_Unkown1 Type = 0
	Type_Traces  Type = 1
	Type_Metrics Type = 2
)

func (Type) Descriptor added in v0.0.36

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum added in v0.0.36

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated added in v0.0.36

func (Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Type.Descriptor instead.

func (Type) Number added in v0.0.36

func (x Type) Number() protoreflect.EnumNumber

func (Type) String added in v0.0.36

func (x Type) String() string

func (Type) Type added in v0.0.36

func (Type) Type() protoreflect.EnumType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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