Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PortNames = struct { HTTP string }{ "http", }
Functions ¶
Types ¶
type Action ¶
type Action string
const ( // Replace performs a regex replacement. Replace Action = "replace" // Keep drops targets for which the input does not match the regex. Keep Action = "keep" // Drop drops targets for which the input does match the regex. Drop Action = "drop" // HashMod sets a label to the modulus of a hash of labels. HashMod Action = "hashmod" // LabelMap copies labels to other labelnames based on a regex. LabelMap Action = "labelmap" // LabelDrop drops any label matching the regex. LabelDrop Action = "labeldrop" // LabelKeep drops any label not matching the regex. LabelKeep Action = "labelkeep" )
type Config ¶
type Config struct { Common runner.Config Jobs map[string]ScrapeConfig }
Config describes how to run a single Prometheus instance.
func NewConfig ¶
func NewConfig(jobs map[string]ScrapeConfig, tls *pki.TLSConfigPEM) Config
type GlobalConfig ¶
type PrometheusConfig ¶
type PrometheusConfig struct { Global *GlobalConfig `yaml:"global,omitempty"` ScrapeConfigs []ScrapeConfig `yaml:"scrape_configs"` }
type RelabelConfig ¶
type RelabelConfig struct { // A list of labels from which values are taken and concatenated // with the configured separator in order. SourceLabels model.LabelNames `yaml:"source_labels,flow,omitempty"` // Separator is the string between concatenated values from the source labels. Separator string `yaml:"separator,omitempty"` // Regex against which the concatenation is matched. Regex string `yaml:"regex,omitempty"` // Modulus to take of the hash of concatenated values from the source labels. Modulus uint64 `yaml:"modulus,omitempty"` // TargetLabel is the label to which the resulting string is written in a replacement. // Regexp interpolation is allowed for the replace action. TargetLabel string `yaml:"target_label,omitempty"` // Replacement is the regex replacement pattern to be used. Replacement string `yaml:"replacement,omitempty"` // Action is the action to be performed for the relabeling. Action Action `yaml:"action,omitempty"` }
type ScrapeConfig ¶
type ScrapeConfig struct { JobName string `yaml:"job_name"` // Indicator whether the scraped metrics should remain unmodified. HonorLabels bool `yaml:"honor_labels,omitempty"` // Indicator whether the scraped timestamps should be respected. HonorTimestamps bool `yaml:"honor_timestamps,omitempty"` // A set of query parameters with which the target is scraped. Params url.Values `yaml:"params,omitempty"` // How frequently to scrape the targets of this scrape config. ScrapeInterval time.Duration `yaml:"scrape_interval,omitempty"` // The timeout for scraping targets of this config. ScrapeTimeout time.Duration `yaml:"scrape_timeout,omitempty"` // The HTTP resource path on which to fetch metrics from targets. MetricsPath string `yaml:"metrics_path,omitempty"` // The URL scheme with which to fetch metrics from targets. Scheme string `yaml:"scheme,omitempty"` // More than this many samples post metric-relabeling will cause the scrape to fail. SampleLimit uint `yaml:"sample_limit,omitempty"` // More than this many targets after the target relabeling will cause the // scrapes to fail. TargetLimit uint `yaml:"target_limit,omitempty"` ConsulServiceDiscoveryConfigs []ConsulServiceDiscoveryConfig `yaml:"consul_sd_configs,omitempty"` FileServiceDiscoveryConfigs []FileServiceDiscoveryConfig `yaml:"file_sd_configs,omitempty"` HTTPClientConfig config.HTTPClientConfig `yaml:",inline"` // List of target relabel configurations. RelabelConfigs []RelabelConfig `yaml:"relabel_configs,omitempty"` // List of metric relabel configurations. MetricRelabelConfigs []RelabelConfig `yaml:"metric_relabel_configs,omitempty"` }
Click to show internal directories.
Click to hide internal directories.