runtime

package module
v0.0.0-...-1e3363d Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package runtime implements the conventional runtime metrics specified by OpenTelemetry.

The metric events produced are:

runtime.go.cgo.calls         -          Number of cgo calls made by the current process
runtime.go.gc.count          -          Number of completed garbage collection cycles
runtime.go.gc.pause_ns       (ns)       Amount of nanoseconds in GC stop-the-world pauses
runtime.go.gc.pause_total_ns (ns)       Cumulative nanoseconds in GC stop-the-world pauses since the program started
runtime.go.goroutines        -          Number of goroutines that currently exist
runtime.go.lookups           -          Number of pointer lookups performed by the runtime
runtime.go.mem.heap_alloc    (bytes)    Bytes of allocated heap objects
runtime.go.mem.heap_idle     (bytes)    Bytes in idle (unused) spans
runtime.go.mem.heap_inuse    (bytes)    Bytes in in-use spans
runtime.go.mem.heap_objects  -          Number of allocated heap objects
runtime.go.mem.heap_released (bytes)    Bytes of idle spans whose physical memory has been returned to the OS
runtime.go.mem.heap_sys      (bytes)    Bytes of heap memory obtained from the OS
runtime.go.mem.live_objects  -          Number of live objects is the number of cumulative Mallocs - Frees
runtime.uptime               (ms)       Milliseconds since application was initialized

Index

Constants

View Source
const DefaultMinimumReadMemStatsInterval time.Duration = 15 * time.Second

DefaultMinimumReadMemStatsInterval is the default minimum interval between calls to runtime.ReadMemStats(). Use the WithMinimumReadMemStatsInterval() option to modify this setting in Start().

View Source
const ScopeName = "github.com/dillonstreator/opentelemetry-go-contrib/instrumentation/runtime"

ScopeName is the instrumentation scope name.

Variables

This section is empty.

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 runtime metrics using the supplied config.

func Version

func Version() string

Version is the current release version of the runtime instrumentation.

Types

type Option

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

Option supports configuring optional settings for runtime 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.

func WithMinimumReadMemStatsInterval

func WithMinimumReadMemStatsInterval(d time.Duration) Option

WithMinimumReadMemStatsInterval sets a minimum interval between calls to runtime.ReadMemStats(), which is a relatively expensive call to make frequently. This setting is ignored when `d` is negative.

Jump to

Keyboard shortcuts

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