grafana

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGrafanaBaseURL   = "https://grafana.observability.ethpandaops.io"
	DefaultPromDatasourceID = "UhcO3vy7z"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Query executes a Grafana query.
	Query(ctx context.Context, query string) (*QueryResponse, error)
	// GetBaseURL returns the base URL of the Grafana instance.
	GetBaseURL() string
}

Client is the interface for Grafana operations.

func NewClient

func NewClient(cfg *Config, httpClient *http.Client) Client

NewClient creates a new Grafana client. For metrics tracking, pass an HTTP client that is wrapped by http.ClientWrapper.

type Config added in v0.0.11

type Config struct {
	Token            string
	PromDatasourceID string
	BaseURL          string
}

Config contains the configuration for the Grafana client.

type QueryData added in v0.0.3

type QueryData struct {
	Values []interface{} `json:"values"`
}

QueryData represents the data in the Grafana response.

type QueryField added in v0.0.3

type QueryField struct {
	Labels map[string]string `json:"labels"`
}

QueryField represents a field in the Grafana response.

type QueryFrame added in v0.0.3

type QueryFrame struct {
	Schema QuerySchema `json:"schema"`
	Data   QueryData   `json:"data"`
}

QueryFrame represents a frame in the Grafana response.

type QueryPandaPulse added in v0.0.3

type QueryPandaPulse struct {
	Frames []QueryFrame `json:"frames"`
}

QueryPandaPulse represents the PandaPulse section in the Grafana response.

type QueryResponse

type QueryResponse struct {
	Results QueryResults `json:"results"`
}

QueryResponse is the response from a Grafana query.

type QueryResults added in v0.0.3

type QueryResults struct {
	PandaPulse QueryPandaPulse `json:"pandaPulse"`
}

QueryResults represents the results in the Grafana response.

type QuerySchema added in v0.0.3

type QuerySchema struct {
	Fields []QueryField `json:"fields"`
}

QuerySchema represents the schema in the Grafana response.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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