prometheusremotewritereceiver

package module
v0.128.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: Apache-2.0 Imports: 26 Imported by: 2

README

Prometheus Remote Write Receiver

Status
Stability development: metrics
Distributions []
Issues Open issues Closed issues
Code coverage codecov
Code Owners @dashpole, @ArthurSens, @perebaj

Resource Metrics Cache

target_info metrics and "normal" metrics are a match when they have the same job/instance labels (Please read the specification for more details). But these metrics do not always come in the same Remote-Write request. For this reason, the receiver uses an internal LRU (Least Recently Used) and stateless cache implementation to store resource metrics across requests.

The cleanup is based on a maximum size of 1000 resource metrics, and it will be cleaned when the limit is reached, cleaning the less recently used resource metrics.

This approach has some limitations, for example: - If the process dies or restarts, the cache will be lost. - Some inconsistencies can happen according to the order of the requests and the current cache size. - The limit of 1000 resource metrics is hardcoded and not configurable for now.

Documentation

Overview

Copyright The OpenTelemetry Authors SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a new Prometheus receiver factory.

Types

type Config

type Config struct {
	confighttp.ServerConfig `mapstructure:",squash"`
}

Config holds common fields and embedded protocol-specific configurations

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks the receiver configuration is valid

type MetricIdentity added in v0.123.0

type MetricIdentity struct {
	ResourceID   string
	ScopeName    string
	ScopeVersion string
	MetricName   string
	Unit         string
	Type         writev2.Metadata_MetricType
}

MetricIdentity contains all the components that uniquely identify a metric according to the OpenTelemetry Protocol data model. The definition of the metric uniqueness is based on the following document. Ref: https://opentelemetry.io/docs/specs/otel/metrics/data-model/#opentelemetry-protocol-data-model

func (MetricIdentity) Hash added in v0.123.0

func (mi MetricIdentity) Hash() uint64

Hash generates a unique hash for the metric identity

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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