host

package module
v0.0.0-...-806a58a Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package host provides the conventional host metric instruments specified by OpenTelemetry. Host metric events are sometimes collected through the OpenTelemetry Collector "hostmetrics" receiver running as an agent; this instrumentation is an alternative for processes that want to record the same information without an agent.

The metric events produced are listed here with attribute dimensions.

Name			Attribute

----------------------------------------------------------------------

process.cpu.time           state=user|system
system.cpu.time            state=user|system|other|idle
system.memory.usage        state=used|available
system.memory.utilization  state=used|available
system.network.io          direction=transmit|receive

See https://github.com/open-telemetry/oteps/blob/main/text/0119-standard-system-metrics.md for the definition of these metric instruments.

Index

Constants

View Source
const ScopeName = "go.opentelemetry.io/contrib/instrumentation/host"

ScopeName is the instrumentation scope name.

Variables

View Source
var (
	AttributeCPUTimeUser   = attribute.NewSet(attribute.String("state", "user"))
	AttributeCPUTimeSystem = attribute.NewSet(attribute.String("state", "system"))
	AttributeCPUTimeOther  = attribute.NewSet(attribute.String("state", "other"))
	AttributeCPUTimeIdle   = attribute.NewSet(attribute.String("state", "idle"))

	AttributeMemoryAvailable = attribute.NewSet(attribute.String("state", "available"))
	AttributeMemoryUsed      = attribute.NewSet(attribute.String("state", "used"))

	AttributeNetworkTransmit = attribute.NewSet(attribute.String("direction", "transmit"))
	AttributeNetworkReceive  = attribute.NewSet(attribute.String("direction", "receive"))
)

Attribute sets.

Functions

func SemVersion deprecated

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

Deprecated: Use Version instead.

func Start

func Start(opts ...Option) error

Start initializes reporting of host metrics using the supplied config.

func Version

func Version() string

Version is the current release version of the host instrumentation.

Types

type Option

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

Option supports configuring optional settings for host metrics.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider sets the Metric implementation to use for reporting. If this option is not used, the global metric.MeterProvider will be used. `provider` must be non-nil.

Jump to

Keyboard shortcuts

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