mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
This commit changes the configuration interface from job configs to scrape configs. This includes allowing multiple ways of target definition at once and moving DNS SD to its own config message. DNS SD can now contain multiple DNS names per configured discovery.
293 lines
8.8 KiB
Go
293 lines
8.8 KiB
Go
// Code generated by protoc-gen-go.
|
|
// source: config.proto
|
|
// DO NOT EDIT!
|
|
|
|
/*
|
|
Package io_prometheus is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
config.proto
|
|
|
|
It has these top-level messages:
|
|
LabelPair
|
|
LabelPairs
|
|
GlobalConfig
|
|
TargetGroup
|
|
DNSConfig
|
|
ScrapeConfig
|
|
PrometheusConfig
|
|
*/
|
|
package io_prometheus
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import math "math"
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = math.Inf
|
|
|
|
// A label/value pair suitable for attaching to timeseries.
|
|
type LabelPair struct {
|
|
// The name of the label. Must adhere to the regex "[a-zA-Z_][a-zA-Z0-9_]*".
|
|
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
|
// The value of the label. May contain any characters.
|
|
Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *LabelPair) Reset() { *m = LabelPair{} }
|
|
func (m *LabelPair) String() string { return proto.CompactTextString(m) }
|
|
func (*LabelPair) ProtoMessage() {}
|
|
|
|
func (m *LabelPair) GetName() string {
|
|
if m != nil && m.Name != nil {
|
|
return *m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LabelPair) GetValue() string {
|
|
if m != nil && m.Value != nil {
|
|
return *m.Value
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// A set of label/value pairs.
|
|
type LabelPairs struct {
|
|
Label []*LabelPair `protobuf:"bytes,1,rep,name=label" json:"label,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *LabelPairs) Reset() { *m = LabelPairs{} }
|
|
func (m *LabelPairs) String() string { return proto.CompactTextString(m) }
|
|
func (*LabelPairs) ProtoMessage() {}
|
|
|
|
func (m *LabelPairs) GetLabel() []*LabelPair {
|
|
if m != nil {
|
|
return m.Label
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The global Prometheus configuration section.
|
|
type GlobalConfig struct {
|
|
// How frequently to scrape targets by default. Must be a valid Prometheus
|
|
// duration string in the form "[0-9]+[smhdwy]".
|
|
ScrapeInterval *string `protobuf:"bytes,1,opt,name=scrape_interval,def=1m" json:"scrape_interval,omitempty"`
|
|
// How frequently to evaluate rules by default. Must be a valid Prometheus
|
|
// duration string in the form "[0-9]+[smhdwy]".
|
|
EvaluationInterval *string `protobuf:"bytes,2,opt,name=evaluation_interval,def=1m" json:"evaluation_interval,omitempty"`
|
|
// The labels to add to any timeseries that this Prometheus instance scrapes.
|
|
Labels *LabelPairs `protobuf:"bytes,3,opt,name=labels" json:"labels,omitempty"`
|
|
// The list of file names of rule files to load.
|
|
RuleFile []string `protobuf:"bytes,4,rep,name=rule_file" json:"rule_file,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *GlobalConfig) Reset() { *m = GlobalConfig{} }
|
|
func (m *GlobalConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*GlobalConfig) ProtoMessage() {}
|
|
|
|
const Default_GlobalConfig_ScrapeInterval string = "1m"
|
|
const Default_GlobalConfig_EvaluationInterval string = "1m"
|
|
|
|
func (m *GlobalConfig) GetScrapeInterval() string {
|
|
if m != nil && m.ScrapeInterval != nil {
|
|
return *m.ScrapeInterval
|
|
}
|
|
return Default_GlobalConfig_ScrapeInterval
|
|
}
|
|
|
|
func (m *GlobalConfig) GetEvaluationInterval() string {
|
|
if m != nil && m.EvaluationInterval != nil {
|
|
return *m.EvaluationInterval
|
|
}
|
|
return Default_GlobalConfig_EvaluationInterval
|
|
}
|
|
|
|
func (m *GlobalConfig) GetLabels() *LabelPairs {
|
|
if m != nil {
|
|
return m.Labels
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *GlobalConfig) GetRuleFile() []string {
|
|
if m != nil {
|
|
return m.RuleFile
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// A labeled group of targets to scrape for a job.
|
|
type TargetGroup struct {
|
|
// The list of endpoints to scrape via HTTP.
|
|
Target []string `protobuf:"bytes,1,rep,name=target" json:"target,omitempty"`
|
|
// The labels to add to any timeseries scraped for this target group.
|
|
Labels *LabelPairs `protobuf:"bytes,2,opt,name=labels" json:"labels,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *TargetGroup) Reset() { *m = TargetGroup{} }
|
|
func (m *TargetGroup) String() string { return proto.CompactTextString(m) }
|
|
func (*TargetGroup) ProtoMessage() {}
|
|
|
|
func (m *TargetGroup) GetTarget() []string {
|
|
if m != nil {
|
|
return m.Target
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *TargetGroup) GetLabels() *LabelPairs {
|
|
if m != nil {
|
|
return m.Labels
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The configuration for DNS based service discovery.
|
|
type DNSConfig struct {
|
|
// The list of DNS-SD service names pointing to SRV records
|
|
// containing endpoint information.
|
|
Name []string `protobuf:"bytes,1,rep,name=name" json:"name,omitempty"`
|
|
// Discovery refresh period when using DNS-SD to discover targets. Must be a
|
|
// valid Prometheus duration string in the form "[0-9]+[smhdwy]".
|
|
RefreshInterval *string `protobuf:"bytes,2,opt,name=refresh_interval,def=30s" json:"refresh_interval,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *DNSConfig) Reset() { *m = DNSConfig{} }
|
|
func (m *DNSConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*DNSConfig) ProtoMessage() {}
|
|
|
|
const Default_DNSConfig_RefreshInterval string = "30s"
|
|
|
|
func (m *DNSConfig) GetName() []string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *DNSConfig) GetRefreshInterval() string {
|
|
if m != nil && m.RefreshInterval != nil {
|
|
return *m.RefreshInterval
|
|
}
|
|
return Default_DNSConfig_RefreshInterval
|
|
}
|
|
|
|
// The configuration for a Prometheus job to scrape.
|
|
//
|
|
// The next field no. is 10.
|
|
type ScrapeConfig struct {
|
|
// The job name. Must adhere to the regex "[a-zA-Z_][a-zA-Z0-9_-]*".
|
|
JobName *string `protobuf:"bytes,1,req,name=job_name" json:"job_name,omitempty"`
|
|
// How frequently to scrape targets from this job. Overrides the global
|
|
// default. Must be a valid Prometheus duration string in the form
|
|
// "[0-9]+[smhdwy]".
|
|
ScrapeInterval *string `protobuf:"bytes,2,opt,name=scrape_interval" json:"scrape_interval,omitempty"`
|
|
// Per-target timeout when scraping this job. Must be a valid Prometheus
|
|
// duration string in the form "[0-9]+[smhdwy]".
|
|
ScrapeTimeout *string `protobuf:"bytes,7,opt,name=scrape_timeout,def=10s" json:"scrape_timeout,omitempty"`
|
|
// List of DNS service discovery configurations.
|
|
DnsConfig []*DNSConfig `protobuf:"bytes,9,rep,name=dns_config" json:"dns_config,omitempty"`
|
|
// List of labeled target groups for this job.
|
|
TargetGroup []*TargetGroup `protobuf:"bytes,5,rep,name=target_group" json:"target_group,omitempty"`
|
|
// The HTTP resource path on which to fetch metrics from targets.
|
|
MetricsPath *string `protobuf:"bytes,6,opt,name=metrics_path,def=/metrics" json:"metrics_path,omitempty"`
|
|
// The URL scheme with which to fetch metrics from targets.
|
|
Scheme *string `protobuf:"bytes,8,opt,name=scheme,def=http" json:"scheme,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *ScrapeConfig) Reset() { *m = ScrapeConfig{} }
|
|
func (m *ScrapeConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*ScrapeConfig) ProtoMessage() {}
|
|
|
|
const Default_ScrapeConfig_ScrapeTimeout string = "10s"
|
|
const Default_ScrapeConfig_MetricsPath string = "/metrics"
|
|
const Default_ScrapeConfig_Scheme string = "http"
|
|
|
|
func (m *ScrapeConfig) GetJobName() string {
|
|
if m != nil && m.JobName != nil {
|
|
return *m.JobName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ScrapeConfig) GetScrapeInterval() string {
|
|
if m != nil && m.ScrapeInterval != nil {
|
|
return *m.ScrapeInterval
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ScrapeConfig) GetScrapeTimeout() string {
|
|
if m != nil && m.ScrapeTimeout != nil {
|
|
return *m.ScrapeTimeout
|
|
}
|
|
return Default_ScrapeConfig_ScrapeTimeout
|
|
}
|
|
|
|
func (m *ScrapeConfig) GetDnsConfig() []*DNSConfig {
|
|
if m != nil {
|
|
return m.DnsConfig
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ScrapeConfig) GetTargetGroup() []*TargetGroup {
|
|
if m != nil {
|
|
return m.TargetGroup
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ScrapeConfig) GetMetricsPath() string {
|
|
if m != nil && m.MetricsPath != nil {
|
|
return *m.MetricsPath
|
|
}
|
|
return Default_ScrapeConfig_MetricsPath
|
|
}
|
|
|
|
func (m *ScrapeConfig) GetScheme() string {
|
|
if m != nil && m.Scheme != nil {
|
|
return *m.Scheme
|
|
}
|
|
return Default_ScrapeConfig_Scheme
|
|
}
|
|
|
|
// The top-level Prometheus configuration.
|
|
type PrometheusConfig struct {
|
|
// Global Prometheus configuration options. If omitted, an empty global
|
|
// configuration with default values (see GlobalConfig definition) will be
|
|
// created.
|
|
Global *GlobalConfig `protobuf:"bytes,1,opt,name=global" json:"global,omitempty"`
|
|
// The list of scrape configs.
|
|
ScrapeConfig []*ScrapeConfig `protobuf:"bytes,3,rep,name=scrape_config" json:"scrape_config,omitempty"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
}
|
|
|
|
func (m *PrometheusConfig) Reset() { *m = PrometheusConfig{} }
|
|
func (m *PrometheusConfig) String() string { return proto.CompactTextString(m) }
|
|
func (*PrometheusConfig) ProtoMessage() {}
|
|
|
|
func (m *PrometheusConfig) GetGlobal() *GlobalConfig {
|
|
if m != nil {
|
|
return m.Global
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *PrometheusConfig) GetScrapeConfig() []*ScrapeConfig {
|
|
if m != nil {
|
|
return m.ScrapeConfig
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
}
|