Documentation ¶
Index ¶
- Constants
- Variables
- type JSONMarshaler
- type JSONUnmarshaler
- type LogRecord
- func (ms LogRecord) Attributes() pcommon.Map
- func (ms LogRecord) Body() pcommon.Value
- func (ms LogRecord) CopyTo(dest LogRecord)
- func (ms LogRecord) DroppedAttributesCount() uint32
- func (ms LogRecord) Flags() LogRecordFlags
- func (ms LogRecord) MoveTo(dest LogRecord)
- func (ms LogRecord) ObservedTimestamp() pcommon.Timestamp
- func (ms LogRecord) SetDroppedAttributesCount(v uint32)
- func (ms LogRecord) SetFlags(v LogRecordFlags)
- func (ms LogRecord) SetObservedTimestamp(v pcommon.Timestamp)
- func (ms LogRecord) SetSeverityNumber(v SeverityNumber)
- func (ms LogRecord) SetSeverityText(v string)
- func (ms LogRecord) SetSpanID(v pcommon.SpanID)
- func (ms LogRecord) SetTimestamp(v pcommon.Timestamp)
- func (ms LogRecord) SetTraceID(v pcommon.TraceID)
- func (ms LogRecord) SeverityNumber() SeverityNumber
- func (ms LogRecord) SeverityText() string
- func (ms LogRecord) SpanID() pcommon.SpanID
- func (ms LogRecord) Timestamp() pcommon.Timestamp
- func (ms LogRecord) TraceID() pcommon.TraceID
- type LogRecordFlags
- type LogRecordSlice
- func (es LogRecordSlice) AppendEmpty() LogRecord
- func (es LogRecordSlice) At(i int) LogRecord
- func (es LogRecordSlice) CopyTo(dest LogRecordSlice)
- func (es LogRecordSlice) EnsureCapacity(newCap int)
- func (es LogRecordSlice) Len() int
- func (es LogRecordSlice) MoveAndAppendTo(dest LogRecordSlice)
- func (es LogRecordSlice) RemoveIf(f func(LogRecord) bool)
- func (es LogRecordSlice) Sort(less func(a, b LogRecord) bool)
- type Logs
- type MarshalSizer
- type Marshaler
- type ProtoMarshaler
- type ProtoUnmarshaler
- type ResourceLogs
- type ResourceLogsSlice
- func (es ResourceLogsSlice) AppendEmpty() ResourceLogs
- func (es ResourceLogsSlice) At(i int) ResourceLogs
- func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice)
- func (es ResourceLogsSlice) EnsureCapacity(newCap int)
- func (es ResourceLogsSlice) Len() int
- func (es ResourceLogsSlice) MoveAndAppendTo(dest ResourceLogsSlice)
- func (es ResourceLogsSlice) RemoveIf(f func(ResourceLogs) bool)
- func (es ResourceLogsSlice) Sort(less func(a, b ResourceLogs) bool)
- type ScopeLogs
- type ScopeLogsSlice
- func (es ScopeLogsSlice) AppendEmpty() ScopeLogs
- func (es ScopeLogsSlice) At(i int) ScopeLogs
- func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice)
- func (es ScopeLogsSlice) EnsureCapacity(newCap int)
- func (es ScopeLogsSlice) Len() int
- func (es ScopeLogsSlice) MoveAndAppendTo(dest ScopeLogsSlice)
- func (es ScopeLogsSlice) RemoveIf(f func(ScopeLogs) bool)
- func (es ScopeLogsSlice) Sort(less func(a, b ScopeLogs) bool)
- type SeverityNumber
- type Sizer
- type Unmarshaler
Constants ¶
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 ¶
var DefaultLogRecordFlags = LogRecordFlags(0)
Functions ¶
This section is empty.
Types ¶
type JSONMarshaler ¶
type JSONMarshaler struct{}
func (*JSONMarshaler) MarshalLogs ¶
func (*JSONMarshaler) MarshalLogs(ld Logs) ([]byte, error)
type JSONUnmarshaler ¶
type JSONUnmarshaler struct{}
func (*JSONUnmarshaler) UnmarshalLogs ¶
func (*JSONUnmarshaler) UnmarshalLogs(buf []byte) (Logs, error)
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 ¶
Attributes returns the Attributes associated with this LogRecord.
func (LogRecord) CopyTo ¶
CopyTo copies all properties from the current struct overriding the destination.
func (LogRecord) DroppedAttributesCount ¶
DroppedAttributesCount returns the droppedattributescount associated with this LogRecord.
func (LogRecord) Flags ¶
func (ms LogRecord) Flags() LogRecordFlags
Flags returns the flags associated with this LogRecord.
func (LogRecord) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (LogRecord) ObservedTimestamp ¶
ObservedTimestamp returns the observedtimestamp associated with this LogRecord.
func (LogRecord) SetDroppedAttributesCount ¶
SetDroppedAttributesCount replaces the droppedattributescount associated with this LogRecord.
func (LogRecord) SetFlags ¶
func (ms LogRecord) SetFlags(v LogRecordFlags)
SetFlags replaces the flags associated with this LogRecord.
func (LogRecord) SetObservedTimestamp ¶
SetObservedTimestamp replaces the observedtimestamp associated with this LogRecord.
func (LogRecord) SetSeverityNumber ¶
func (ms LogRecord) SetSeverityNumber(v SeverityNumber)
SetSeverityNumber replaces the severitynumber associated with this LogRecord.
func (LogRecord) SetSeverityText ¶
SetSeverityText replaces the severitytext associated with this LogRecord.
func (LogRecord) SetTimestamp ¶
SetTimestamp replaces the timestamp associated with this LogRecord.
func (LogRecord) SetTraceID ¶
SetTraceID replaces the traceid associated with this LogRecord.
func (LogRecord) SeverityNumber ¶
func (ms LogRecord) SeverityNumber() SeverityNumber
SeverityNumber returns the severitynumber associated with this LogRecord.
func (LogRecord) SeverityText ¶
SeverityText returns the severitytext associated with this LogRecord.
type LogRecordFlags ¶
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 ¶
func (ms LogRecordFlags) IsSampled() bool
IsSampled returns true if the LogRecordFlags contains the IsSampled flag.
func (LogRecordFlags) WithIsSampled ¶
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 ¶
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 ¶
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 ¶
func (es LogRecordSlice) CopyTo(dest LogRecordSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (LogRecordSlice) EnsureCapacity ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 (Logs) LogRecordCount ¶
LogRecordCount calculates the total number of log records.
func (Logs) ResourceLogs ¶
func (ms Logs) ResourceLogs() ResourceLogsSlice
ResourceLogs returns the ResourceLogsSlice associated with this Logs.
type MarshalSizer ¶
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 ¶
type ProtoMarshaler struct{}
func (*ProtoMarshaler) LogsSize ¶
func (e *ProtoMarshaler) LogsSize(ld Logs) int
func (*ProtoMarshaler) MarshalLogs ¶
func (e *ProtoMarshaler) MarshalLogs(ld Logs) ([]byte, error)
type ProtoUnmarshaler ¶
type ProtoUnmarshaler struct{}
func (*ProtoUnmarshaler) UnmarshalLogs ¶
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 ¶
func (ms ResourceLogs) CopyTo(dest ResourceLogs)
CopyTo copies all properties from the current struct overriding the destination.
func (ResourceLogs) MoveTo ¶
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 ¶
func (ms ResourceLogs) Resource() pcommon.Resource
Resource returns the resource associated with this ResourceLogs.
func (ResourceLogs) SchemaUrl ¶
func (ms ResourceLogs) SchemaUrl() string
SchemaUrl returns the schemaurl associated with this ResourceLogs.
func (ResourceLogs) ScopeLogs ¶
func (ms ResourceLogs) ScopeLogs() ScopeLogsSlice
ScopeLogs returns the ScopeLogs associated with this ResourceLogs.
func (ResourceLogs) SetSchemaUrl ¶
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 ¶
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 ¶
func (es ResourceLogsSlice) At(i int) ResourceLogs
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 ¶
func (es ResourceLogsSlice) CopyTo(dest ResourceLogsSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (ResourceLogsSlice) EnsureCapacity ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
CopyTo copies all properties from the current struct overriding the destination.
func (ScopeLogs) LogRecords ¶
func (ms ScopeLogs) LogRecords() LogRecordSlice
LogRecords returns the LogRecords associated with this ScopeLogs.
func (ScopeLogs) MoveTo ¶
MoveTo moves all properties from the current struct overriding the destination and resetting the current instance to its zero value
func (ScopeLogs) Scope ¶
func (ms ScopeLogs) Scope() pcommon.InstrumentationScope
Scope returns the scope associated with this ScopeLogs.
func (ScopeLogs) SetSchemaUrl ¶
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 ¶
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 ¶
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 ¶
func (es ScopeLogsSlice) CopyTo(dest ScopeLogsSlice)
CopyTo copies all elements from the current slice overriding the destination.
func (ScopeLogsSlice) EnsureCapacity ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.