Documentation ¶
Index ¶
- Constants
- Variables
- func Create(c *Conf, serviceName string, uuid string) error
- func Register(name string, factory Factory)
- type Conf
- func (*Conf) Descriptor() ([]byte, []int)deprecated
- func (x *Conf) GetEndpoint() string
- func (x *Conf) GetProviderType() ProviderType
- func (x *Conf) GetType() Type
- func (x *Conf) GetXray() bool
- func (*Conf) ProtoMessage()
- func (x *Conf) ProtoReflect() protoreflect.Message
- func (x *Conf) Reset()
- func (x *Conf) String() string
- func (m *Conf) Validate() error
- func (m *Conf) ValidateAll() error
- type ConfMultiError
- type ConfValidationError
- type Factory
- type Metadata
- type ProviderType
- func (ProviderType) Descriptor() protoreflect.EnumDescriptor
- func (x ProviderType) Enum() *ProviderType
- func (ProviderType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ProviderType) Number() protoreflect.EnumNumber
- func (x ProviderType) String() string
- func (ProviderType) Type() protoreflect.EnumType
- type Registry
- type TraceContext
- type Type
Constants ¶
const ServiceHeader = "x-md-service-name"
Variables ¶
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.
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.
var File_otel_conf_proto protoreflect.FileDescriptor
Functions ¶
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) GetEndpoint ¶ added in v0.0.36
func (*Conf) GetProviderType ¶ added in v0.0.36
func (x *Conf) GetProviderType() ProviderType
func (*Conf) ProtoMessage ¶
func (*Conf) ProtoMessage()
func (*Conf) ProtoReflect ¶
func (x *Conf) ProtoReflect() protoreflect.Message
func (*Conf) Validate ¶
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 ¶
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 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) 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) Descriptor() protoreflect.EnumDescriptor
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 (x ProviderType) Number() protoreflect.EnumNumber
func (ProviderType) String ¶ added in v0.0.36
func (x ProviderType) String() string
func (ProviderType) Type ¶ added in v0.0.36
func (ProviderType) Type() protoreflect.EnumType
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 ¶
func (tc TraceContext) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context
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
func (Type) Descriptor ¶ added in v0.0.36
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
added in
v0.0.36
func (Type) Number ¶ added in v0.0.36
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶ added in v0.0.36
func (Type) Type() protoreflect.EnumType