statussources

package
v0.86.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReceiverCreatorRegexp = regexp.MustCompile(`receiver_creator/`)

	EndpointTargetRegexp = regexp.MustCompile(`{endpoint=[^}]*}/`)
)

Functions

func MetricsToReceiverIDs

func MetricsToReceiverIDs(md pmetric.Metrics) (component.ID, observer.EndpointID)

MetricsToReceiverIDs extracts the identifiers receiver creator created receivers will embed in their attributes

func NewZapCoreEncoder added in v0.61.0

func NewZapCoreEncoder() zapcore.Encoder

func ReceiverNameToIDs added in v0.61.0

func ReceiverNameToIDs(record plog.LogRecord) (receiverID component.ID, endpointID observer.EndpointID)

ReceiverNameToIDs parses the zap "name" field value according to outcome of https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/12670 where receiver creator receiver names are of the form `<receiver.type>/<receiver.name>/receiver_creator/<receiver-creator.name>{endpoint="<Endpoint.Target>"}/<Endpoint.ID>`. If receiverName argument is not of this form empty Component and Endpoint IDs are returned.

Types

type Statement added in v0.61.0

type Statement struct {
	Message    string
	Fields     map[string]any
	Level      string
	Time       time.Time
	LoggerName string
	Caller     zapcore.EntryCaller
	Stack      string
}

Statement models a zapcore.Entry but defined here for usability/maintainability

func StatementFromZapCoreEntry added in v0.61.0

func StatementFromZapCoreEntry(encoder zapcore.Encoder, entry zapcore.Entry, fields []zapcore.Field) (*Statement, error)

StatementFromZapCoreEntry converts the Entry to a Statement using the provided encoder, which is assumed to be a JSONEncoder (unexpected from zapcore) to obtain the target Fields.

func (*Statement) ToLogRecord added in v0.61.0

func (s *Statement) ToLogRecord() plog.LogRecord

Jump to

Keyboard shortcuts

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