metrics

package
v0.9.2 Latest Latest
Warning

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

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

README

Metrics Data Source

Type: metrics-data-source

[!NOTE] This plugin is enabled by default together with core-metrics-extractor. You do not need to explicitly declare it in your configuration, but it can be disabled if metrics collection is unnecessary.

The Metrics Data Source is a data layer plugin that polls a Prometheus-compatible metrics endpoint of a model server and parses the response into a structured format for extraction.

What it does

  1. Periodically (or when triggered) performs an HTTP GET request to a configured metrics endpoint (e.g., http://<endpoint-ip>:8080/metrics).
  2. Parses the Prometheus text format response into a PrometheusMetricMap.
  3. Provides the parsed metrics to any registered extractors (like the core-metrics-extractor).

Outputs produced

  • PrometheusMetricType: A map where keys are metric names and values are Prometheus MetricFamily objects.

Configuration

The plugin config supports:

  • scheme (default "http"): The protocol scheme to use for metrics retrieval.
  • path (default "/metrics"): The URL path to use for metrics retrieval.
  • insecureSkipVerify (default true): Whether to skip TLS certificate verification when using the "https" scheme.
Example Configuration
type: metrics-data-source
parameters:
  scheme: "http"
  path: "/metrics"
  insecureSkipVerify: true

Documentation

Index

Constants

View Source
const MetricsDataSourceType = "metrics-data-source"

Variables

This section is empty.

Functions

func MetricsDataSourceFactory

func MetricsDataSourceFactory(name string, parameters *json.Decoder, handle fwkplugin.Handle) (fwkplugin.Plugin, error)

MetricsDataSourceFactory is a factory function used to instantiate data layer's metrics data source plugins specified in a configuration.

func NewHTTPMetricsDataSource

func NewHTTPMetricsDataSource(scheme, path, name string) (*http.HTTPDataSource[PrometheusMetricMap], error)

NewHTTPMetricsDataSource constructs a MetricsDataSource with the given scheme and path. InsecureSkipVerify defaults to true (matching the factory default). Use this function directly in tests to bypass JSON parameter marshaling.

Types

type PrometheusMetricMap

type PrometheusMetricMap = map[string]*dto.MetricFamily

PrometheusMetricMap is the parsed metric-families map produced by parseMetrics.

Jump to

Keyboard shortcuts

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