diff --git a/build/Makefile b/build/Makefile index bcf7fedf23..3aa007b4dc 100644 --- a/build/Makefile +++ b/build/Makefile @@ -52,11 +52,14 @@ go-stamp: gvm-stamp [ -x "$$(which go)" ] || { echo "go not found." ; false ; } touch $@ -goprotobuf-stamp: go-stamp mercurial-stamp protoc-stamp - $(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT) +goprotobuf-protoc-gen-go-stamp: protoc-stamp $(GO_GET) code.google.com/p/goprotobuf/protoc-gen-go $(THIRD_PARTY_BUILD_OUTPUT) touch $@ +goprotobuf-stamp: go-stamp mercurial-stamp + $(GO_GET) code.google.com/p/goprotobuf/proto $(THIRD_PARTY_BUILD_OUTPUT) + touch $@ + gorest-stamp: go-stamp $(GO_GET) code.google.com/p/gorest $(THIRD_PARTY_BUILD_OUTPUT) touch $@ diff --git a/config/Makefile b/config/Makefile index df2497c2cc..7418444232 100644 --- a/config/Makefile +++ b/config/Makefile @@ -15,18 +15,13 @@ all: generated SUFFIXES: -MAKE_ARTIFACTS = generated-stamp - include ../Makefile.INCLUDE -generated: generated-stamp +# In order to build the generated targets in this directory, run the +# following: +# +# make -C build goprotobuf-protoc-gen-go-stamp -generated-stamp: config.proto + +generated/config.pb.go: config.proto protoc --proto_path=$(PREFIX)/include:. --go_out=generated/ config.proto - touch $@ - -clean: - rm -rf generated/* - -rm -f $(MAKE_ARTIFACTS) - -.PHONY: generated diff --git a/config/generated/.gitignore b/config/generated/.gitignore deleted file mode 100644 index 56086905e7..0000000000 --- a/config/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -config.pb.go diff --git a/config/generated/config.pb.go b/config/generated/config.pb.go new file mode 100644 index 0000000000..9fb91bcaa9 --- /dev/null +++ b/config/generated/config.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go. +// source: config.proto +// DO NOT EDIT! + +package io_prometheus + +import proto "code.google.com/p/goprotobuf/proto" +import json "encoding/json" +import math "math" + +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} +var _ = math.Inf + +type LabelPair struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + 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 "" +} + +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 +} + +type GlobalConfig struct { + ScrapeInterval *string `protobuf:"bytes,1,opt,name=scrape_interval,def=1m" json:"scrape_interval,omitempty"` + EvaluationInterval *string `protobuf:"bytes,2,opt,name=evaluation_interval,def=1m" json:"evaluation_interval,omitempty"` + Labels *LabelPairs `protobuf:"bytes,3,opt,name=labels" json:"labels,omitempty"` + 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 +} + +type TargetGroup struct { + Target []string `protobuf:"bytes,1,rep,name=target" json:"target,omitempty"` + 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 +} + +type JobConfig struct { + Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` + ScrapeInterval *string `protobuf:"bytes,2,opt,name=scrape_interval" json:"scrape_interval,omitempty"` + TargetGroup []*TargetGroup `protobuf:"bytes,3,rep,name=target_group" json:"target_group,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *JobConfig) Reset() { *m = JobConfig{} } +func (m *JobConfig) String() string { return proto.CompactTextString(m) } +func (*JobConfig) ProtoMessage() {} + +func (m *JobConfig) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *JobConfig) GetScrapeInterval() string { + if m != nil && m.ScrapeInterval != nil { + return *m.ScrapeInterval + } + return "" +} + +func (m *JobConfig) GetTargetGroup() []*TargetGroup { + if m != nil { + return m.TargetGroup + } + return nil +} + +type PrometheusConfig struct { + Global *GlobalConfig `protobuf:"bytes,1,opt,name=global" json:"global,omitempty"` + Job []*JobConfig `protobuf:"bytes,2,rep,name=job" json:"job,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) GetJob() []*JobConfig { + if m != nil { + return m.Job + } + return nil +} + +func init() { +} diff --git a/model/Makefile b/model/Makefile index 55555b83a9..0c1f25fd18 100644 --- a/model/Makefile +++ b/model/Makefile @@ -11,22 +11,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -all: generated +all: generated/data.pb.go generated/descriptor.blob SUFFIXES: -MAKE_ARTIFACTS = generated-stamp - include ../Makefile.INCLUDE -generated: generated-stamp +# In order to build the generated targets in this directory, run the +# following: +# +# make -C build goprotobuf-protoc-gen-go-stamp -generated-stamp: data.proto +generated/data.pb.go: data.proto protoc --proto_path=$(PREFIX)/include:. --include_imports --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto - touch $@ -clean: - rm -rf generated/* - -rm -f $(MAKE_ARTIFACTS) - -.PHONY: clean generated +generated/descriptor.blob: data.proto + protoc --proto_path=$(PREFIX)/include:. --include_imports --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto diff --git a/model/generated/.gitignore b/model/generated/.gitignore deleted file mode 100644 index e590fda01c..0000000000 --- a/model/generated/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -data.pb.go -descriptor.blob \ No newline at end of file diff --git a/model/generated/data.pb.go b/model/generated/data.pb.go new file mode 100644 index 0000000000..d1ca868f56 --- /dev/null +++ b/model/generated/data.pb.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-go. +// source: data.proto +// DO NOT EDIT! + +package io_prometheus + +import proto "code.google.com/p/goprotobuf/proto" +import json "encoding/json" +import math "math" + +// discarding unused import google_protobuf "google/protobuf/descriptor.pb" + +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} +var _ = math.Inf + +type LabelPair struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + 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 "" +} + +type LabelName struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelName) Reset() { *m = LabelName{} } +func (m *LabelName) String() string { return proto.CompactTextString(m) } +func (*LabelName) ProtoMessage() {} + +func (m *LabelName) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +type Metric struct { + LabelPair []*LabelPair `protobuf:"bytes,1,rep,name=label_pair" json:"label_pair,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Metric) Reset() { *m = Metric{} } +func (m *Metric) String() string { return proto.CompactTextString(m) } +func (*Metric) ProtoMessage() {} + +func (m *Metric) GetLabelPair() []*LabelPair { + if m != nil { + return m.LabelPair + } + return nil +} + +type Fingerprint struct { + Signature *string `protobuf:"bytes,1,opt,name=signature" json:"signature,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *Fingerprint) Reset() { *m = Fingerprint{} } +func (m *Fingerprint) String() string { return proto.CompactTextString(m) } +func (*Fingerprint) ProtoMessage() {} + +func (m *Fingerprint) GetSignature() string { + if m != nil && m.Signature != nil { + return *m.Signature + } + return "" +} + +type FingerprintCollection struct { + Member []*Fingerprint `protobuf:"bytes,1,rep,name=member" json:"member,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FingerprintCollection) Reset() { *m = FingerprintCollection{} } +func (m *FingerprintCollection) String() string { return proto.CompactTextString(m) } +func (*FingerprintCollection) ProtoMessage() {} + +func (m *FingerprintCollection) GetMember() []*Fingerprint { + if m != nil { + return m.Member + } + return nil +} + +type LabelSet struct { + Member []*LabelPair `protobuf:"bytes,1,rep,name=member" json:"member,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *LabelSet) Reset() { *m = LabelSet{} } +func (m *LabelSet) String() string { return proto.CompactTextString(m) } +func (*LabelSet) ProtoMessage() {} + +func (m *LabelSet) GetMember() []*LabelPair { + if m != nil { + return m.Member + } + return nil +} + +type SampleKey struct { + Fingerprint *Fingerprint `protobuf:"bytes,1,opt,name=fingerprint" json:"fingerprint,omitempty"` + Timestamp []byte `protobuf:"bytes,2,opt,name=timestamp" json:"timestamp,omitempty"` + LastTimestamp *int64 `protobuf:"fixed64,3,opt,name=last_timestamp" json:"last_timestamp,omitempty"` + SampleCount *uint32 `protobuf:"fixed32,4,opt,name=sample_count" json:"sample_count,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SampleKey) Reset() { *m = SampleKey{} } +func (m *SampleKey) String() string { return proto.CompactTextString(m) } +func (*SampleKey) ProtoMessage() {} + +func (m *SampleKey) GetFingerprint() *Fingerprint { + if m != nil { + return m.Fingerprint + } + return nil +} + +func (m *SampleKey) GetTimestamp() []byte { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *SampleKey) GetLastTimestamp() int64 { + if m != nil && m.LastTimestamp != nil { + return *m.LastTimestamp + } + return 0 +} + +func (m *SampleKey) GetSampleCount() uint32 { + if m != nil && m.SampleCount != nil { + return *m.SampleCount + } + return 0 +} + +type SampleValueSeries struct { + Value []*SampleValueSeries_Value `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SampleValueSeries) Reset() { *m = SampleValueSeries{} } +func (m *SampleValueSeries) String() string { return proto.CompactTextString(m) } +func (*SampleValueSeries) ProtoMessage() {} + +func (m *SampleValueSeries) GetValue() []*SampleValueSeries_Value { + if m != nil { + return m.Value + } + return nil +} + +type SampleValueSeries_Value struct { + Timestamp *int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` + Value *float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SampleValueSeries_Value) Reset() { *m = SampleValueSeries_Value{} } +func (m *SampleValueSeries_Value) String() string { return proto.CompactTextString(m) } +func (*SampleValueSeries_Value) ProtoMessage() {} + +func (m *SampleValueSeries_Value) GetTimestamp() int64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +func (m *SampleValueSeries_Value) GetValue() float64 { + if m != nil && m.Value != nil { + return *m.Value + } + return 0 +} + +type MembershipIndexValue struct { + XXX_unrecognized []byte `json:"-"` +} + +func (m *MembershipIndexValue) Reset() { *m = MembershipIndexValue{} } +func (m *MembershipIndexValue) String() string { return proto.CompactTextString(m) } +func (*MembershipIndexValue) ProtoMessage() {} + +type MetricHighWatermark struct { + Timestamp *int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MetricHighWatermark) Reset() { *m = MetricHighWatermark{} } +func (m *MetricHighWatermark) String() string { return proto.CompactTextString(m) } +func (*MetricHighWatermark) ProtoMessage() {} + +func (m *MetricHighWatermark) GetTimestamp() int64 { + if m != nil && m.Timestamp != nil { + return *m.Timestamp + } + return 0 +} + +type CompactionProcessorDefinition struct { + MinimumGroupSize *uint32 `protobuf:"varint,1,opt,name=minimum_group_size" json:"minimum_group_size,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CompactionProcessorDefinition) Reset() { *m = CompactionProcessorDefinition{} } +func (m *CompactionProcessorDefinition) String() string { return proto.CompactTextString(m) } +func (*CompactionProcessorDefinition) ProtoMessage() {} + +func (m *CompactionProcessorDefinition) GetMinimumGroupSize() uint32 { + if m != nil && m.MinimumGroupSize != nil { + return *m.MinimumGroupSize + } + return 0 +} + +type CurationKey struct { + Fingerprint *Fingerprint `protobuf:"bytes,1,opt,name=fingerprint" json:"fingerprint,omitempty"` + ProcessorMessageTypeName *string `protobuf:"bytes,2,opt,name=processor_message_type_name" json:"processor_message_type_name,omitempty"` + ProcessorMessageRaw []byte `protobuf:"bytes,3,opt,name=processor_message_raw" json:"processor_message_raw,omitempty"` + IgnoreYoungerThan *int64 `protobuf:"varint,4,opt,name=ignore_younger_than" json:"ignore_younger_than,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CurationKey) Reset() { *m = CurationKey{} } +func (m *CurationKey) String() string { return proto.CompactTextString(m) } +func (*CurationKey) ProtoMessage() {} + +func (m *CurationKey) GetFingerprint() *Fingerprint { + if m != nil { + return m.Fingerprint + } + return nil +} + +func (m *CurationKey) GetProcessorMessageTypeName() string { + if m != nil && m.ProcessorMessageTypeName != nil { + return *m.ProcessorMessageTypeName + } + return "" +} + +func (m *CurationKey) GetProcessorMessageRaw() []byte { + if m != nil { + return m.ProcessorMessageRaw + } + return nil +} + +func (m *CurationKey) GetIgnoreYoungerThan() int64 { + if m != nil && m.IgnoreYoungerThan != nil { + return *m.IgnoreYoungerThan + } + return 0 +} + +type CurationValue struct { + LastCompletionTimestamp *int64 `protobuf:"varint,1,opt,name=last_completion_timestamp" json:"last_completion_timestamp,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *CurationValue) Reset() { *m = CurationValue{} } +func (m *CurationValue) String() string { return proto.CompactTextString(m) } +func (*CurationValue) ProtoMessage() {} + +func (m *CurationValue) GetLastCompletionTimestamp() int64 { + if m != nil && m.LastCompletionTimestamp != nil { + return *m.LastCompletionTimestamp + } + return 0 +} + +func init() { +} diff --git a/model/generated/descriptor.blob b/model/generated/descriptor.blob new file mode 100644 index 0000000000..4c98e38025 Binary files /dev/null and b/model/generated/descriptor.blob differ