grafana

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a Grafana client.

func NewClient

func NewClient(apiKey string, httpClient *http.Client) *Client

NewClient creates a new Grafana client.

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string) (*QueryResponse, error)

Query executes a Grafana query.

type QueryResponse

type QueryResponse struct {
	Results struct {
		PandaPulse struct {
			Frames []struct {
				Schema struct {
					Fields []struct {
						Labels map[string]string `json:"labels"`
					} `json:"fields"`
				} `json:"schema"`
				Data struct {
					Values []interface{} `json:"values"`
				} `json:"data"`
			} `json:"frames"`
		} `json:"pandaPulse"`
	} `json:"results"`
}

QueryResponse is the response from a Grafana query.

Jump to

Keyboard shortcuts

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