prom

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 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 added in v1.6.0

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

func Scrape added in v1.6.0

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