plog

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 427

Documentation

Index

Constants

View Source
const (
	SeverityNumberUnspecified = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED)
	SeverityNumberTrace       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE)
	SeverityNumberTrace2      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE2)
	SeverityNumberTrace3      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE3)
	SeverityNumberTrace4      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_TRACE4)
	SeverityNumberDebug       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG)
	SeverityNumberDebug2      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG2)
	SeverityNumberDebug3      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG3)
	SeverityNumberDebug4      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_DEBUG4)
	SeverityNumberInfo        = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO)
	SeverityNumberInfo2       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO2)
	SeverityNumberInfo3       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO3)
	SeverityNumberInfo4       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_INFO4)
	SeverityNumberWarn        = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN)
	SeverityNumberWarn2       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN2)
	SeverityNumberWarn3       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN3)
	SeverityNumberWarn4       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_WARN4)
	SeverityNumberError       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR)
	SeverityNumberError2      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR2)
	SeverityNumberError3      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR3)
	SeverityNumberError4      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_ERROR4)
	SeverityNumberFatal       = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL)
	SeverityNumberFatal2      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL2)
	SeverityNumberFatal3      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL3)
	SeverityNumberFatal4      = SeverityNumber(otlplogs.SeverityNumber_SEVERITY_NUMBER_FATAL4)
)

Variables

View Source
var DefaultLogRecordFlags = LogRecordFlags(0)

Functions

This section is empty.

Types

type JSONMarshaler added in v0.63.0

type JSONMarshaler struct{}

JSONMarshaler marshals pdata.Logs to JSON bytes using the OTLP/JSON format.

func (*JSONMarshaler) MarshalLogs added in v0.63.0

func (*JSONMarshaler) MarshalLogs(ld Logs) ([]byte, error)

MarshalLogs to the OTLP/JSON format.

type JSONUnmarshaler added in v0.63.0

type JSONUnmarshaler struct{}

JSONUnmarshaler unmarshals OTLP/JSON formatted-bytes to pdata.Logs.

func (*JSONUnmarshaler) UnmarshalLogs added in v0.63.0

func (*JSONUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error)

UnmarshalLogs from OTLP/JSON format into pdata.Logs.

type LogRecord

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

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewLogRecord function to create new instances. Important: zero-initialized instance is not valid for use.

func NewLogRecord

func NewLogRecord() LogRecord

NewLogRecord creates a new empty LogRecord.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (LogRecord) Attributes added in v0.59.0

func (ms LogRecord) Attributes() pcommon.Map

Attributes returns the Attributes associated with this LogRecord.

func (LogRecord) Body added in v0.59.0

func (ms LogRecord) Body() pcommon.Value

Body returns the body associated with this LogRecord.

func (LogRecord) CopyTo added in v0.59.0

func (ms LogRecord) CopyTo(dest LogRecord)

CopyTo copies all properties from the current struct overriding the destination.

func (LogRecord) DroppedAttributesCount added in v0.59.0

func (ms LogRecord) DroppedAttributesCount() uint32

DroppedAttributesCount returns the droppedattributescount associated with this LogRecord.

func (LogRecord) Flags added in v0.59.0

func (ms LogRecord) Flags() LogRecordFlags

Flags returns the flags associated with this LogRecord.

func (LogRecord) MoveTo added in v0.59.0

func (ms LogRecord) MoveTo(dest LogRecord)

MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value

func (LogRecord) ObservedTimestamp added in v0.59.0

func (ms LogRecord) ObservedTimestamp() pcommon.Timestamp

ObservedTimestamp returns the observedtimestamp associated with this LogRecord.

func (LogRecord) SetDroppedAttributesCount added in v0.59.0

func (ms LogRecord) SetDroppedAttributesCount(v uint32)

SetDroppedAttributesCount replaces the droppedattributescount associated with this LogRecord.

func (LogRecord) SetFlags added in v0.59.0

func (ms LogRecord) SetFlags(v LogRecordFlags)

SetFlags replaces the flags associated with this LogRecord.

func (LogRecord) SetObservedTimestamp added in v0.59.0

func (ms LogRecord) SetObservedTimestamp(v pcommon.Timestamp)

SetObservedTimestamp replaces the observedtimestamp associated with this LogRecord.

func (LogRecord) SetSeverityNumber added in v0.59.0

func (ms LogRecord) SetSeverityNumber(v SeverityNumber)

SetSeverityNumber replaces the severitynumber associated with this LogRecord.

func (LogRecord) SetSeverityText added in v0.59.0

func (ms LogRecord) SetSeverityText(v string)

SetSeverityText replaces the severitytext associated with this LogRecord.

func (LogRecord) SetSpanID added in v0.59.0

func (ms LogRecord) SetSpanID(v pcommon.SpanID)

SetSpanID replaces the spanid associated with this LogRecord.

func (LogRecord) SetTimestamp added in v0.59.0

func (ms LogRecord) SetTimestamp(v pcommon.Timestamp)

SetTimestamp replaces the timestamp associated with this LogRecord.

func (LogRecord) SetTraceID added in v0.59.0

func (ms LogRecord) SetTraceID(v pcommon.TraceID)

SetTraceID replaces the traceid associated with this LogRecord.

func (LogRecord) SeverityNumber added in v0.59.0

func (ms LogRecord) SeverityNumber() SeverityNumber

SeverityNumber returns the severitynumber associated with this LogRecord.

func (LogRecord) SeverityText added in v0.59.0

func (ms LogRecord) SeverityText() string

SeverityText returns the severitytext associated with this LogRecord.

func (LogRecord) SpanID added in v0.59.0

func (ms LogRecord) SpanID() pcommon.SpanID

SpanID returns the spanid associated with this LogRecord.

func (LogRecord) Timestamp added in v0.59.0

func (ms LogRecord) Timestamp() pcommon.Timestamp

Timestamp returns the timestamp associated with this LogRecord.

func (LogRecord) TraceID added in v0.59.0

func (ms LogRecord) TraceID() pcommon.TraceID

TraceID returns the traceid associated with this LogRecord.

type LogRecordFlags added in v0.59.0

type LogRecordFlags uint32

LogRecordFlags defines flags for the LogRecord. The 8 least significant bits are the trace flags as defined in W3C Trace Context specification. 24 most significant bits are reserved and must be set to 0.

func (LogRecordFlags) IsSampled added in v0.59.0

func (ms LogRecordFlags) IsSampled() bool

IsSampled returns true if the LogRecordFlags contains the IsSampled flag.

func (LogRecordFlags) WithIsSampled added in v0.59.0

func (ms LogRecordFlags) WithIsSampled(b bool) LogRecordFlags

WithIsSampled returns a new LogRecordFlags, with the IsSampled flag set to the given value.

type LogRecordSlice

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

LogRecordSlice logically represents a slice of LogRecord.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewLogRecordSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewLogRecordSlice

func NewLogRecordSlice() LogRecordSlice

NewLogRecordSlice creates a LogRecordSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (LogRecordSlice) AppendEmpty added in v0.59.0

func (es LogRecordSlice) AppendEmpty() LogRecord

AppendEmpty will append to the end of the slice an empty LogRecord. It returns the newly added LogRecord.

func (LogRecordSlice) At added in v0.59.0

func (es LogRecordSlice) At(i int) LogRecord

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (LogRecordSlice) CopyTo added in v0.59.0

func (es LogRecordSlice) CopyTo(dest LogRecordSlice)

CopyTo copies all elements from the current slice overriding the destination.

func (LogRecordSlice) EnsureCapacity added in v0.59.0

func (es LogRecordSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new LogRecordSlice can be initialized:

es := NewLogRecordSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (LogRecordSlice) Len added in v0.59.0

func (es LogRecordSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewLogRecordSlice()".

func (LogRecordSlice) MoveAndAppendTo added in v0.59.0

func (es LogRecordSlice) MoveAndAppendTo(dest LogRecordSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (LogRecordSlice) RemoveIf added in v0.59.0

func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (LogRecordSlice) Sort added in v0.59.0

func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool)

Sort sorts the LogRecord elements within LogRecordSlice given the provided less function so that two instances of LogRecordSlice can be compared.

type Logs

type Logs internal.Logs

Logs is the top-level struct that is propagated through the logs pipeline. Use NewLogs to create new instance, zero-initialized instance is not valid for use.

func NewLogs

func NewLogs() Logs

NewLogs creates a new Logs struct.

func (Logs) CopyTo added in v0.61.0

func (ms Logs) CopyTo(dest Logs)

CopyTo copies the Logs instance overriding the destination.

func (Logs) IsReadOnly added in v1.0.0

func (ms Logs) IsReadOnly() bool

IsReadOnly returns true if this Logs instance is read-only.

func (Logs) LogRecordCount added in v0.59.0

func (ms Logs) LogRecordCount() int

LogRecordCount calculates the total number of log records.

func (Logs) MarkReadOnly added in v1.0.0

func (ms Logs) MarkReadOnly()

MarkReadOnly marks the Logs as shared so that no further modifications can be done on it.

func (Logs) ResourceLogs added in v0.59.0

func (ms Logs) ResourceLogs() ResourceLogsSlice

ResourceLogs returns the ResourceLogsSlice associated with this Logs.

type MarshalSizer added in v0.60.0

type MarshalSizer interface {
	Marshaler
	Sizer
}

MarshalSizer is the interface that groups the basic Marshal and Size methods

type Marshaler

type Marshaler interface {
	// MarshalLogs the given pdata.Logs into bytes.
	// If the error is not nil, the returned bytes slice cannot be used.
	MarshalLogs(ld Logs) ([]byte, error)
}

Marshaler marshals pdata.Logs into bytes.

type ProtoMarshaler added in v0.63.0

type ProtoMarshaler struct{}

func (*ProtoMarshaler) LogsSize added in v0.63.0

func (e *ProtoMarshaler) LogsSize(ld Logs) int

func (*ProtoMarshaler) MarshalLogs added in v0.63.0

func (e *ProtoMarshaler) MarshalLogs(ld Logs) ([]byte, error)

type ProtoUnmarshaler added in v0.63.0

type ProtoUnmarshaler struct{}

func (*ProtoUnmarshaler) UnmarshalLogs added in v0.63.0

func (d *ProtoUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error)

type ResourceLogs

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

ResourceLogs is a collection of logs from a Resource.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewResourceLogs function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResourceLogs

func NewResourceLogs() ResourceLogs

NewResourceLogs creates a new empty ResourceLogs.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ResourceLogs) CopyTo added in v0.59.0

func (ms ResourceLogs) CopyTo(dest ResourceLogs)

CopyTo copies all properties from the current struct overriding the destination.

func (ResourceLogs) MoveTo added in v0.59.0

func (ms ResourceLogs) MoveTo(dest ResourceLogs)

MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value

func (ResourceLogs) Resource added in v0.59.0

func (ms ResourceLogs) Resource() pcommon.Resource

Resource returns the resource associated with this ResourceLogs.

func (ResourceLogs) SchemaUrl added in v0.59.0

func (ms ResourceLogs) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ResourceLogs.

func (ResourceLogs) ScopeLogs added in v0.59.0

func (ms ResourceLogs) ScopeLogs() ScopeLogsSlice

ScopeLogs returns the ScopeLogs associated with this ResourceLogs.

func (ResourceLogs) SetSchemaUrl added in v0.59.0

func (ms ResourceLogs) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ResourceLogs.

type ResourceLogsSlice

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

ResourceLogsSlice logically represents a slice of ResourceLogs.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewResourceLogsSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewResourceLogsSlice

func NewResourceLogsSlice() ResourceLogsSlice

NewResourceLogsSlice creates a ResourceLogsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ResourceLogsSlice) AppendEmpty added in v0.59.0

func (es ResourceLogsSlice) AppendEmpty() ResourceLogs

AppendEmpty will append to the end of the slice an empty ResourceLogs. It returns the newly added ResourceLogs.

func (ResourceLogsSlice) At added in v0.59.0

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ResourceLogsSlice) CopyTo added in v0.59.0

func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice)

CopyTo copies all elements from the current slice overriding the destination.

func (ResourceLogsSlice) EnsureCapacity added in v0.59.0

func (es ResourceLogsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ResourceLogsSlice can be initialized:

es := NewResourceLogsSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ResourceLogsSlice) Len added in v0.59.0

func (es ResourceLogsSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewResourceLogsSlice()".

func (ResourceLogsSlice) MoveAndAppendTo added in v0.59.0

func (es ResourceLogsSlice) MoveAndAppendTo(dest ResourceLogsSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ResourceLogsSlice) RemoveIf added in v0.59.0

func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ResourceLogsSlice) Sort added in v0.59.0

func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool)

Sort sorts the ResourceLogs elements within ResourceLogsSlice given the provided less function so that two instances of ResourceLogsSlice can be compared.

type ScopeLogs

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

ScopeLogs is a collection of logs from a LibraryInstrumentation.

This is a reference type, if passed by value and callee modifies it the caller will see the modification.

Must use NewScopeLogs function to create new instances. Important: zero-initialized instance is not valid for use.

func NewScopeLogs

func NewScopeLogs() ScopeLogs

NewScopeLogs creates a new empty ScopeLogs.

This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, OR directly access the member if this is embedded in another struct.

func (ScopeLogs) CopyTo added in v0.59.0

func (ms ScopeLogs) CopyTo(dest ScopeLogs)

CopyTo copies all properties from the current struct overriding the destination.

func (ScopeLogs) LogRecords added in v0.59.0

func (ms ScopeLogs) LogRecords() LogRecordSlice

LogRecords returns the LogRecords associated with this ScopeLogs.

func (ScopeLogs) MoveTo added in v0.59.0

func (ms ScopeLogs) MoveTo(dest ScopeLogs)

MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value

func (ScopeLogs) SchemaUrl added in v0.59.0

func (ms ScopeLogs) SchemaUrl() string

SchemaUrl returns the schemaurl associated with this ScopeLogs.

func (ScopeLogs) Scope added in v0.59.0

Scope returns the scope associated with this ScopeLogs.

func (ScopeLogs) SetSchemaUrl added in v0.59.0

func (ms ScopeLogs) SetSchemaUrl(v string)

SetSchemaUrl replaces the schemaurl associated with this ScopeLogs.

type ScopeLogsSlice

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

ScopeLogsSlice logically represents a slice of ScopeLogs.

This is a reference type. If passed by value and callee modifies it, the caller will see the modification.

Must use NewScopeLogsSlice function to create new instances. Important: zero-initialized instance is not valid for use.

func NewScopeLogsSlice

func NewScopeLogsSlice() ScopeLogsSlice

NewScopeLogsSlice creates a ScopeLogsSlice with 0 elements. Can use "EnsureCapacity" to initialize with a given capacity.

func (ScopeLogsSlice) AppendEmpty added in v0.59.0

func (es ScopeLogsSlice) AppendEmpty() ScopeLogs

AppendEmpty will append to the end of the slice an empty ScopeLogs. It returns the newly added ScopeLogs.

func (ScopeLogsSlice) At added in v0.59.0

func (es ScopeLogsSlice) At(i int) ScopeLogs

At returns the element at the given index.

This function is used mostly for iterating over all the values in the slice:

for i := 0; i < es.Len(); i++ {
    e := es.At(i)
    ... // Do something with the element
}

func (ScopeLogsSlice) CopyTo added in v0.59.0

func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice)

CopyTo copies all elements from the current slice overriding the destination.

func (ScopeLogsSlice) EnsureCapacity added in v0.59.0

func (es ScopeLogsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity. 1. If the newCap <= cap then no change in capacity. 2. If the newCap > cap then the slice capacity will be expanded to equal newCap.

Here is how a new ScopeLogsSlice can be initialized:

es := NewScopeLogsSlice()
es.EnsureCapacity(4)
for i := 0; i < 4; i++ {
    e := es.AppendEmpty()
    // Here should set all the values for e.
}

func (ScopeLogsSlice) Len added in v0.59.0

func (es ScopeLogsSlice) Len() int

Len returns the number of elements in the slice.

Returns "0" for a newly instance created with "NewScopeLogsSlice()".

func (ScopeLogsSlice) MoveAndAppendTo added in v0.59.0

func (es ScopeLogsSlice) MoveAndAppendTo(dest ScopeLogsSlice)

MoveAndAppendTo moves all elements from the current slice and appends them to the dest. The current slice will be cleared.

func (ScopeLogsSlice) RemoveIf added in v0.59.0

func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool)

RemoveIf calls f sequentially for each element present in the slice. If f returns true, the element is removed from the slice.

func (ScopeLogsSlice) Sort added in v0.59.0

func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool)

Sort sorts the ScopeLogs elements within ScopeLogsSlice given the provided less function so that two instances of ScopeLogsSlice can be compared.

type SeverityNumber

type SeverityNumber int32

SeverityNumber represents severity number of a log record.

func (SeverityNumber) String added in v0.59.0

func (sn SeverityNumber) String() string

String returns the string representation of the SeverityNumber.

type Sizer

type Sizer interface {
	// LogsSize returns the size in bytes of a marshaled Logs.
	LogsSize(ld Logs) int
}

Sizer is an optional interface implemented by the Marshaler, that calculates the size of a marshaled Logs.

type Unmarshaler

type Unmarshaler interface {
	// UnmarshalLogs the given bytes into pdata.Logs.
	// If the error is not nil, the returned pdata.Logs cannot be used.
	UnmarshalLogs(buf []byte) (Logs, error)
}

Unmarshaler unmarshalls bytes into pdata.Logs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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