prom

package
v0.0.0-...-c73473a Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpanMetricsLatency       = "traces_spanmetrics_latency"
	SpanMetricsLatencyOTel   = "traces_span_metrics_duration_seconds"
	SpanMetricsCalls         = "traces_spanmetrics_calls_total"
	SpanMetricsCallsOTel     = "traces_span_metrics_calls_total"
	SpanMetricsRequestSizes  = "traces_spanmetrics_size_total"
	SpanMetricsResponseSizes = "traces_spanmetrics_response_size_total"
	TracesTargetInfo         = "traces_target_info"
	TracesHostInfo           = "traces_host_info"
	TargetInfo               = "target_info"

	ServiceGraphClient = "traces_service_graph_request_client_seconds"
	ServiceGraphServer = "traces_service_graph_request_server_seconds"
	ServiceGraphFailed = "traces_service_graph_request_failed_total"
	ServiceGraphTotal  = "traces_service_graph_request_total"
)

using labels and names that are equivalent names to the OTEL attributes but following the different naming conventions

View Source
const (
	LanguageLabel = "target_lang"
)

metrics for telegen statistics

Variables

This section is empty.

Functions

func BPFMetrics

func BPFMetrics(
	ctxInfo *global.ContextInfo,
	cfg *PrometheusConfig,
	mpCfg *perapp.MetricsConfig,
) swarm.InstanceFunc

func NetPrometheusEndpoint

func NetPrometheusEndpoint(
	ctxInfo *global.ContextInfo,
	cfg *NetPrometheusConfig,
	input *msg.Queue[[]*ebpf.Record],
) swarm.InstanceFunc

func PrometheusEndpoint

func PrometheusEndpoint(
	ctxInfo *global.ContextInfo,
	cfg *PrometheusConfig,
	jointMetricsConfig *perapp.MetricsConfig,
	selectorCfg *attributes.SelectorConfig,
	unresolved request.UnresolvedNames,
	input *msg.Queue[[]request.Span],
	processEventCh *msg.Queue[exec.ProcessEvent],
) swarm.InstanceFunc

Types

type BPFCollector

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

BPFCollector implements prometheus.Collector for collecting metrics about currently loaded eBPF programs.

func (*BPFCollector) Collect

func (bc *BPFCollector) Collect(ch chan<- prometheus.Metric)

func (*BPFCollector) Describe

func (bc *BPFCollector) Describe(ch chan<- *prometheus.Desc)

type BPFProgram

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

type BpfMapMetrics

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

type Expirer

type Expirer[T prometheus.Metric] struct {
	// contains filtered or unexported fields
}

Expirer drops metrics from labels that haven't been updated during a given timeout

func NewExpirer

func NewExpirer[T prometheus.Metric](wrapped *prometheus.MetricVec, clock func() time.Time, expireTime time.Duration) *Expirer[T]

NewExpirer creates a metric that wraps a given CounterVec. Its labeled instances are dropped if they haven't been updated during the last timeout period

func (*Expirer[T]) Collect

func (ex *Expirer[T]) Collect(metrics chan<- prometheus.Metric)

Collect wraps prometheus.Collector Wrap method

func (*Expirer[T]) Describe

func (ex *Expirer[T]) Describe(descs chan<- *prometheus.Desc)

Describe wraps prometheus.Collector Describe method

func (*Expirer[T]) WithLabelValues

func (ex *Expirer[T]) WithLabelValues(lbls ...string) *MetricEntry[T]

WithLabelValues returns the Counter for the given slice of label values (same order as the variable labels in Desc). If that combination of label values is accessed for the first time, a new Counter is created. If not, a cached copy is returned and the "last access" cache time is updated.

type MetricEntry

type MetricEntry[T prometheus.Metric] struct {
	Metric    T
	LabelVals []string
}

type NetPrometheusConfig

type NetPrometheusConfig struct {
	Config      *PrometheusConfig
	SelectorCfg *attributes.SelectorConfig
	CommonCfg   *perapp.MetricsConfig
}

NetPrometheusConfig for network metrics just wraps the global prom.NetPrometheusConfig as provided by the user

func (NetPrometheusConfig) Enabled

func (p NetPrometheusConfig) Enabled() bool

Enabled returns whether the node needs to be activated

type ProbeMetrics

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

type PrometheusConfig

type PrometheusConfig struct {
	Port int    `yaml:"port" env:"OTEL_EBPF_PROMETHEUS_PORT"`
	Path string `yaml:"path" env:"OTEL_EBPF_PROMETHEUS_PATH"`

	DisableBuildInfo bool `yaml:"disable_build_info" env:"OTEL_EBPF_PROMETHEUS_DISABLE_BUILD_INFO"`

	// Features of metrics that can be exported. Accepted values: application, network,
	// application_span, application_service_graph, ...
	// Deprecated: use top-level MetricsConfig.Features instead.
	DeprFeatures export.Features `yaml:"features" env:"OTEL_EBPF_PROMETHEUS_FEATURES" envSeparator:","`

	// Allows configuration of which instrumentations should be enabled, e.g. http, grpc, sql...
	Instrumentations []instrumentations.Instrumentation `yaml:"instrumentations" env:"OTEL_EBPF_PROMETHEUS_INSTRUMENTATIONS" envSeparator:","`

	Buckets export.Buckets `yaml:"buckets"`

	// TTL is the time since a metric was updated for the last time until it is
	// removed from the metrics set.
	TTL                         time.Duration `yaml:"ttl" env:"OTEL_EBPF_PROMETHEUS_TTL"`
	SpanMetricsServiceCacheSize int           `yaml:"service_cache_size"`

	AllowServiceGraphSelfReferences bool `yaml:"allow_service_graph_self_references" env:"OTEL_EBPF_PROMETHEUS_ALLOW_SERVICE_GRAPH_SELF_REFERENCES"`

	// Registry is only used for embedding Beyla within the Grafana Agent.
	// It must be nil when Beyla runs as standalone
	Registry *prometheus.Registry `yaml:"-"`

	// ExtraResourceLabels adds extra metadata labels to Prometheus metrics from sources whose availability can't be known
	// beforehand. For example, to add the OTEL deployment.environment resource attribute as a Prometheus resource attribute,
	// you should add `deployment.environment`.
	ExtraResourceLabels []string `yaml:"extra_resource_attributes" env:"OTEL_EBPF_PROMETHEUS_EXTRA_RESOURCE_ATTRIBUTES" envSeparator:","`

	// ExtraSpanResourceLabels adds extra metadata labels to Prometheus span metrics from sources whose availability can't be known
	// beforehand. For example, to add the OTEL deployment.environment resource attribute as a Prometheus resource attribute,
	// you should add `deployment.environment`.
	ExtraSpanResourceLabels []string `yaml:"extra_span_resource_attributes" env:"OTEL_EBPF_PROMETHEUS_EXTRA_SPAN_RESOURCE_ATTRIBUTES" envSeparator:","`
}

TODO: TLS

func (*PrometheusConfig) EndpointEnabled

func (p *PrometheusConfig) EndpointEnabled() bool

Jump to

Keyboard shortcuts

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