metrics

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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,
) (*MeterProvider, error)

func (*MeterProvider) Shutdown

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

Jump to

Keyboard shortcuts

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