instrumentation

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName is our service name in external tracing and metrics services.
	ServiceName = "nri-resource-policy"
)

Variables

View Source
var (

	// Attribute allows setting up identity without an import of tracing.
	Attribute = tracing.Attribute
)

Functions

func GetHTTPMux

func GetHTTPMux() *http.ServeMux

GetHTTPMux returns our HTTP request mux for external services.

func RegisterGatherer

func RegisterGatherer(g promcli.Gatherer)

RegisterGatherer registers a prometheus metrics gatherer.

func Restart

func Restart() error

Restart our internal instrumentation services.

func SetIdentity

func SetIdentity(attrs ...KeyValue)

SetIdentity sets (extra) process identity attributes for tracing.

func Start

func Start() error

Start our internal instrumentation services.

func Stop

func Stop()

Stop our internal instrumentation services.

Types

type KeyValue

type KeyValue = tracing.KeyValue

type Sampling

type Sampling float64

Sampling defines how often trace samples are taken.

const (
	// Disabled is the sampling ratio to disable tracing altogether.
	Disabled Sampling = 0.0
	// Production is the sampling ratio for production environments.
	Production Sampling = 0.1
	// Testing is the sampling ration for test environments.
	Testing Sampling = 1.0
)

func (Sampling) MarshalJSON

func (s Sampling) MarshalJSON() ([]byte, error)

MarshalJSON is the JSON marshaller for Sampling values.

func (*Sampling) Parse

func (s *Sampling) Parse(value string) error

Parse parses the given string to a Sampling value.

func (Sampling) Ratio

func (s Sampling) Ratio() float64

Ratio returns the sampling ratio for the Sampling value.

func (Sampling) String

func (s Sampling) String() string

String returns the Sampling value as a string.

func (*Sampling) UnmarshalJSON

func (s *Sampling) UnmarshalJSON(raw []byte) error

UnmarshalJSON is the JSON unmarshaller for Sampling values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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