prom

package
v2.0.3-alloy Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package prom provides some convenience functions for prometheus handling in integration tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HostPort string
}

func (*Client) Query

func (c *Client) Query(promQL string) ([]Result, error)

type Result

type Result struct {
	Metric map[string]string `json:"metric"`
	Value  []interface{}
}

Result structure assumes that resultType is always == "vector"

type ScrapedMetric

type ScrapedMetric struct {
	Name   string
	Value  float64
	Labels map[string]string
}

func Scrape

func Scrape(metricsURL string) ([]ScrapedMetric, error)

Scrape implements a simple, synchronous, validation-oriented (non-error-prone) scrape of Prometheus metrics towards a /metrics HTTP endpoint

Jump to

Keyboard shortcuts

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