metadata

package
v0.124.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TracesStability  = component.StabilityLevelBeta
	MetricsStability = component.StabilityLevelBeta
	LogsStability    = component.StabilityLevelBeta
)

Variables

View Source
var (
	Type      = component.MustNewType("nop")
	ScopeName = "go.opentelemetry.io/collector/receiver/nopreceiver"
)

Functions

This section is empty.

Types

type LogBuilderOption added in v0.124.0

type LogBuilderOption interface {
	// contains filtered or unexported methods
}

LogBuilderOption applies changes to default logs builder.

type LogsBuilder added in v0.124.0

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

LogsBuilder provides an interface for scrapers to report logs while taking care of all the transformations required to produce log representation defined in metadata and user config.

func NewLogsBuilder added in v0.124.0

func NewLogsBuilder(settings receiver.Settings) *LogsBuilder

func (*LogsBuilder) AppendLogRecord added in v0.124.0

func (lb *LogsBuilder) AppendLogRecord(lr plog.LogRecord)

AppendLogRecord adds a log record to the logs builder.

func (*LogsBuilder) Emit added in v0.124.0

func (lb *LogsBuilder) Emit(options ...ResourceLogsOption) plog.Logs

Emit returns all the logs accumulated by the logs builder and updates the internal state to be ready for recording another set of logs. This function will be responsible for applying all the transformations required to produce logs representation defined in metadata and user config.

func (*LogsBuilder) EmitForResource added in v0.124.0

func (lb *LogsBuilder) EmitForResource(options ...ResourceLogsOption)

EmitForResource saves all the generated logs under a new resource and updates the internal state to be ready for recording another set of log records as part of another resource. This function can be helpful when one scraper needs to emit logs from several resources. Otherwise calling this function is not required, just `Emit` function can be called instead. Resource attributes should be provided as ResourceLogsOption arguments.

type ResourceLogsOption added in v0.124.0

type ResourceLogsOption interface {
	// contains filtered or unexported methods
}

ResourceLogsOption applies changes to provided resource logs.

func WithLogsResource added in v0.124.0

func WithLogsResource(res pcommon.Resource) ResourceLogsOption

WithLogsResource sets the provided resource on the emitted ResourceLogs. It's recommended to use ResourceBuilder to create the resource.

Jump to

Keyboard shortcuts

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