native

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package native provides a simple meter system for metrics. The metrics are aggregated by the meter provider.

Package native provides a simple meter system for metrics. The metrics are aggregated by the meter provider.

Package native provides a simple meter system for metrics. The metrics are aggregated by the meter provider.

Package native provides a simple meter system for metrics. The metrics are aggregated by the meter provider.

Index

Constants

View Source
const (
	// ObservabilityGroupName is the native observability group name.
	ObservabilityGroupName = "_monitoring"
)

Variables

This section is empty.

Functions

func InitSchema added in v0.10.0

func InitSchema(ctx context.Context, p meter.Provider)

InitSchema creates the native observability group and all pending measures for the given provider. It should be called after the metadata service is ready (during Serve phase).

func NewProvider

func NewProvider(scope meter.Scope, metadata metadata.Repo, nodeInfo NodeInfo) meter.Provider

NewProvider returns a native metrics Provider.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter is the native implementation of meter.Counter.

func (Counter) Collect

func (n Counter) Collect() (string, []metricWithLabelValues)

func (Counter) Delete

func (n Counter) Delete(labelValues ...string) bool

func (Counter) Inc

func (n Counter) Inc(delta float64, labelValues ...string)

type Gauge

type Gauge struct {
	// contains filtered or unexported fields
}

Gauge is the native implementation of meter.Gauge.

func (*Gauge) Add

func (g *Gauge) Add(delta float64, labelValues ...string)

Add Metric Value in Gauge.

func (Gauge) Collect

func (n Gauge) Collect() (string, []metricWithLabelValues)

func (Gauge) Delete

func (n Gauge) Delete(labelValues ...string) bool

func (Gauge) Inc

func (n Gauge) Inc(delta float64, labelValues ...string)

func (*Gauge) Set

func (g *Gauge) Set(value float64, labelValues ...string)

Set Metric Value in Gauge.

type Histogram

type Histogram struct {
	// contains filtered or unexported fields
}

Histogram is the native implementation of meter.Histogram.

func (Histogram) Collect

func (n Histogram) Collect() (string, []metricWithLabelValues)

func (Histogram) Delete

func (n Histogram) Delete(labelValues ...string) bool

func (Histogram) Inc

func (n Histogram) Inc(delta float64, labelValues ...string)

func (*Histogram) Observe

func (h *Histogram) Observe(_ float64, _ ...string)

Observe to be implemented.

type MetricCollection

type MetricCollection struct {
	// contains filtered or unexported fields
}

MetricCollection contains all the native implementations of metrics.

func NewMetricsCollection

func NewMetricsCollection(pipeline queue.Client, nodeSelector NodeSelector) *MetricCollection

NewMetricsCollection creates a new MetricCollection.

func (*MetricCollection) AddCollector

func (m *MetricCollection) AddCollector(c collector)

AddCollector Add native metric to MetricCollection.

func (*MetricCollection) FlushMetrics

func (m *MetricCollection) FlushMetrics()

FlushMetrics write all the metrics by flushing.

type NodeInfo

type NodeInfo struct {
	Type        string
	NodeID      string
	GrpcAddress string
	HTTPAddress string
}

NodeInfo is the struct that contains information used in native observability mode.

type NodeSelector

type NodeSelector interface {
	Locate(group, name string, shardID, replicaID uint32) (string, error)
	fmt.Stringer
}

NodeSelector has Locate method to select a nodeId.

Jump to

Keyboard shortcuts

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