datasource

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginKind = "PrometheusDatasource"
)

Variables

This section is empty.

Functions

func Prometheus

func Prometheus(options ...Option) datasource.Option

func Selector

func Selector(datasourceName string) *datasource.Selector

Types

type Builder

type Builder struct {
	PluginSpec `json:",inline" yaml:",inline"`
}

type Option

type Option func(plugin *Builder) error

func DirectURL

func DirectURL(url string) Option

func HTTPProxy

func HTTPProxy(url string, options ...http.Option) Option

func QueryParam added in v0.57.0

func QueryParam(key, value string) Option

func QueryParams added in v0.57.0

func QueryParams(params map[string]string) Option

type PluginSpec

type PluginSpec struct {
	DirectURL      string            `json:"directUrl,omitempty" yaml:"directUrl,omitempty"`
	Proxy          *http.Proxy       `json:"proxy,omitempty" yaml:"proxy,omitempty"`
	ScrapeInterval common.Duration   `json:"scrapeInterval,omitempty" yaml:"scrapeInterval,omitempty"`
	QueryParams    map[string]string `json:"queryParams,omitempty" yaml:"queryParams,omitempty"`
}

func (*PluginSpec) UnmarshalJSON

func (s *PluginSpec) UnmarshalJSON(data []byte) error

func (*PluginSpec) UnmarshalYAML

func (s *PluginSpec) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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