experimentalmetricmetadata

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 4

README

Experimental Metric Metadata

This module is experimental and its functionality and interfaces are not guaranteed to be stable or permanent.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityDeleteDetails added in v0.82.0

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

EntityDeleteDetails represents the details of an EntityDelete event.

type EntityEvent added in v0.82.0

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

EntityEvent is an entity event.

func (EntityEvent) EntityDeleteDetails added in v0.82.0

func (e EntityEvent) EntityDeleteDetails() EntityDeleteDetails

EntityDeleteDetails return the entity delete details of this event.

func (EntityEvent) EntityStateDetails added in v0.82.0

func (e EntityEvent) EntityStateDetails() EntityStateDetails

EntityStateDetails returns the entity state details of this event.

func (EntityEvent) EventType added in v0.82.0

func (e EntityEvent) EventType() EventType

EventType returns the type of the event.

func (EntityEvent) ID added in v0.82.0

func (e EntityEvent) ID() pcommon.Map

ID of the entity.

func (EntityEvent) SetEntityDelete added in v0.82.0

func (e EntityEvent) SetEntityDelete() EntityDeleteDetails

SetEntityDelete makes this an EntityDeleteDetails event.

func (EntityEvent) SetEntityState added in v0.82.0

func (e EntityEvent) SetEntityState() EntityStateDetails

SetEntityState makes this an EntityStateDetails event.

func (EntityEvent) SetTimestamp added in v0.82.0

func (e EntityEvent) SetTimestamp(timestamp pcommon.Timestamp)

SetTimestamp sets the event timestamp.

func (EntityEvent) Timestamp added in v0.82.0

func (e EntityEvent) Timestamp() pcommon.Timestamp

Timestamp of the event.

type EntityEventsSlice added in v0.82.0

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

EntityEventsSlice is a slice of EntityEvent.

func NewEntityEventsSlice added in v0.82.0

func NewEntityEventsSlice() EntityEventsSlice

NewEntityEventsSlice creates an empty EntityEventsSlice.

func (EntityEventsSlice) AppendEmpty added in v0.82.0

func (s EntityEventsSlice) AppendEmpty() EntityEvent

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

func (EntityEventsSlice) At added in v0.82.0

At returns the element at the given index.

func (EntityEventsSlice) ConvertAndMoveToLogs added in v0.82.0

func (s EntityEventsSlice) ConvertAndMoveToLogs() plog.Logs

ConvertAndMoveToLogs converts entity events to log representation and moves them from this EntityEventsSlice into plog.Logs. This slice becomes empty after this call.

func (EntityEventsSlice) EnsureCapacity added in v0.82.0

func (s EntityEventsSlice) EnsureCapacity(newCap int)

EnsureCapacity is an operation that ensures the slice has at least the specified capacity.

func (EntityEventsSlice) Len added in v0.82.0

func (s EntityEventsSlice) Len() int

Len returns the number of elements in the slice.

type EntityStateDetails added in v0.82.0

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

EntityStateDetails represents the details of an EntityState event.

func (EntityStateDetails) Attributes added in v0.82.0

func (s EntityStateDetails) Attributes() pcommon.Map

Attributes returns the attributes of the entity.

func (EntityStateDetails) EntityType added in v0.82.0

func (s EntityStateDetails) EntityType() string

EntityType returns the type of the entity.

func (EntityStateDetails) SetEntityType added in v0.82.0

func (s EntityStateDetails) SetEntityType(t string)

SetEntityType sets the type of the entity.

type EventType added in v0.82.0

type EventType int

EventType is the type of the entity event.

const (
	// EventTypeNone indicates an invalid or unknown event type.
	EventTypeNone EventType = iota
	// EventTypeState is the "entity state" event.
	EventTypeState
	// EventTypeDelete is the "entity delete" event.
	EventTypeDelete
)

type MetadataDelta

type MetadataDelta struct {
	// MetadataToAdd contains key-value pairs that are newly added to
	// the resource description in the current revision.
	MetadataToAdd map[string]string
	// MetadataToRemove contains key-value pairs that no longer describe
	// a resource and needs to be removed.
	MetadataToRemove map[string]string
	// MetadataToUpdate contains key-value pairs that have been updated
	// in the current revision compared to the previous revisions(s).
	MetadataToUpdate map[string]string
}

MetadataDelta keeps track of changes to metadata on resources. The fields on this struct should help determine if there have been changes to resource metadata such as Kubernetes labels. An example of how this is used. Let's say we are dealing with a Pod that has the following labels - {"env": "test", "team": "otell", "usser": "bob"}. Now, let's say there's an update to one or more labels on the same Pod and the labels now look like the following - {"env": "test", "team": "otel", "user": "bob"}. The k8sclusterreceiver upon receiving the event corresponding to the labels updates will generate a MetadataDelta with the following values -

MetadataToAdd: {"user": "bob"}
MetadataToRemove: {"usser": "bob"}
MetadataToUpdate: {"team": "otel"}

Apart from Kubernetes labels, the other metadata collected by this receiver are also handled in the same manner. Type, functionality, and fields not guaranteed to be stable or permanent.

type MetadataExporter

type MetadataExporter interface {
	// ConsumeMetadata will be invoked every time there's an
	// update to a resource that results in one or more MetadataUpdate.
	ConsumeMetadata(metadata []*MetadataUpdate) error
}

MetadataExporter provides an interface to implement ConsumeMetadata in Exporters that support metadata. Type, functionality, and interface not guaranteed to be stable or permanent.

type MetadataUpdate

type MetadataUpdate struct {
	// ResourceIDKey is the label key of UID label for the resource.
	ResourceIDKey string
	// ResourceID is the Kubernetes UID of the resource. In case of
	// containers, this value is the container id.
	ResourceID ResourceID
	MetadataDelta
}

MetadataUpdate provides a delta view of metadata on a resource between two revisions of a resource. Type, functionality, and fields not guaranteed to be stable or permanent.

type ResourceID

type ResourceID string

ResourceID type not guaranteed to be stable or permanent.

Jump to

Keyboard shortcuts

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