Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

processconv

v1.47.0
go.opentelemetry.io/otel/semconv/v1.33.0/processconv

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

104 matches

Top ↑

Package processconv provides types and functionality for OpenTelemetry semantic conventions in the "process" namespace.

Types

CPUModeAttr

type CPUModeAttr string

CPUModeAttr is an attribute conforming to the cpu.mode semantic conventions. It represents a process SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels.

CPUModeUser (8 declarations)

var (
	// CPUModeUser is the none.
	CPUModeUser CPUModeAttr = "user"
	// CPUModeSystem is the none.
	CPUModeSystem CPUModeAttr = "system"
	// CPUModeNice is the none.
	CPUModeNice CPUModeAttr = "nice"
	// CPUModeIdle is the none.
	CPUModeIdle CPUModeAttr = "idle"
	// CPUModeIOWait is the none.
	CPUModeIOWait CPUModeAttr = "iowait"
	// CPUModeInterrupt is the none.
	CPUModeInterrupt CPUModeAttr = "interrupt"
	// CPUModeSteal is the none.
	CPUModeSteal CPUModeAttr = "steal"
	// CPUModeKernel is the none.
	CPUModeKernel CPUModeAttr = "kernel"
)

CPUTime

type CPUTime struct {
	metric.Float64ObservableCounter
}

CPUTime is an instrument used to record metric values conforming to the "process.cpu.time" semantic conventions. It represents the total CPU seconds broken down by different states.

NewCPUTime

func NewCPUTime(
	m metric.Meter,
	opt ...metric.Float64ObservableCounterOption,
) (CPUTime, error)

NewCPUTime returns a new CPUTime instrument.

CPUTime.AttrCPUMode

func (CPUTime) AttrCPUMode(val CPUModeAttr) attribute.KeyValue

AttrCPUMode returns an optional attribute for the "cpu.mode" semantic convention. It represents a process SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels.

CPUTime.Description

func (CPUTime) Description() string

Description returns the semantic convention description of the instrument

CPUTime.Inst

func (m CPUTime) Inst() metric.Float64ObservableCounter

Inst returns the underlying metric instrument.

CPUTime.Name

func (CPUTime) Name() string

Name returns the semantic convention name of the instrument.

CPUTime.Unit

func (CPUTime) Unit() string

Unit returns the semantic convention unit of the instrument

CPUUtilization

type CPUUtilization struct {
	metric.Int64Gauge
}

CPUUtilization is an instrument used to record metric values conforming to the "process.cpu.utilization" semantic conventions. It represents the difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.

NewCPUUtilization

func NewCPUUtilization(
	m metric.Meter,
	opt ...metric.Int64GaugeOption,
) (CPUUtilization, error)

NewCPUUtilization returns a new CPUUtilization instrument.

CPUUtilization.AttrCPUMode

func (CPUUtilization) AttrCPUMode(val CPUModeAttr) attribute.KeyValue

AttrCPUMode returns an optional attribute for the "cpu.mode" semantic convention. It represents a process SHOULD be characterized *either* by data points with no `mode` labels, *or only* data points with `mode` labels.

CPUUtilization.Description

func (CPUUtilization) Description() string

Description returns the semantic convention description of the instrument

CPUUtilization.Inst

func (m CPUUtilization) Inst() metric.Int64Gauge

Inst returns the underlying metric instrument.

CPUUtilization.Name

func (CPUUtilization) Name() string

Name returns the semantic convention name of the instrument.

CPUUtilization.Record

func (m CPUUtilization) Record(
	ctx context.Context,
	val int64,
	attrs ...attribute.KeyValue,
)

Record records val to the current distribution.

All additional attrs passed are included in the recorded value.

CPUUtilization.Unit

func (CPUUtilization) Unit() string

Unit returns the semantic convention unit of the instrument

ContextSwitchTypeAttr

type ContextSwitchTypeAttr string

ContextSwitchTypeAttr is an attribute conforming to the process.context_switch_type semantic conventions. It represents the specifies whether the context switches for this data point were voluntary or involuntary.

ContextSwitchTypeVoluntary (2 declarations)

var (
	// ContextSwitchTypeVoluntary is the none.
	ContextSwitchTypeVoluntary ContextSwitchTypeAttr = "voluntary"
	// ContextSwitchTypeInvoluntary is the none.
	ContextSwitchTypeInvoluntary ContextSwitchTypeAttr = "involuntary"
)

ContextSwitches

type ContextSwitches struct {
	metric.Int64Counter
}

ContextSwitches is an instrument used to record metric values conforming to the "process.context_switches" semantic conventions. It represents the number of times the process has been context switched.

NewContextSwitches

func NewContextSwitches(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (ContextSwitches, error)

NewContextSwitches returns a new ContextSwitches instrument.

ContextSwitches.Add

func (m ContextSwitches) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

ContextSwitches.AttrContextSwitchType

func (ContextSwitches) AttrContextSwitchType(val ContextSwitchTypeAttr) attribute.KeyValue

AttrContextSwitchType returns an optional attribute for the "process.context_switch_type" semantic convention. It represents the specifies whether the context switches for this data point were voluntary or involuntary.

ContextSwitches.Description

func (ContextSwitches) Description() string

Description returns the semantic convention description of the instrument

ContextSwitches.Inst

func (m ContextSwitches) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

ContextSwitches.Name

func (ContextSwitches) Name() string

Name returns the semantic convention name of the instrument.

ContextSwitches.Unit

func (ContextSwitches) Unit() string

Unit returns the semantic convention unit of the instrument

DiskIO

type DiskIO struct {
	metric.Int64Counter
}

DiskIO is an instrument used to record metric values conforming to the "process.disk.io" semantic conventions. It represents the disk bytes transferred.

NewDiskIO

func NewDiskIO(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (DiskIO, error)

NewDiskIO returns a new DiskIO instrument.

DiskIO.Add

func (m DiskIO) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

DiskIO.AttrDiskIODirection

func (DiskIO) AttrDiskIODirection(val DiskIODirectionAttr) attribute.KeyValue

AttrDiskIODirection returns an optional attribute for the "disk.io.direction" semantic convention. It represents the disk IO operation direction.

DiskIO.Description

func (DiskIO) Description() string

Description returns the semantic convention description of the instrument

DiskIO.Inst

func (m DiskIO) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

DiskIO.Name

func (DiskIO) Name() string

Name returns the semantic convention name of the instrument.

DiskIO.Unit

func (DiskIO) Unit() string

Unit returns the semantic convention unit of the instrument

DiskIODirectionAttr

type DiskIODirectionAttr string

DiskIODirectionAttr is an attribute conforming to the disk.io.direction semantic conventions. It represents the disk IO operation direction.

DiskIODirectionRead (2 declarations)

var (
	// DiskIODirectionRead is the none.
	DiskIODirectionRead DiskIODirectionAttr = "read"
	// DiskIODirectionWrite is the none.
	DiskIODirectionWrite DiskIODirectionAttr = "write"
)

MemoryUsage

type MemoryUsage struct {
	metric.Int64UpDownCounter
}

MemoryUsage is an instrument used to record metric values conforming to the "process.memory.usage" semantic conventions. It represents the amount of physical memory in use.

NewMemoryUsage

func NewMemoryUsage(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (MemoryUsage, error)

NewMemoryUsage returns a new MemoryUsage instrument.

MemoryUsage.Add

func (m MemoryUsage) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

Add adds incr to the existing count.

MemoryUsage.Description

func (MemoryUsage) Description() string

Description returns the semantic convention description of the instrument

MemoryUsage.Inst

func (m MemoryUsage) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

MemoryUsage.Name

func (MemoryUsage) Name() string

Name returns the semantic convention name of the instrument.

MemoryUsage.Unit

func (MemoryUsage) Unit() string

Unit returns the semantic convention unit of the instrument

MemoryVirtual

type MemoryVirtual struct {
	metric.Int64UpDownCounter
}

MemoryVirtual is an instrument used to record metric values conforming to the "process.memory.virtual" semantic conventions. It represents the amount of committed virtual memory.

NewMemoryVirtual

func NewMemoryVirtual(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (MemoryVirtual, error)

NewMemoryVirtual returns a new MemoryVirtual instrument.

MemoryVirtual.Add

func (m MemoryVirtual) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

Add adds incr to the existing count.

MemoryVirtual.Description

func (MemoryVirtual) Description() string

Description returns the semantic convention description of the instrument

MemoryVirtual.Inst

func (m MemoryVirtual) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

MemoryVirtual.Name

func (MemoryVirtual) Name() string

Name returns the semantic convention name of the instrument.

MemoryVirtual.Unit

func (MemoryVirtual) Unit() string

Unit returns the semantic convention unit of the instrument

NetworkIO

type NetworkIO struct {
	metric.Int64Counter
}

NetworkIO is an instrument used to record metric values conforming to the "process.network.io" semantic conventions. It represents the network bytes transferred.

NewNetworkIO

func NewNetworkIO(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (NetworkIO, error)

NewNetworkIO returns a new NetworkIO instrument.

NetworkIO.Add

func (m NetworkIO) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

NetworkIO.AttrNetworkIODirection

func (NetworkIO) AttrNetworkIODirection(val NetworkIODirectionAttr) attribute.KeyValue

AttrNetworkIODirection returns an optional attribute for the "network.io.direction" semantic convention. It represents the network IO operation direction.

NetworkIO.Description

func (NetworkIO) Description() string

Description returns the semantic convention description of the instrument

NetworkIO.Inst

func (m NetworkIO) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

NetworkIO.Name

func (NetworkIO) Name() string

Name returns the semantic convention name of the instrument.

NetworkIO.Unit

func (NetworkIO) Unit() string

Unit returns the semantic convention unit of the instrument

NetworkIODirectionAttr

type NetworkIODirectionAttr string

NetworkIODirectionAttr is an attribute conforming to the network.io.direction semantic conventions. It represents the network IO operation direction.

NetworkIODirectionTransmit (2 declarations)

var (
	// NetworkIODirectionTransmit is the none.
	NetworkIODirectionTransmit NetworkIODirectionAttr = "transmit"
	// NetworkIODirectionReceive is the none.
	NetworkIODirectionReceive NetworkIODirectionAttr = "receive"
)

OpenFileDescriptorCount

type OpenFileDescriptorCount struct {
	metric.Int64UpDownCounter
}

OpenFileDescriptorCount is an instrument used to record metric values conforming to the "process.open_file_descriptor.count" semantic conventions. It represents the number of file descriptors in use by the process.

NewOpenFileDescriptorCount

func NewOpenFileDescriptorCount(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (OpenFileDescriptorCount, error)

NewOpenFileDescriptorCount returns a new OpenFileDescriptorCount instrument.

OpenFileDescriptorCount.Add

func (m OpenFileDescriptorCount) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

Add adds incr to the existing count.

OpenFileDescriptorCount.Description

func (OpenFileDescriptorCount) Description() string

Description returns the semantic convention description of the instrument

OpenFileDescriptorCount.Inst

func (m OpenFileDescriptorCount) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

OpenFileDescriptorCount.Name

func (OpenFileDescriptorCount) Name() string

Name returns the semantic convention name of the instrument.

OpenFileDescriptorCount.Unit

func (OpenFileDescriptorCount) Unit() string

Unit returns the semantic convention unit of the instrument

PagingFaultTypeAttr

type PagingFaultTypeAttr string

PagingFaultTypeAttr is an attribute conforming to the process.paging.fault_type semantic conventions. It represents the type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults.

PagingFaultTypeMajor (2 declarations)

var (
	// PagingFaultTypeMajor is the none.
	PagingFaultTypeMajor PagingFaultTypeAttr = "major"
	// PagingFaultTypeMinor is the none.
	PagingFaultTypeMinor PagingFaultTypeAttr = "minor"
)

PagingFaults

type PagingFaults struct {
	metric.Int64Counter
}

PagingFaults is an instrument used to record metric values conforming to the "process.paging.faults" semantic conventions. It represents the number of page faults the process has made.

NewPagingFaults

func NewPagingFaults(
	m metric.Meter,
	opt ...metric.Int64CounterOption,
) (PagingFaults, error)

NewPagingFaults returns a new PagingFaults instrument.

PagingFaults.Add

func (m PagingFaults) Add(
	ctx context.Context,
	incr int64,
	attrs ...attribute.KeyValue,
)

Add adds incr to the existing count.

All additional attrs passed are included in the recorded value.

PagingFaults.AttrPagingFaultType

func (PagingFaults) AttrPagingFaultType(val PagingFaultTypeAttr) attribute.KeyValue

AttrPagingFaultType returns an optional attribute for the "process.paging.fault_type" semantic convention. It represents the type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults.

PagingFaults.Description

func (PagingFaults) Description() string

Description returns the semantic convention description of the instrument

PagingFaults.Inst

func (m PagingFaults) Inst() metric.Int64Counter

Inst returns the underlying metric instrument.

PagingFaults.Name

func (PagingFaults) Name() string

Name returns the semantic convention name of the instrument.

PagingFaults.Unit

func (PagingFaults) Unit() string

Unit returns the semantic convention unit of the instrument

ThreadCount

type ThreadCount struct {
	metric.Int64UpDownCounter
}

ThreadCount is an instrument used to record metric values conforming to the "process.thread.count" semantic conventions. It represents the process threads count.

NewThreadCount

func NewThreadCount(
	m metric.Meter,
	opt ...metric.Int64UpDownCounterOption,
) (ThreadCount, error)

NewThreadCount returns a new ThreadCount instrument.

ThreadCount.Add

func (m ThreadCount) Add(ctx context.Context, incr int64, attrs ...attribute.KeyValue)

Add adds incr to the existing count.

ThreadCount.Description

func (ThreadCount) Description() string

Description returns the semantic convention description of the instrument

ThreadCount.Inst

func (m ThreadCount) Inst() metric.Int64UpDownCounter

Inst returns the underlying metric instrument.

ThreadCount.Name

func (ThreadCount) Name() string

Name returns the semantic convention name of the instrument.

ThreadCount.Unit

func (ThreadCount) Unit() string

Unit returns the semantic convention unit of the instrument

Uptime

type Uptime struct {
	metric.Float64Gauge
}

Uptime is an instrument used to record metric values conforming to the "process.uptime" semantic conventions. It represents the time the process has been running.

NewUptime

func NewUptime(
	m metric.Meter,
	opt ...metric.Float64GaugeOption,
) (Uptime, error)

NewUptime returns a new Uptime instrument.

Uptime.Description

func (Uptime) Description() string

Description returns the semantic convention description of the instrument

Uptime.Inst

func (m Uptime) Inst() metric.Float64Gauge

Inst returns the underlying metric instrument.

Uptime.Name

func (Uptime) Name() string

Name returns the semantic convention name of the instrument.

Uptime.Record

func (m Uptime) Record(ctx context.Context, val float64, attrs ...attribute.KeyValue)

Record records val to the current distribution.

Instrumentations SHOULD use a gauge with type `double` and measure uptime in seconds as a floating point number with the highest precision available. The actual accuracy would depend on the instrumentation and operating system.

Uptime.Unit

func (Uptime) Unit() string

Unit returns the semantic convention unit of the instrument

Dependency graph