metrics

package
v0.0.0-...-8c68e18 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 18 Imported by: 10

Documentation

Index

Constants

View Source
const (
	ProtocolGRPC         = "grpc"
	ProtocolHTTPProtobuf = "http/protobuf"
	ProtocolPrometheus   = "prometheus"
	ProtocolNone         = "none"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Protocol       string        `json:"protocol,omitempty"`
	Endpoint       string        `json:"endpoint,omitempty"`
	ExportInterval time.Duration `json:"exportInterval,omitempty"`
}

Config provides a unified observability configuration which can be used to manage Knative observability behavior. Typically, this is extracted from a Kubernetes ConfigMap during application startup, and accessed via the GetConfig() method.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a configuration with default values set.

func NewFromMap

func NewFromMap(m map[string]string) (Config, error)

NewFromMap unpacks flat configuration values from a ConfigMap into the configuration used by different observability modules.

func NewFromMapWithPrefix

func NewFromMapWithPrefix(prefix string, m map[string]string) (Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type MeterProvider

type MeterProvider struct {
	metric.MeterProvider
	// contains filtered or unexported fields
}

func NewMeterProvider

func NewMeterProvider(
	ctx context.Context,
	cfg Config,
	opts ...sdkmetric.Option,
) (*MeterProvider, error)

func (*MeterProvider) Shutdown

func (m *MeterProvider) Shutdown(ctx context.Context) error

Directories

Path Synopsis
Package metricstest provides test helpers to assert OTel metrics are recorded properly.
Package metricstest provides test helpers to assert OTel metrics are recorded properly.

Jump to

Keyboard shortcuts

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