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 label dimensions.

    Name			Label
    

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

    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

    This section is empty.

    Variables

    View Source
    var (
    	LabelCPUTimeUser   = []label.KeyValue{label.String("state", "user")}
    	LabelCPUTimeSystem = []label.KeyValue{label.String("state", "system")}
    	LabelCPUTimeOther  = []label.KeyValue{label.String("state", "other")}
    	LabelCPUTimeIdle   = []label.KeyValue{label.String("state", "idle")}
    
    	LabelMemoryAvailable = []label.KeyValue{label.String("state", "available")}
    	LabelMemoryUsed      = []label.KeyValue{label.String("state", "used")}
    
    	LabelNetworkTransmit = []label.KeyValue{label.String("direction", "transmit")}
    	LabelNetworkReceive  = []label.KeyValue{label.String("direction", "receive")}
    )

    Functions

    func Start

    func Start(opts ...Option) error

      Start initializes reporting of host metrics using the supplied config.

      Types

      type Option

      type Option interface {
      	// ApplyHost updates *config.
      	ApplyHost(*config)
      }

        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.

          Source Files