package goconv

import "go.opentelemetry.io/otel/semconv/v1.38.0/goconv"

Package goconv provides types and functionality for OpenTelemetry semantic conventions in the "go" namespace.

Index

Types

type ConfigGogc

type ConfigGogc struct {
	metric.Int64ObservableUpDownCounter
}

ConfigGogc is an instrument used to record metric values conforming to the "go.config.gogc" semantic conventions. It represents the heap size target percentage configured by the user, otherwise 100.

func NewConfigGogc

NewConfigGogc returns a new ConfigGogc instrument.

func (ConfigGogc) Description

func (ConfigGogc) Description() string

Description returns the semantic convention description of the instrument

func (ConfigGogc) Inst

Inst returns the underlying metric instrument.

func (ConfigGogc) Name

func (ConfigGogc) Name() string

Name returns the semantic convention name of the instrument.

func (ConfigGogc) Unit

func (ConfigGogc) Unit() string

Unit returns the semantic convention unit of the instrument

type GoroutineCount

type GoroutineCount struct {
	metric.Int64ObservableUpDownCounter
}

GoroutineCount is an instrument used to record metric values conforming to the "go.goroutine.count" semantic conventions. It represents the count of live goroutines.

func NewGoroutineCount

func NewGoroutineCount(
	m metric.Meter,
	opt ...metric.Int64ObservableUpDownCounterOption,
) (GoroutineCount, error)

NewGoroutineCount returns a new GoroutineCount instrument.

func (GoroutineCount) Description

func (GoroutineCount) Description() string

Description returns the semantic convention description of the instrument

func (GoroutineCount) Inst

Inst returns the underlying metric instrument.

func (GoroutineCount) Name

func (GoroutineCount) Name() string

Name returns the semantic convention name of the instrument.

func (GoroutineCount) Unit

func (GoroutineCount) Unit() string

Unit returns the semantic convention unit of the instrument

type MemoryAllocated

type MemoryAllocated struct {
	metric.Int64ObservableCounter
}

MemoryAllocated is an instrument used to record metric values conforming to the "go.memory.allocated" semantic conventions. It represents the memory allocated to the heap by the application.

func NewMemoryAllocated

func NewMemoryAllocated(
	m metric.Meter,
	opt ...metric.Int64ObservableCounterOption,
) (MemoryAllocated, error)

NewMemoryAllocated returns a new MemoryAllocated instrument.

func (MemoryAllocated) Description

func (MemoryAllocated) Description() string

Description returns the semantic convention description of the instrument

func (MemoryAllocated) Inst

Inst returns the underlying metric instrument.

func (MemoryAllocated) Name

func (MemoryAllocated) Name() string

Name returns the semantic convention name of the instrument.

func (MemoryAllocated) Unit

func (MemoryAllocated) Unit() string

Unit returns the semantic convention unit of the instrument

type MemoryAllocations

type MemoryAllocations struct {
	metric.Int64ObservableCounter
}

MemoryAllocations is an instrument used to record metric values conforming to the "go.memory.allocations" semantic conventions. It represents the count of allocations to the heap by the application.

func NewMemoryAllocations

func NewMemoryAllocations(
	m metric.Meter,
	opt ...metric.Int64ObservableCounterOption,
) (MemoryAllocations, error)

NewMemoryAllocations returns a new MemoryAllocations instrument.

func (MemoryAllocations) Description

func (MemoryAllocations) Description() string

Description returns the semantic convention description of the instrument

func (MemoryAllocations) Inst

Inst returns the underlying metric instrument.

func (MemoryAllocations) Name

func (MemoryAllocations) Name() string

Name returns the semantic convention name of the instrument.

func (MemoryAllocations) Unit

func (MemoryAllocations) Unit() string

Unit returns the semantic convention unit of the instrument

type MemoryGCGoal

type MemoryGCGoal struct {
	metric.Int64ObservableUpDownCounter
}

MemoryGCGoal is an instrument used to record metric values conforming to the "go.memory.gc.goal" semantic conventions. It represents the heap size target for the end of the GC cycle.

func NewMemoryGCGoal

NewMemoryGCGoal returns a new MemoryGCGoal instrument.

func (MemoryGCGoal) Description

func (MemoryGCGoal) Description() string

Description returns the semantic convention description of the instrument

func (MemoryGCGoal) Inst

Inst returns the underlying metric instrument.

func (MemoryGCGoal) Name

func (MemoryGCGoal) Name() string

Name returns the semantic convention name of the instrument.

func (MemoryGCGoal) Unit

func (MemoryGCGoal) Unit() string

Unit returns the semantic convention unit of the instrument

type MemoryLimit

type MemoryLimit struct {
	metric.Int64ObservableUpDownCounter
}

MemoryLimit is an instrument used to record metric values conforming to the "go.memory.limit" semantic conventions. It represents the go runtime memory limit configured by the user, if a limit exists.

func NewMemoryLimit

NewMemoryLimit returns a new MemoryLimit instrument.

func (MemoryLimit) Description

func (MemoryLimit) Description() string

Description returns the semantic convention description of the instrument

func (MemoryLimit) Inst

Inst returns the underlying metric instrument.

func (MemoryLimit) Name

func (MemoryLimit) Name() string

Name returns the semantic convention name of the instrument.

func (MemoryLimit) Unit

func (MemoryLimit) Unit() string

Unit returns the semantic convention unit of the instrument

type MemoryTypeAttr

type MemoryTypeAttr string

MemoryTypeAttr is an attribute conforming to the go.memory.type semantic conventions. It represents the type of memory.

var (
	// MemoryTypeStack is the memory allocated from the heap that is reserved for
	// stack space, whether or not it is currently in-use.
	MemoryTypeStack MemoryTypeAttr = "stack"
	// MemoryTypeOther is the memory used by the Go runtime, excluding other
	// categories of memory usage described in this enumeration.
	MemoryTypeOther MemoryTypeAttr = "other"
)

type MemoryUsed

type MemoryUsed struct {
	metric.Int64ObservableUpDownCounter
}

MemoryUsed is an instrument used to record metric values conforming to the "go.memory.used" semantic conventions. It represents the memory used by the Go runtime.

func NewMemoryUsed

NewMemoryUsed returns a new MemoryUsed instrument.

func (MemoryUsed) AttrMemoryType

func (MemoryUsed) AttrMemoryType(val MemoryTypeAttr) attribute.KeyValue

AttrMemoryType returns an optional attribute for the "go.memory.type" semantic convention. It represents the type of memory.

func (MemoryUsed) Description

func (MemoryUsed) Description() string

Description returns the semantic convention description of the instrument

func (MemoryUsed) Inst

Inst returns the underlying metric instrument.

func (MemoryUsed) Name

func (MemoryUsed) Name() string

Name returns the semantic convention name of the instrument.

func (MemoryUsed) Unit

func (MemoryUsed) Unit() string

Unit returns the semantic convention unit of the instrument

type ProcessorLimit

type ProcessorLimit struct {
	metric.Int64ObservableUpDownCounter
}

ProcessorLimit is an instrument used to record metric values conforming to the "go.processor.limit" semantic conventions. It represents the number of OS threads that can execute user-level Go code simultaneously.

func NewProcessorLimit

func NewProcessorLimit(
	m metric.Meter,
	opt ...metric.Int64ObservableUpDownCounterOption,
) (ProcessorLimit, error)

NewProcessorLimit returns a new ProcessorLimit instrument.

func (ProcessorLimit) Description

func (ProcessorLimit) Description() string

Description returns the semantic convention description of the instrument

func (ProcessorLimit) Inst

Inst returns the underlying metric instrument.

func (ProcessorLimit) Name

func (ProcessorLimit) Name() string

Name returns the semantic convention name of the instrument.

func (ProcessorLimit) Unit

func (ProcessorLimit) Unit() string

Unit returns the semantic convention unit of the instrument

type ScheduleDuration

type ScheduleDuration struct {
	metric.Float64Histogram
}

ScheduleDuration is an instrument used to record metric values conforming to the "go.schedule.duration" semantic conventions. It represents the time goroutines have spent in the scheduler in a runnable state before actually running.

func NewScheduleDuration

func NewScheduleDuration(
	m metric.Meter,
	opt ...metric.Float64HistogramOption,
) (ScheduleDuration, error)

NewScheduleDuration returns a new ScheduleDuration instrument.

func (ScheduleDuration) Description

func (ScheduleDuration) Description() string

Description returns the semantic convention description of the instrument

func (ScheduleDuration) Inst

Inst returns the underlying metric instrument.

func (ScheduleDuration) Name

func (ScheduleDuration) Name() string

Name returns the semantic convention name of the instrument.

func (ScheduleDuration) Record

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

Record records val to the current distribution for attrs.

Computed from `/sched/latencies:seconds`. Bucket boundaries are provided by the runtime, and are subject to change.

func (ScheduleDuration) RecordSet

func (m ScheduleDuration) RecordSet(ctx context.Context, val float64, set attribute.Set)

RecordSet records val to the current distribution for set.

Computed from `/sched/latencies:seconds`. Bucket boundaries are provided by the runtime, and are subject to change.

func (ScheduleDuration) Unit

func (ScheduleDuration) Unit() string

Unit returns the semantic convention unit of the instrument

Source Files

metric.go

Version
v1.41.0
Published
Mar 2, 2026
Platform
linux/amd64
Imports
5 packages
Last checked
1 hour ago

Tools for package owners.