grafana

package
v2.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package grafana provides facilities for working with Grafana.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthServer

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

AuthServer authenticates incoming requests via Grafana API.

func NewAuthServer

func NewAuthServer(c clientInterface, checker awsInstanceChecker) *AuthServer

NewAuthServer creates new AuthServer.

func (*AuthServer) ServeHTTP

func (s *AuthServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP serves internal location /auth_request for both authentication subrequests and subsequent normal requests.

type Client

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

Client represents a client for Grafana API.

func NewClient

func NewClient(addr string) *Client

NewClient creates a new client for given Grafana address.

func (*Client) Collect

func (c *Client) Collect(ch chan<- prom.Metric)

Collect implements prometheus.Collector.

func (*Client) CreateAnnotation

func (c *Client) CreateAnnotation(ctx context.Context, tags []string, from time.Time, text, authorization string) (string, error)

CreateAnnotation creates annotation with given text and tags ("pmm_annotation" is added automatically) and returns Grafana's response text which is typically "Annotation added" or "Failed to save annotation".

func (*Client) Describe

func (c *Client) Describe(ch chan<- *prom.Desc)

Describe implements prometheus.Collector.

func (*Client) IsReady

func (c *Client) IsReady(ctx context.Context) error

IsReady calls Grafana API to check its status

Jump to

Keyboard shortcuts

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