diff --git a/.gitignore b/.gitignore index ef5fb634..d70e3869 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ Cargo.lock #local nix shell.nix +.envrc +.direnv diff --git a/c++/prometheus/remote/types.pb.cc b/c++/prometheus/remote/types.pb.cc index 5f24e74b..89a0b3a4 100644 --- a/c++/prometheus/remote/types.pb.cc +++ b/c++/prometheus/remote/types.pb.cc @@ -66,11 +66,55 @@ struct ExemplarDefaultTypeInternal { }; }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ExemplarDefaultTypeInternal _Exemplar_default_instance_; +PROTOBUF_CONSTEXPR Histogram::Histogram( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.negative_spans_)*/{} + , /*decltype(_impl_.negative_deltas_)*/{} + , /*decltype(_impl_._negative_deltas_cached_byte_size_)*/{0} + , /*decltype(_impl_.negative_counts_)*/{} + , /*decltype(_impl_.positive_spans_)*/{} + , /*decltype(_impl_.positive_deltas_)*/{} + , /*decltype(_impl_._positive_deltas_cached_byte_size_)*/{0} + , /*decltype(_impl_.positive_counts_)*/{} + , /*decltype(_impl_.custom_values_)*/{} + , /*decltype(_impl_.sum_)*/0 + , /*decltype(_impl_.zero_threshold_)*/0 + , /*decltype(_impl_.schema_)*/0 + , /*decltype(_impl_.reset_hint_)*/0 + , /*decltype(_impl_.timestamp_)*/int64_t{0} + , /*decltype(_impl_.count_)*/{} + , /*decltype(_impl_.zero_count_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}} {} +struct HistogramDefaultTypeInternal { + PROTOBUF_CONSTEXPR HistogramDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~HistogramDefaultTypeInternal() {} + union { + Histogram _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HistogramDefaultTypeInternal _Histogram_default_instance_; +PROTOBUF_CONSTEXPR BucketSpan::BucketSpan( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.offset_)*/0 + , /*decltype(_impl_.length_)*/0u + , /*decltype(_impl_._cached_size_)*/{}} {} +struct BucketSpanDefaultTypeInternal { + PROTOBUF_CONSTEXPR BucketSpanDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~BucketSpanDefaultTypeInternal() {} + union { + BucketSpan _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BucketSpanDefaultTypeInternal _BucketSpan_default_instance_; PROTOBUF_CONSTEXPR TimeSeries::TimeSeries( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.labels_)*/{} , /*decltype(_impl_.samples_)*/{} , /*decltype(_impl_.exemplars_)*/{} + , /*decltype(_impl_.histograms_)*/{} , /*decltype(_impl_._cached_size_)*/{}} {} struct TimeSeriesDefaultTypeInternal { PROTOBUF_CONSTEXPR TimeSeriesDefaultTypeInternal() @@ -173,8 +217,8 @@ struct ChunkedSeriesDefaultTypeInternal { }; PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ChunkedSeriesDefaultTypeInternal _ChunkedSeries_default_instance_; } // namespace prometheus -static ::_pb::Metadata file_level_metadata_prometheus_2fremote_2ftypes_2eproto[10]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto[3]; +static ::_pb::Metadata file_level_metadata_prometheus_2fremote_2ftypes_2eproto[12]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto[4]; static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_prometheus_2fremote_2ftypes_2eproto = nullptr; const uint32_t TableStruct_prometheus_2fremote_2ftypes_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { @@ -206,6 +250,38 @@ const uint32_t TableStruct_prometheus_2fremote_2ftypes_2eproto::offsets[] PROTOB PROTOBUF_FIELD_OFFSET(::prometheus::Exemplar, _impl_.value_), PROTOBUF_FIELD_OFFSET(::prometheus::Exemplar, _impl_.timestamp_), ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.sum_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.schema_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.zero_threshold_), + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.negative_spans_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.negative_deltas_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.negative_counts_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.positive_spans_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.positive_deltas_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.positive_counts_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.reset_hint_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.custom_values_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.count_), + PROTOBUF_FIELD_OFFSET(::prometheus::Histogram, _impl_.zero_count_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::prometheus::BucketSpan, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::prometheus::BucketSpan, _impl_.offset_), + PROTOBUF_FIELD_OFFSET(::prometheus::BucketSpan, _impl_.length_), + ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::prometheus::TimeSeries, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ @@ -214,6 +290,7 @@ const uint32_t TableStruct_prometheus_2fremote_2ftypes_2eproto::offsets[] PROTOB PROTOBUF_FIELD_OFFSET(::prometheus::TimeSeries, _impl_.labels_), PROTOBUF_FIELD_OFFSET(::prometheus::TimeSeries, _impl_.samples_), PROTOBUF_FIELD_OFFSET(::prometheus::TimeSeries, _impl_.exemplars_), + PROTOBUF_FIELD_OFFSET(::prometheus::TimeSeries, _impl_.histograms_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::prometheus::Label, _internal_metadata_), ~0u, // no _extensions_ @@ -274,19 +351,23 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode { 0, -1, -1, sizeof(::prometheus::MetricMetadata)}, { 10, -1, -1, sizeof(::prometheus::Sample)}, { 18, -1, -1, sizeof(::prometheus::Exemplar)}, - { 27, -1, -1, sizeof(::prometheus::TimeSeries)}, - { 36, -1, -1, sizeof(::prometheus::Label)}, - { 44, -1, -1, sizeof(::prometheus::Labels)}, - { 51, -1, -1, sizeof(::prometheus::LabelMatcher)}, - { 60, -1, -1, sizeof(::prometheus::ReadHints)}, - { 73, -1, -1, sizeof(::prometheus::Chunk)}, - { 83, -1, -1, sizeof(::prometheus::ChunkedSeries)}, + { 27, -1, -1, sizeof(::prometheus::Histogram)}, + { 51, -1, -1, sizeof(::prometheus::BucketSpan)}, + { 59, -1, -1, sizeof(::prometheus::TimeSeries)}, + { 69, -1, -1, sizeof(::prometheus::Label)}, + { 77, -1, -1, sizeof(::prometheus::Labels)}, + { 84, -1, -1, sizeof(::prometheus::LabelMatcher)}, + { 93, -1, -1, sizeof(::prometheus::ReadHints)}, + { 106, -1, -1, sizeof(::prometheus::Chunk)}, + { 116, -1, -1, sizeof(::prometheus::ChunkedSeries)}, }; static const ::_pb::Message* const file_default_instances[] = { &::prometheus::_MetricMetadata_default_instance_._instance, &::prometheus::_Sample_default_instance_._instance, &::prometheus::_Exemplar_default_instance_._instance, + &::prometheus::_Histogram_default_instance_._instance, + &::prometheus::_BucketSpan_default_instance_._instance, &::prometheus::_TimeSeries_default_instance_._instance, &::prometheus::_Label_default_instance_._instance, &::prometheus::_Labels_default_instance_._instance, @@ -307,32 +388,49 @@ const char descriptor_table_protodef_prometheus_2fremote_2ftypes_2eproto[] PROTO "\022\014\n\010STATESET\020\007\"*\n\006Sample\022\r\n\005value\030\001 \001(\001\022" "\021\n\ttimestamp\030\002 \001(\003\"O\n\010Exemplar\022!\n\006labels" "\030\001 \003(\0132\021.prometheus.Label\022\r\n\005value\030\002 \001(\001" - "\022\021\n\ttimestamp\030\003 \001(\003\"}\n\nTimeSeries\022!\n\006lab" - "els\030\001 \003(\0132\021.prometheus.Label\022#\n\007samples\030" - "\002 \003(\0132\022.prometheus.Sample\022\'\n\texemplars\030\003" - " \003(\0132\024.prometheus.Exemplar\"$\n\005Label\022\014\n\004n" - "ame\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"+\n\006Labels\022!\n\006la" - "bels\030\001 \003(\0132\021.prometheus.Label\"\202\001\n\014LabelM" - "atcher\022+\n\004type\030\001 \001(\0162\035.prometheus.LabelM" - "atcher.Type\022\014\n\004name\030\002 \001(\t\022\r\n\005value\030\003 \001(\t" - "\"(\n\004Type\022\006\n\002EQ\020\000\022\007\n\003NEQ\020\001\022\006\n\002RE\020\002\022\007\n\003NRE" - "\020\003\"|\n\tReadHints\022\017\n\007step_ms\030\001 \001(\003\022\014\n\004func" - "\030\002 \001(\t\022\020\n\010start_ms\030\003 \001(\003\022\016\n\006end_ms\030\004 \001(\003" - "\022\020\n\010grouping\030\005 \003(\t\022\n\n\002by\030\006 \001(\010\022\020\n\010range_" - "ms\030\007 \001(\003\"\213\001\n\005Chunk\022\023\n\013min_time_ms\030\001 \001(\003\022" - "\023\n\013max_time_ms\030\002 \001(\003\022(\n\004type\030\003 \001(\0162\032.pro" - "metheus.Chunk.Encoding\022\014\n\004data\030\004 \001(\014\" \n\010" - "Encoding\022\013\n\007UNKNOWN\020\000\022\007\n\003XOR\020\001\"U\n\rChunke" - "dSeries\022!\n\006labels\030\001 \003(\0132\021.prometheus.Lab" - "el\022!\n\006chunks\030\002 \003(\0132\021.prometheus.ChunkB=Z" - ";github.com/GreptimeTeam/greptime-proto/" - "go/prometheus/remoteb\006proto3" + "\022\021\n\ttimestamp\030\003 \001(\003\"\222\004\n\tHistogram\022\023\n\tcou" + "nt_int\030\001 \001(\004H\000\022\025\n\013count_float\030\002 \001(\001H\000\022\013\n" + "\003sum\030\003 \001(\001\022\016\n\006schema\030\004 \001(\021\022\026\n\016zero_thres" + "hold\030\005 \001(\001\022\030\n\016zero_count_int\030\006 \001(\004H\001\022\032\n\020" + "zero_count_float\030\007 \001(\001H\001\022.\n\016negative_spa" + "ns\030\010 \003(\0132\026.prometheus.BucketSpan\022\027\n\017nega" + "tive_deltas\030\t \003(\022\022\027\n\017negative_counts\030\n \003" + "(\001\022.\n\016positive_spans\030\013 \003(\0132\026.prometheus." + "BucketSpan\022\027\n\017positive_deltas\030\014 \003(\022\022\027\n\017p" + "ositive_counts\030\r \003(\001\0223\n\nreset_hint\030\016 \001(\016" + "2\037.prometheus.Histogram.ResetHint\022\021\n\ttim" + "estamp\030\017 \001(\003\022\025\n\rcustom_values\030\020 \003(\001\"4\n\tR" + "esetHint\022\013\n\007UNKNOWN\020\000\022\007\n\003YES\020\001\022\006\n\002NO\020\002\022\t" + "\n\005GAUGE\020\003B\007\n\005countB\014\n\nzero_count\",\n\nBuck" + "etSpan\022\016\n\006offset\030\001 \001(\021\022\016\n\006length\030\002 \001(\r\"\250" + "\001\n\nTimeSeries\022!\n\006labels\030\001 \003(\0132\021.promethe" + "us.Label\022#\n\007samples\030\002 \003(\0132\022.prometheus.S" + "ample\022\'\n\texemplars\030\003 \003(\0132\024.prometheus.Ex" + "emplar\022)\n\nhistograms\030\004 \003(\0132\025.prometheus." + "Histogram\"$\n\005Label\022\014\n\004name\030\001 \001(\t\022\r\n\005valu" + "e\030\002 \001(\t\"+\n\006Labels\022!\n\006labels\030\001 \003(\0132\021.prom" + "etheus.Label\"\202\001\n\014LabelMatcher\022+\n\004type\030\001 " + "\001(\0162\035.prometheus.LabelMatcher.Type\022\014\n\004na" + "me\030\002 \001(\t\022\r\n\005value\030\003 \001(\t\"(\n\004Type\022\006\n\002EQ\020\000\022" + "\007\n\003NEQ\020\001\022\006\n\002RE\020\002\022\007\n\003NRE\020\003\"|\n\tReadHints\022\017" + "\n\007step_ms\030\001 \001(\003\022\014\n\004func\030\002 \001(\t\022\020\n\010start_m" + "s\030\003 \001(\003\022\016\n\006end_ms\030\004 \001(\003\022\020\n\010grouping\030\005 \003(" + "\t\022\n\n\002by\030\006 \001(\010\022\020\n\010range_ms\030\007 \001(\003\"\257\001\n\005Chun" + "k\022\023\n\013min_time_ms\030\001 \001(\003\022\023\n\013max_time_ms\030\002 " + "\001(\003\022(\n\004type\030\003 \001(\0162\032.prometheus.Chunk.Enc" + "oding\022\014\n\004data\030\004 \001(\014\"D\n\010Encoding\022\013\n\007UNKNO" + "WN\020\000\022\007\n\003XOR\020\001\022\r\n\tHISTOGRAM\020\002\022\023\n\017FLOAT_HI" + "STOGRAM\020\003\"U\n\rChunkedSeries\022!\n\006labels\030\001 \003" + "(\0132\021.prometheus.Label\022!\n\006chunks\030\002 \003(\0132\021." + "prometheus.ChunkB=Z;github.com/GreptimeT" + "eam/greptime-proto/go/prometheus/remoteb" + "\006proto3" ; static ::_pbi::once_flag descriptor_table_prometheus_2fremote_2ftypes_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_prometheus_2fremote_2ftypes_2eproto = { - false, false, 1188, descriptor_table_protodef_prometheus_2fremote_2ftypes_2eproto, + false, false, 1847, descriptor_table_protodef_prometheus_2fremote_2ftypes_2eproto, "prometheus/remote/types.proto", - &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, nullptr, 0, 10, + &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, nullptr, 0, 12, schemas, file_default_instances, TableStruct_prometheus_2fremote_2ftypes_2eproto::offsets, file_level_metadata_prometheus_2fremote_2ftypes_2eproto, file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto, file_level_service_descriptors_prometheus_2fremote_2ftypes_2eproto, @@ -377,10 +475,35 @@ constexpr MetricMetadata_MetricType MetricMetadata::MetricType_MIN; constexpr MetricMetadata_MetricType MetricMetadata::MetricType_MAX; constexpr int MetricMetadata::MetricType_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LabelMatcher_Type_descriptor() { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Histogram_ResetHint_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_prometheus_2fremote_2ftypes_2eproto); return file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto[1]; } +bool Histogram_ResetHint_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +constexpr Histogram_ResetHint Histogram::UNKNOWN; +constexpr Histogram_ResetHint Histogram::YES; +constexpr Histogram_ResetHint Histogram::NO; +constexpr Histogram_ResetHint Histogram::GAUGE; +constexpr Histogram_ResetHint Histogram::ResetHint_MIN; +constexpr Histogram_ResetHint Histogram::ResetHint_MAX; +constexpr int Histogram::ResetHint_ARRAYSIZE; +#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* LabelMatcher_Type_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_prometheus_2fremote_2ftypes_2eproto); + return file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto[2]; +} bool LabelMatcher_Type_IsValid(int value) { switch (value) { case 0: @@ -404,12 +527,14 @@ constexpr int LabelMatcher::Type_ARRAYSIZE; #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Chunk_Encoding_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_prometheus_2fremote_2ftypes_2eproto); - return file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto[2]; + return file_level_enum_descriptors_prometheus_2fremote_2ftypes_2eproto[3]; } bool Chunk_Encoding_IsValid(int value) { switch (value) { case 0: case 1: + case 2: + case 3: return true; default: return false; @@ -419,6 +544,8 @@ bool Chunk_Encoding_IsValid(int value) { #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)) constexpr Chunk_Encoding Chunk::UNKNOWN; constexpr Chunk_Encoding Chunk::XOR; +constexpr Chunk_Encoding Chunk::HISTOGRAM; +constexpr Chunk_Encoding Chunk::FLOAT_HISTOGRAM; constexpr Chunk_Encoding Chunk::Encoding_MIN; constexpr Chunk_Encoding Chunk::Encoding_MAX; constexpr int Chunk::Encoding_ARRAYSIZE; @@ -875,153 +1002,1166 @@ uint8_t* Sample::_InternalSerialize( uint32_t cached_has_bits = 0; (void) cached_has_bits; - // double value = 1; - static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_value = this->_internal_value(); - uint64_t raw_value; - memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); - if (raw_value != 0) { + // double value = 1; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_value = this->_internal_value(); + uint64_t raw_value; + memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); + if (raw_value != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(1, this->_internal_value(), target); + } + + // int64 timestamp = 2; + if (this->_internal_timestamp() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_timestamp(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:prometheus.Sample) + return target; +} + +size_t Sample::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:prometheus.Sample) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // double value = 1; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_value = this->_internal_value(); + uint64_t raw_value; + memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); + if (raw_value != 0) { + total_size += 1 + 8; + } + + // int64 timestamp = 2; + if (this->_internal_timestamp() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Sample::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Sample::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Sample::GetClassData() const { return &_class_data_; } + + +void Sample::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:prometheus.Sample) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_value = from._internal_value(); + uint64_t raw_value; + memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); + if (raw_value != 0) { + _this->_internal_set_value(from._internal_value()); + } + if (from._internal_timestamp() != 0) { + _this->_internal_set_timestamp(from._internal_timestamp()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Sample::CopyFrom(const Sample& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:prometheus.Sample) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Sample::IsInitialized() const { + return true; +} + +void Sample::InternalSwap(Sample* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Sample, _impl_.timestamp_) + + sizeof(Sample::_impl_.timestamp_) + - PROTOBUF_FIELD_OFFSET(Sample, _impl_.value_)>( + reinterpret_cast(&_impl_.value_), + reinterpret_cast(&other->_impl_.value_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Sample::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[1]); +} + +// =================================================================== + +class Exemplar::_Internal { + public: +}; + +Exemplar::Exemplar(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:prometheus.Exemplar) +} +Exemplar::Exemplar(const Exemplar& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Exemplar* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.labels_){from._impl_.labels_} + , decltype(_impl_.value_){} + , decltype(_impl_.timestamp_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.value_, &from._impl_.value_, + static_cast(reinterpret_cast(&_impl_.timestamp_) - + reinterpret_cast(&_impl_.value_)) + sizeof(_impl_.timestamp_)); + // @@protoc_insertion_point(copy_constructor:prometheus.Exemplar) +} + +inline void Exemplar::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.labels_){arena} + , decltype(_impl_.value_){0} + , decltype(_impl_.timestamp_){int64_t{0}} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Exemplar::~Exemplar() { + // @@protoc_insertion_point(destructor:prometheus.Exemplar) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Exemplar::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.labels_.~RepeatedPtrField(); +} + +void Exemplar::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Exemplar::Clear() { +// @@protoc_insertion_point(message_clear_start:prometheus.Exemplar) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.labels_.Clear(); + ::memset(&_impl_.value_, 0, static_cast( + reinterpret_cast(&_impl_.timestamp_) - + reinterpret_cast(&_impl_.value_)) + sizeof(_impl_.timestamp_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Exemplar::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // repeated .prometheus.Label labels = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_labels(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + } else + goto handle_unusual; + continue; + // double value = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 17)) { + _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // int64 timestamp = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Exemplar::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:prometheus.Exemplar) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // repeated .prometheus.Label labels = 1; + for (unsigned i = 0, + n = static_cast(this->_internal_labels_size()); i < n; i++) { + const auto& repfield = this->_internal_labels(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); + } + + // double value = 2; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_value = this->_internal_value(); + uint64_t raw_value; + memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); + if (raw_value != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_value(), target); + } + + // int64 timestamp = 3; + if (this->_internal_timestamp() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_timestamp(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:prometheus.Exemplar) + return target; +} + +size_t Exemplar::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:prometheus.Exemplar) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .prometheus.Label labels = 1; + total_size += 1UL * this->_internal_labels_size(); + for (const auto& msg : this->_impl_.labels_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // double value = 2; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_value = this->_internal_value(); + uint64_t raw_value; + memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); + if (raw_value != 0) { + total_size += 1 + 8; + } + + // int64 timestamp = 3; + if (this->_internal_timestamp() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Exemplar::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Exemplar::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Exemplar::GetClassData() const { return &_class_data_; } + + +void Exemplar::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:prometheus.Exemplar) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.labels_.MergeFrom(from._impl_.labels_); + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_value = from._internal_value(); + uint64_t raw_value; + memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); + if (raw_value != 0) { + _this->_internal_set_value(from._internal_value()); + } + if (from._internal_timestamp() != 0) { + _this->_internal_set_timestamp(from._internal_timestamp()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Exemplar::CopyFrom(const Exemplar& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:prometheus.Exemplar) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Exemplar::IsInitialized() const { + return true; +} + +void Exemplar::InternalSwap(Exemplar* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.labels_.InternalSwap(&other->_impl_.labels_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Exemplar, _impl_.timestamp_) + + sizeof(Exemplar::_impl_.timestamp_) + - PROTOBUF_FIELD_OFFSET(Exemplar, _impl_.value_)>( + reinterpret_cast(&_impl_.value_), + reinterpret_cast(&other->_impl_.value_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Exemplar::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[2]); +} + +// =================================================================== + +class Histogram::_Internal { + public: +}; + +Histogram::Histogram(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:prometheus.Histogram) +} +Histogram::Histogram(const Histogram& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Histogram* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.negative_spans_){from._impl_.negative_spans_} + , decltype(_impl_.negative_deltas_){from._impl_.negative_deltas_} + , /*decltype(_impl_._negative_deltas_cached_byte_size_)*/{0} + , decltype(_impl_.negative_counts_){from._impl_.negative_counts_} + , decltype(_impl_.positive_spans_){from._impl_.positive_spans_} + , decltype(_impl_.positive_deltas_){from._impl_.positive_deltas_} + , /*decltype(_impl_._positive_deltas_cached_byte_size_)*/{0} + , decltype(_impl_.positive_counts_){from._impl_.positive_counts_} + , decltype(_impl_.custom_values_){from._impl_.custom_values_} + , decltype(_impl_.sum_){} + , decltype(_impl_.zero_threshold_){} + , decltype(_impl_.schema_){} + , decltype(_impl_.reset_hint_){} + , decltype(_impl_.timestamp_){} + , decltype(_impl_.count_){} + , decltype(_impl_.zero_count_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.sum_, &from._impl_.sum_, + static_cast(reinterpret_cast(&_impl_.timestamp_) - + reinterpret_cast(&_impl_.sum_)) + sizeof(_impl_.timestamp_)); + clear_has_count(); + switch (from.count_case()) { + case kCountInt: { + _this->_internal_set_count_int(from._internal_count_int()); + break; + } + case kCountFloat: { + _this->_internal_set_count_float(from._internal_count_float()); + break; + } + case COUNT_NOT_SET: { + break; + } + } + clear_has_zero_count(); + switch (from.zero_count_case()) { + case kZeroCountInt: { + _this->_internal_set_zero_count_int(from._internal_zero_count_int()); + break; + } + case kZeroCountFloat: { + _this->_internal_set_zero_count_float(from._internal_zero_count_float()); + break; + } + case ZERO_COUNT_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:prometheus.Histogram) +} + +inline void Histogram::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.negative_spans_){arena} + , decltype(_impl_.negative_deltas_){arena} + , /*decltype(_impl_._negative_deltas_cached_byte_size_)*/{0} + , decltype(_impl_.negative_counts_){arena} + , decltype(_impl_.positive_spans_){arena} + , decltype(_impl_.positive_deltas_){arena} + , /*decltype(_impl_._positive_deltas_cached_byte_size_)*/{0} + , decltype(_impl_.positive_counts_){arena} + , decltype(_impl_.custom_values_){arena} + , decltype(_impl_.sum_){0} + , decltype(_impl_.zero_threshold_){0} + , decltype(_impl_.schema_){0} + , decltype(_impl_.reset_hint_){0} + , decltype(_impl_.timestamp_){int64_t{0}} + , decltype(_impl_.count_){} + , decltype(_impl_.zero_count_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{} + }; + clear_has_count(); + clear_has_zero_count(); +} + +Histogram::~Histogram() { + // @@protoc_insertion_point(destructor:prometheus.Histogram) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Histogram::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.negative_spans_.~RepeatedPtrField(); + _impl_.negative_deltas_.~RepeatedField(); + _impl_.negative_counts_.~RepeatedField(); + _impl_.positive_spans_.~RepeatedPtrField(); + _impl_.positive_deltas_.~RepeatedField(); + _impl_.positive_counts_.~RepeatedField(); + _impl_.custom_values_.~RepeatedField(); + if (has_count()) { + clear_count(); + } + if (has_zero_count()) { + clear_zero_count(); + } +} + +void Histogram::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Histogram::clear_count() { +// @@protoc_insertion_point(one_of_clear_start:prometheus.Histogram) + switch (count_case()) { + case kCountInt: { + // No need to clear + break; + } + case kCountFloat: { + // No need to clear + break; + } + case COUNT_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = COUNT_NOT_SET; +} + +void Histogram::clear_zero_count() { +// @@protoc_insertion_point(one_of_clear_start:prometheus.Histogram) + switch (zero_count_case()) { + case kZeroCountInt: { + // No need to clear + break; + } + case kZeroCountFloat: { + // No need to clear + break; + } + case ZERO_COUNT_NOT_SET: { + break; + } + } + _impl_._oneof_case_[1] = ZERO_COUNT_NOT_SET; +} + + +void Histogram::Clear() { +// @@protoc_insertion_point(message_clear_start:prometheus.Histogram) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.negative_spans_.Clear(); + _impl_.negative_deltas_.Clear(); + _impl_.negative_counts_.Clear(); + _impl_.positive_spans_.Clear(); + _impl_.positive_deltas_.Clear(); + _impl_.positive_counts_.Clear(); + _impl_.custom_values_.Clear(); + ::memset(&_impl_.sum_, 0, static_cast( + reinterpret_cast(&_impl_.timestamp_) - + reinterpret_cast(&_impl_.sum_)) + sizeof(_impl_.timestamp_)); + clear_count(); + clear_zero_count(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Histogram::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint64 count_int = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _internal_set_count_int(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // double count_float = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 17)) { + _internal_set_count_float(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // double sum = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 25)) { + _impl_.sum_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // sint32 schema = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.schema_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // double zero_threshold = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 41)) { + _impl_.zero_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // uint64 zero_count_int = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _internal_set_zero_count_int(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // double zero_count_float = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 57)) { + _internal_set_zero_count_float(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // repeated .prometheus.BucketSpan negative_spans = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_negative_spans(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr)); + } else + goto handle_unusual; + continue; + // repeated sint64 negative_deltas = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_negative_deltas(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 72) { + _internal_add_negative_deltas(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr)); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated double negative_counts = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 82)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_negative_counts(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 81) { + _internal_add_negative_counts(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // repeated .prometheus.BucketSpan positive_spans = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 90)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_positive_spans(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<90>(ptr)); + } else + goto handle_unusual; + continue; + // repeated sint64 positive_deltas = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 98)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_positive_deltas(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 96) { + _internal_add_positive_deltas(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr)); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated double positive_counts = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 106)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_positive_counts(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 105) { + _internal_add_positive_counts(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // .prometheus.Histogram.ResetHint reset_hint = 14; + case 14: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 112)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_reset_hint(static_cast<::prometheus::Histogram_ResetHint>(val)); + } else + goto handle_unusual; + continue; + // int64 timestamp = 15; + case 15: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 120)) { + _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated double custom_values = 16; + case 16: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 130)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_custom_values(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 129) { + _internal_add_custom_values(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr)); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Histogram::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:prometheus.Histogram) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 count_int = 1; + if (_internal_has_count_int()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_count_int(), target); + } + + // double count_float = 2; + if (_internal_has_count_float()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_count_float(), target); + } + + // double sum = 3; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_sum = this->_internal_sum(); + uint64_t raw_sum; + memcpy(&raw_sum, &tmp_sum, sizeof(tmp_sum)); + if (raw_sum != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(3, this->_internal_sum(), target); + } + + // sint32 schema = 4; + if (this->_internal_schema() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteSInt32ToArray(4, this->_internal_schema(), target); + } + + // double zero_threshold = 5; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_zero_threshold = this->_internal_zero_threshold(); + uint64_t raw_zero_threshold; + memcpy(&raw_zero_threshold, &tmp_zero_threshold, sizeof(tmp_zero_threshold)); + if (raw_zero_threshold != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(5, this->_internal_zero_threshold(), target); + } + + // uint64 zero_count_int = 6; + if (_internal_has_zero_count_int()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_zero_count_int(), target); + } + + // double zero_count_float = 7; + if (_internal_has_zero_count_float()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(7, this->_internal_zero_count_float(), target); + } + + // repeated .prometheus.BucketSpan negative_spans = 8; + for (unsigned i = 0, + n = static_cast(this->_internal_negative_spans_size()); i < n; i++) { + const auto& repfield = this->_internal_negative_spans(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(8, repfield, repfield.GetCachedSize(), target, stream); + } + + // repeated sint64 negative_deltas = 9; + { + int byte_size = _impl_._negative_deltas_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteSInt64Packed( + 9, _internal_negative_deltas(), byte_size, target); + } + } + + // repeated double negative_counts = 10; + if (this->_internal_negative_counts_size() > 0) { + target = stream->WriteFixedPacked(10, _internal_negative_counts(), target); + } + + // repeated .prometheus.BucketSpan positive_spans = 11; + for (unsigned i = 0, + n = static_cast(this->_internal_positive_spans_size()); i < n; i++) { + const auto& repfield = this->_internal_positive_spans(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(11, repfield, repfield.GetCachedSize(), target, stream); + } + + // repeated sint64 positive_deltas = 12; + { + int byte_size = _impl_._positive_deltas_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteSInt64Packed( + 12, _internal_positive_deltas(), byte_size, target); + } + } + + // repeated double positive_counts = 13; + if (this->_internal_positive_counts_size() > 0) { + target = stream->WriteFixedPacked(13, _internal_positive_counts(), target); + } + + // .prometheus.Histogram.ResetHint reset_hint = 14; + if (this->_internal_reset_hint() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray(1, this->_internal_value(), target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 14, this->_internal_reset_hint(), target); } - // int64 timestamp = 2; + // int64 timestamp = 15; if (this->_internal_timestamp() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_timestamp(), target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(15, this->_internal_timestamp(), target); + } + + // repeated double custom_values = 16; + if (this->_internal_custom_values_size() > 0) { + target = stream->WriteFixedPacked(16, _internal_custom_values(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:prometheus.Sample) + // @@protoc_insertion_point(serialize_to_array_end:prometheus.Histogram) return target; } -size_t Sample::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:prometheus.Sample) +size_t Histogram::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:prometheus.Histogram) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // double value = 1; + // repeated .prometheus.BucketSpan negative_spans = 8; + total_size += 1UL * this->_internal_negative_spans_size(); + for (const auto& msg : this->_impl_.negative_spans_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated sint64 negative_deltas = 9; + { + size_t data_size = ::_pbi::WireFormatLite:: + SInt64Size(this->_impl_.negative_deltas_); + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._negative_deltas_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // repeated double negative_counts = 10; + { + unsigned int count = static_cast(this->_internal_negative_counts_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + total_size += data_size; + } + + // repeated .prometheus.BucketSpan positive_spans = 11; + total_size += 1UL * this->_internal_positive_spans_size(); + for (const auto& msg : this->_impl_.positive_spans_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated sint64 positive_deltas = 12; + { + size_t data_size = ::_pbi::WireFormatLite:: + SInt64Size(this->_impl_.positive_deltas_); + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._positive_deltas_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // repeated double positive_counts = 13; + { + unsigned int count = static_cast(this->_internal_positive_counts_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + total_size += data_size; + } + + // repeated double custom_values = 16; + { + unsigned int count = static_cast(this->_internal_custom_values_size()); + size_t data_size = 8UL * count; + if (data_size > 0) { + total_size += 2 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + total_size += data_size; + } + + // double sum = 3; static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_value = this->_internal_value(); - uint64_t raw_value; - memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); - if (raw_value != 0) { + double tmp_sum = this->_internal_sum(); + uint64_t raw_sum; + memcpy(&raw_sum, &tmp_sum, sizeof(tmp_sum)); + if (raw_sum != 0) { total_size += 1 + 8; } - // int64 timestamp = 2; + // double zero_threshold = 5; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_zero_threshold = this->_internal_zero_threshold(); + uint64_t raw_zero_threshold; + memcpy(&raw_zero_threshold, &tmp_zero_threshold, sizeof(tmp_zero_threshold)); + if (raw_zero_threshold != 0) { + total_size += 1 + 8; + } + + // sint32 schema = 4; + if (this->_internal_schema() != 0) { + total_size += ::_pbi::WireFormatLite::SInt32SizePlusOne(this->_internal_schema()); + } + + // .prometheus.Histogram.ResetHint reset_hint = 14; + if (this->_internal_reset_hint() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_reset_hint()); + } + + // int64 timestamp = 15; if (this->_internal_timestamp() != 0) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp()); } + switch (count_case()) { + // uint64 count_int = 1; + case kCountInt: { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_count_int()); + break; + } + // double count_float = 2; + case kCountFloat: { + total_size += 1 + 8; + break; + } + case COUNT_NOT_SET: { + break; + } + } + switch (zero_count_case()) { + // uint64 zero_count_int = 6; + case kZeroCountInt: { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_zero_count_int()); + break; + } + // double zero_count_float = 7; + case kZeroCountFloat: { + total_size += 1 + 8; + break; + } + case ZERO_COUNT_NOT_SET: { + break; + } + } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Sample::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Histogram::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Sample::MergeImpl + Histogram::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Sample::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Histogram::GetClassData() const { return &_class_data_; } -void Sample::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:prometheus.Sample) +void Histogram::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:prometheus.Histogram) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; + _this->_impl_.negative_spans_.MergeFrom(from._impl_.negative_spans_); + _this->_impl_.negative_deltas_.MergeFrom(from._impl_.negative_deltas_); + _this->_impl_.negative_counts_.MergeFrom(from._impl_.negative_counts_); + _this->_impl_.positive_spans_.MergeFrom(from._impl_.positive_spans_); + _this->_impl_.positive_deltas_.MergeFrom(from._impl_.positive_deltas_); + _this->_impl_.positive_counts_.MergeFrom(from._impl_.positive_counts_); + _this->_impl_.custom_values_.MergeFrom(from._impl_.custom_values_); static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_value = from._internal_value(); - uint64_t raw_value; - memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); - if (raw_value != 0) { - _this->_internal_set_value(from._internal_value()); + double tmp_sum = from._internal_sum(); + uint64_t raw_sum; + memcpy(&raw_sum, &tmp_sum, sizeof(tmp_sum)); + if (raw_sum != 0) { + _this->_internal_set_sum(from._internal_sum()); + } + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_zero_threshold = from._internal_zero_threshold(); + uint64_t raw_zero_threshold; + memcpy(&raw_zero_threshold, &tmp_zero_threshold, sizeof(tmp_zero_threshold)); + if (raw_zero_threshold != 0) { + _this->_internal_set_zero_threshold(from._internal_zero_threshold()); + } + if (from._internal_schema() != 0) { + _this->_internal_set_schema(from._internal_schema()); + } + if (from._internal_reset_hint() != 0) { + _this->_internal_set_reset_hint(from._internal_reset_hint()); } if (from._internal_timestamp() != 0) { _this->_internal_set_timestamp(from._internal_timestamp()); } + switch (from.count_case()) { + case kCountInt: { + _this->_internal_set_count_int(from._internal_count_int()); + break; + } + case kCountFloat: { + _this->_internal_set_count_float(from._internal_count_float()); + break; + } + case COUNT_NOT_SET: { + break; + } + } + switch (from.zero_count_case()) { + case kZeroCountInt: { + _this->_internal_set_zero_count_int(from._internal_zero_count_int()); + break; + } + case kZeroCountFloat: { + _this->_internal_set_zero_count_float(from._internal_zero_count_float()); + break; + } + case ZERO_COUNT_NOT_SET: { + break; + } + } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void Sample::CopyFrom(const Sample& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:prometheus.Sample) +void Histogram::CopyFrom(const Histogram& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:prometheus.Histogram) if (&from == this) return; Clear(); MergeFrom(from); } -bool Sample::IsInitialized() const { +bool Histogram::IsInitialized() const { return true; } -void Sample::InternalSwap(Sample* other) { +void Histogram::InternalSwap(Histogram* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.negative_spans_.InternalSwap(&other->_impl_.negative_spans_); + _impl_.negative_deltas_.InternalSwap(&other->_impl_.negative_deltas_); + _impl_.negative_counts_.InternalSwap(&other->_impl_.negative_counts_); + _impl_.positive_spans_.InternalSwap(&other->_impl_.positive_spans_); + _impl_.positive_deltas_.InternalSwap(&other->_impl_.positive_deltas_); + _impl_.positive_counts_.InternalSwap(&other->_impl_.positive_counts_); + _impl_.custom_values_.InternalSwap(&other->_impl_.custom_values_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Sample, _impl_.timestamp_) - + sizeof(Sample::_impl_.timestamp_) - - PROTOBUF_FIELD_OFFSET(Sample, _impl_.value_)>( - reinterpret_cast(&_impl_.value_), - reinterpret_cast(&other->_impl_.value_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Sample::GetMetadata() const { + PROTOBUF_FIELD_OFFSET(Histogram, _impl_.timestamp_) + + sizeof(Histogram::_impl_.timestamp_) + - PROTOBUF_FIELD_OFFSET(Histogram, _impl_.sum_)>( + reinterpret_cast(&_impl_.sum_), + reinterpret_cast(&other->_impl_.sum_)); + swap(_impl_.count_, other->_impl_.count_); + swap(_impl_.zero_count_, other->_impl_.zero_count_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + swap(_impl_._oneof_case_[1], other->_impl_._oneof_case_[1]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Histogram::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[1]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[3]); } // =================================================================== -class Exemplar::_Internal { +class BucketSpan::_Internal { public: }; -Exemplar::Exemplar(::PROTOBUF_NAMESPACE_ID::Arena* arena, +BucketSpan::BucketSpan(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:prometheus.Exemplar) + // @@protoc_insertion_point(arena_constructor:prometheus.BucketSpan) } -Exemplar::Exemplar(const Exemplar& from) +BucketSpan::BucketSpan(const BucketSpan& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - Exemplar* const _this = this; (void)_this; + BucketSpan* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.labels_){from._impl_.labels_} - , decltype(_impl_.value_){} - , decltype(_impl_.timestamp_){} + decltype(_impl_.offset_){} + , decltype(_impl_.length_){} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.value_, &from._impl_.value_, - static_cast(reinterpret_cast(&_impl_.timestamp_) - - reinterpret_cast(&_impl_.value_)) + sizeof(_impl_.timestamp_)); - // @@protoc_insertion_point(copy_constructor:prometheus.Exemplar) + ::memcpy(&_impl_.offset_, &from._impl_.offset_, + static_cast(reinterpret_cast(&_impl_.length_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.length_)); + // @@protoc_insertion_point(copy_constructor:prometheus.BucketSpan) } -inline void Exemplar::SharedCtor( +inline void BucketSpan::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.labels_){arena} - , decltype(_impl_.value_){0} - , decltype(_impl_.timestamp_){int64_t{0}} + decltype(_impl_.offset_){0} + , decltype(_impl_.length_){0u} , /*decltype(_impl_._cached_size_)*/{} }; } -Exemplar::~Exemplar() { - // @@protoc_insertion_point(destructor:prometheus.Exemplar) +BucketSpan::~BucketSpan() { + // @@protoc_insertion_point(destructor:prometheus.BucketSpan) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -1029,59 +2169,44 @@ Exemplar::~Exemplar() { SharedDtor(); } -inline void Exemplar::SharedDtor() { +inline void BucketSpan::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.labels_.~RepeatedPtrField(); } -void Exemplar::SetCachedSize(int size) const { +void BucketSpan::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void Exemplar::Clear() { -// @@protoc_insertion_point(message_clear_start:prometheus.Exemplar) +void BucketSpan::Clear() { +// @@protoc_insertion_point(message_clear_start:prometheus.BucketSpan) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.labels_.Clear(); - ::memset(&_impl_.value_, 0, static_cast( - reinterpret_cast(&_impl_.timestamp_) - - reinterpret_cast(&_impl_.value_)) + sizeof(_impl_.timestamp_)); + ::memset(&_impl_.offset_, 0, static_cast( + reinterpret_cast(&_impl_.length_) - + reinterpret_cast(&_impl_.offset_)) + sizeof(_impl_.length_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Exemplar::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* BucketSpan::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // repeated .prometheus.Label labels = 1; + // sint32 offset = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_labels(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr)); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag32(&ptr); + CHK_(ptr); } else goto handle_unusual; continue; - // double value = 2; + // uint32 length = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 17)) { - _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); - ptr += sizeof(double); - } else - goto handle_unusual; - continue; - // int64 timestamp = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else goto handle_unusual; @@ -1109,132 +2234,103 @@ const char* Exemplar::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) #undef CHK_ } -uint8_t* Exemplar::_InternalSerialize( +uint8_t* BucketSpan::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:prometheus.Exemplar) + // @@protoc_insertion_point(serialize_to_array_start:prometheus.BucketSpan) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // repeated .prometheus.Label labels = 1; - for (unsigned i = 0, - n = static_cast(this->_internal_labels_size()); i < n; i++) { - const auto& repfield = this->_internal_labels(i); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream); - } - - // double value = 2; - static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_value = this->_internal_value(); - uint64_t raw_value; - memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); - if (raw_value != 0) { + // sint32 offset = 1; + if (this->_internal_offset() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_value(), target); + target = ::_pbi::WireFormatLite::WriteSInt32ToArray(1, this->_internal_offset(), target); } - // int64 timestamp = 3; - if (this->_internal_timestamp() != 0) { + // uint32 length = 2; + if (this->_internal_length() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_timestamp(), target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_length(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:prometheus.Exemplar) + // @@protoc_insertion_point(serialize_to_array_end:prometheus.BucketSpan) return target; } -size_t Exemplar::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:prometheus.Exemplar) +size_t BucketSpan::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:prometheus.BucketSpan) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .prometheus.Label labels = 1; - total_size += 1UL * this->_internal_labels_size(); - for (const auto& msg : this->_impl_.labels_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // double value = 2; - static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_value = this->_internal_value(); - uint64_t raw_value; - memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); - if (raw_value != 0) { - total_size += 1 + 8; + // sint32 offset = 1; + if (this->_internal_offset() != 0) { + total_size += ::_pbi::WireFormatLite::SInt32SizePlusOne(this->_internal_offset()); } - // int64 timestamp = 3; - if (this->_internal_timestamp() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp()); + // uint32 length = 2; + if (this->_internal_length() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_length()); } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Exemplar::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData BucketSpan::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Exemplar::MergeImpl + BucketSpan::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Exemplar::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*BucketSpan::GetClassData() const { return &_class_data_; } -void Exemplar::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:prometheus.Exemplar) +void BucketSpan::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:prometheus.BucketSpan) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.labels_.MergeFrom(from._impl_.labels_); - static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_value = from._internal_value(); - uint64_t raw_value; - memcpy(&raw_value, &tmp_value, sizeof(tmp_value)); - if (raw_value != 0) { - _this->_internal_set_value(from._internal_value()); + if (from._internal_offset() != 0) { + _this->_internal_set_offset(from._internal_offset()); } - if (from._internal_timestamp() != 0) { - _this->_internal_set_timestamp(from._internal_timestamp()); + if (from._internal_length() != 0) { + _this->_internal_set_length(from._internal_length()); } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void Exemplar::CopyFrom(const Exemplar& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:prometheus.Exemplar) +void BucketSpan::CopyFrom(const BucketSpan& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:prometheus.BucketSpan) if (&from == this) return; Clear(); MergeFrom(from); } -bool Exemplar::IsInitialized() const { +bool BucketSpan::IsInitialized() const { return true; } -void Exemplar::InternalSwap(Exemplar* other) { +void BucketSpan::InternalSwap(BucketSpan* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.labels_.InternalSwap(&other->_impl_.labels_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Exemplar, _impl_.timestamp_) - + sizeof(Exemplar::_impl_.timestamp_) - - PROTOBUF_FIELD_OFFSET(Exemplar, _impl_.value_)>( - reinterpret_cast(&_impl_.value_), - reinterpret_cast(&other->_impl_.value_)); + PROTOBUF_FIELD_OFFSET(BucketSpan, _impl_.length_) + + sizeof(BucketSpan::_impl_.length_) + - PROTOBUF_FIELD_OFFSET(BucketSpan, _impl_.offset_)>( + reinterpret_cast(&_impl_.offset_), + reinterpret_cast(&other->_impl_.offset_)); } -::PROTOBUF_NAMESPACE_ID::Metadata Exemplar::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata BucketSpan::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[2]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[4]); } // =================================================================== @@ -1256,6 +2352,7 @@ TimeSeries::TimeSeries(const TimeSeries& from) decltype(_impl_.labels_){from._impl_.labels_} , decltype(_impl_.samples_){from._impl_.samples_} , decltype(_impl_.exemplars_){from._impl_.exemplars_} + , decltype(_impl_.histograms_){from._impl_.histograms_} , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); @@ -1270,6 +2367,7 @@ inline void TimeSeries::SharedCtor( decltype(_impl_.labels_){arena} , decltype(_impl_.samples_){arena} , decltype(_impl_.exemplars_){arena} + , decltype(_impl_.histograms_){arena} , /*decltype(_impl_._cached_size_)*/{} }; } @@ -1288,6 +2386,7 @@ inline void TimeSeries::SharedDtor() { _impl_.labels_.~RepeatedPtrField(); _impl_.samples_.~RepeatedPtrField(); _impl_.exemplars_.~RepeatedPtrField(); + _impl_.histograms_.~RepeatedPtrField(); } void TimeSeries::SetCachedSize(int size) const { @@ -1303,6 +2402,7 @@ void TimeSeries::Clear() { _impl_.labels_.Clear(); _impl_.samples_.Clear(); _impl_.exemplars_.Clear(); + _impl_.histograms_.Clear(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1351,6 +2451,19 @@ const char* TimeSeries::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; + // repeated .prometheus.Histogram histograms = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_histograms(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; default: goto handle_unusual; } // switch @@ -1404,6 +2517,14 @@ uint8_t* TimeSeries::_InternalSerialize( InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } + // repeated .prometheus.Histogram histograms = 4; + for (unsigned i = 0, + n = static_cast(this->_internal_histograms_size()); i < n; i++) { + const auto& repfield = this->_internal_histograms(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -1441,6 +2562,13 @@ size_t TimeSeries::ByteSizeLong() const { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } + // repeated .prometheus.Histogram histograms = 4; + total_size += 1UL * this->_internal_histograms_size(); + for (const auto& msg : this->_impl_.histograms_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1462,6 +2590,7 @@ void TimeSeries::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO _this->_impl_.labels_.MergeFrom(from._impl_.labels_); _this->_impl_.samples_.MergeFrom(from._impl_.samples_); _this->_impl_.exemplars_.MergeFrom(from._impl_.exemplars_); + _this->_impl_.histograms_.MergeFrom(from._impl_.histograms_); _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -1482,12 +2611,13 @@ void TimeSeries::InternalSwap(TimeSeries* other) { _impl_.labels_.InternalSwap(&other->_impl_.labels_); _impl_.samples_.InternalSwap(&other->_impl_.samples_); _impl_.exemplars_.InternalSwap(&other->_impl_.exemplars_); + _impl_.histograms_.InternalSwap(&other->_impl_.histograms_); } ::PROTOBUF_NAMESPACE_ID::Metadata TimeSeries::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[3]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[5]); } // =================================================================== @@ -1740,7 +2870,7 @@ void Label::InternalSwap(Label* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Label::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[4]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[6]); } // =================================================================== @@ -1925,7 +3055,7 @@ void Labels::InternalSwap(Labels* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Labels::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[5]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[7]); } // =================================================================== @@ -2208,7 +3338,7 @@ void LabelMatcher::InternalSwap(LabelMatcher* other) { ::PROTOBUF_NAMESPACE_ID::Metadata LabelMatcher::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[6]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[8]); } // =================================================================== @@ -2582,7 +3712,7 @@ void ReadHints::InternalSwap(ReadHints* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ReadHints::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[7]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[9]); } // =================================================================== @@ -2867,7 +3997,7 @@ void Chunk::InternalSwap(Chunk* other) { ::PROTOBUF_NAMESPACE_ID::Metadata Chunk::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[8]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[10]); } // =================================================================== @@ -3086,7 +4216,7 @@ void ChunkedSeries::InternalSwap(ChunkedSeries* other) { ::PROTOBUF_NAMESPACE_ID::Metadata ChunkedSeries::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_prometheus_2fremote_2ftypes_2eproto_getter, &descriptor_table_prometheus_2fremote_2ftypes_2eproto_once, - file_level_metadata_prometheus_2fremote_2ftypes_2eproto[9]); + file_level_metadata_prometheus_2fremote_2ftypes_2eproto[11]); } // @@protoc_insertion_point(namespace_scope) @@ -3104,6 +4234,14 @@ template<> PROTOBUF_NOINLINE ::prometheus::Exemplar* Arena::CreateMaybeMessage< ::prometheus::Exemplar >(Arena* arena) { return Arena::CreateMessageInternal< ::prometheus::Exemplar >(arena); } +template<> PROTOBUF_NOINLINE ::prometheus::Histogram* +Arena::CreateMaybeMessage< ::prometheus::Histogram >(Arena* arena) { + return Arena::CreateMessageInternal< ::prometheus::Histogram >(arena); +} +template<> PROTOBUF_NOINLINE ::prometheus::BucketSpan* +Arena::CreateMaybeMessage< ::prometheus::BucketSpan >(Arena* arena) { + return Arena::CreateMessageInternal< ::prometheus::BucketSpan >(arena); +} template<> PROTOBUF_NOINLINE ::prometheus::TimeSeries* Arena::CreateMaybeMessage< ::prometheus::TimeSeries >(Arena* arena) { return Arena::CreateMessageInternal< ::prometheus::TimeSeries >(arena); diff --git a/c++/prometheus/remote/types.pb.h b/c++/prometheus/remote/types.pb.h index aee0b3c5..c09e97c5 100644 --- a/c++/prometheus/remote/types.pb.h +++ b/c++/prometheus/remote/types.pb.h @@ -46,6 +46,9 @@ struct TableStruct_prometheus_2fremote_2ftypes_2eproto { }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_prometheus_2fremote_2ftypes_2eproto; namespace prometheus { +class BucketSpan; +struct BucketSpanDefaultTypeInternal; +extern BucketSpanDefaultTypeInternal _BucketSpan_default_instance_; class Chunk; struct ChunkDefaultTypeInternal; extern ChunkDefaultTypeInternal _Chunk_default_instance_; @@ -55,6 +58,9 @@ extern ChunkedSeriesDefaultTypeInternal _ChunkedSeries_default_instance_; class Exemplar; struct ExemplarDefaultTypeInternal; extern ExemplarDefaultTypeInternal _Exemplar_default_instance_; +class Histogram; +struct HistogramDefaultTypeInternal; +extern HistogramDefaultTypeInternal _Histogram_default_instance_; class Label; struct LabelDefaultTypeInternal; extern LabelDefaultTypeInternal _Label_default_instance_; @@ -78,9 +84,11 @@ struct TimeSeriesDefaultTypeInternal; extern TimeSeriesDefaultTypeInternal _TimeSeries_default_instance_; } // namespace prometheus PROTOBUF_NAMESPACE_OPEN +template<> ::prometheus::BucketSpan* Arena::CreateMaybeMessage<::prometheus::BucketSpan>(Arena*); template<> ::prometheus::Chunk* Arena::CreateMaybeMessage<::prometheus::Chunk>(Arena*); template<> ::prometheus::ChunkedSeries* Arena::CreateMaybeMessage<::prometheus::ChunkedSeries>(Arena*); template<> ::prometheus::Exemplar* Arena::CreateMaybeMessage<::prometheus::Exemplar>(Arena*); +template<> ::prometheus::Histogram* Arena::CreateMaybeMessage<::prometheus::Histogram>(Arena*); template<> ::prometheus::Label* Arena::CreateMaybeMessage<::prometheus::Label>(Arena*); template<> ::prometheus::LabelMatcher* Arena::CreateMaybeMessage<::prometheus::LabelMatcher>(Arena*); template<> ::prometheus::Labels* Arena::CreateMaybeMessage<::prometheus::Labels>(Arena*); @@ -122,6 +130,33 @@ inline bool MetricMetadata_MetricType_Parse( return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( MetricMetadata_MetricType_descriptor(), name, value); } +enum Histogram_ResetHint : int { + Histogram_ResetHint_UNKNOWN = 0, + Histogram_ResetHint_YES = 1, + Histogram_ResetHint_NO = 2, + Histogram_ResetHint_GAUGE = 3, + Histogram_ResetHint_Histogram_ResetHint_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + Histogram_ResetHint_Histogram_ResetHint_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool Histogram_ResetHint_IsValid(int value); +constexpr Histogram_ResetHint Histogram_ResetHint_ResetHint_MIN = Histogram_ResetHint_UNKNOWN; +constexpr Histogram_ResetHint Histogram_ResetHint_ResetHint_MAX = Histogram_ResetHint_GAUGE; +constexpr int Histogram_ResetHint_ResetHint_ARRAYSIZE = Histogram_ResetHint_ResetHint_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Histogram_ResetHint_descriptor(); +template +inline const std::string& Histogram_ResetHint_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Histogram_ResetHint_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Histogram_ResetHint_descriptor(), enum_t_value); +} +inline bool Histogram_ResetHint_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Histogram_ResetHint* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Histogram_ResetHint_descriptor(), name, value); +} enum LabelMatcher_Type : int { LabelMatcher_Type_EQ = 0, LabelMatcher_Type_NEQ = 1, @@ -152,12 +187,14 @@ inline bool LabelMatcher_Type_Parse( enum Chunk_Encoding : int { Chunk_Encoding_UNKNOWN = 0, Chunk_Encoding_XOR = 1, + Chunk_Encoding_HISTOGRAM = 2, + Chunk_Encoding_FLOAT_HISTOGRAM = 3, Chunk_Encoding_Chunk_Encoding_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), Chunk_Encoding_Chunk_Encoding_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool Chunk_Encoding_IsValid(int value); constexpr Chunk_Encoding Chunk_Encoding_Encoding_MIN = Chunk_Encoding_UNKNOWN; -constexpr Chunk_Encoding Chunk_Encoding_Encoding_MAX = Chunk_Encoding_XOR; +constexpr Chunk_Encoding Chunk_Encoding_Encoding_MAX = Chunk_Encoding_FLOAT_HISTOGRAM; constexpr int Chunk_Encoding_Encoding_ARRAYSIZE = Chunk_Encoding_Encoding_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Chunk_Encoding_descriptor(); @@ -716,25 +753,669 @@ class Exemplar final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Label >& labels() const; - // double value = 2; - void clear_value(); - double value() const; - void set_value(double value); + // double value = 2; + void clear_value(); + double value() const; + void set_value(double value); + private: + double _internal_value() const; + void _internal_set_value(double value); + public: + + // int64 timestamp = 3; + void clear_timestamp(); + int64_t timestamp() const; + void set_timestamp(int64_t value); + private: + int64_t _internal_timestamp() const; + void _internal_set_timestamp(int64_t value); + public: + + // @@protoc_insertion_point(class_scope:prometheus.Exemplar) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Label > labels_; + double value_; + int64_t timestamp_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_prometheus_2fremote_2ftypes_2eproto; +}; +// ------------------------------------------------------------------- + +class Histogram final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:prometheus.Histogram) */ { + public: + inline Histogram() : Histogram(nullptr) {} + ~Histogram() override; + explicit PROTOBUF_CONSTEXPR Histogram(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Histogram(const Histogram& from); + Histogram(Histogram&& from) noexcept + : Histogram() { + *this = ::std::move(from); + } + + inline Histogram& operator=(const Histogram& from) { + CopyFrom(from); + return *this; + } + inline Histogram& operator=(Histogram&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Histogram& default_instance() { + return *internal_default_instance(); + } + enum CountCase { + kCountInt = 1, + kCountFloat = 2, + COUNT_NOT_SET = 0, + }; + + enum ZeroCountCase { + kZeroCountInt = 6, + kZeroCountFloat = 7, + ZERO_COUNT_NOT_SET = 0, + }; + + static inline const Histogram* internal_default_instance() { + return reinterpret_cast( + &_Histogram_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(Histogram& a, Histogram& b) { + a.Swap(&b); + } + inline void Swap(Histogram* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Histogram* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Histogram* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Histogram& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Histogram& from) { + Histogram::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Histogram* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "prometheus.Histogram"; + } + protected: + explicit Histogram(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + typedef Histogram_ResetHint ResetHint; + static constexpr ResetHint UNKNOWN = + Histogram_ResetHint_UNKNOWN; + static constexpr ResetHint YES = + Histogram_ResetHint_YES; + static constexpr ResetHint NO = + Histogram_ResetHint_NO; + static constexpr ResetHint GAUGE = + Histogram_ResetHint_GAUGE; + static inline bool ResetHint_IsValid(int value) { + return Histogram_ResetHint_IsValid(value); + } + static constexpr ResetHint ResetHint_MIN = + Histogram_ResetHint_ResetHint_MIN; + static constexpr ResetHint ResetHint_MAX = + Histogram_ResetHint_ResetHint_MAX; + static constexpr int ResetHint_ARRAYSIZE = + Histogram_ResetHint_ResetHint_ARRAYSIZE; + static inline const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* + ResetHint_descriptor() { + return Histogram_ResetHint_descriptor(); + } + template + static inline const std::string& ResetHint_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function ResetHint_Name."); + return Histogram_ResetHint_Name(enum_t_value); + } + static inline bool ResetHint_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name, + ResetHint* value) { + return Histogram_ResetHint_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + enum : int { + kNegativeSpansFieldNumber = 8, + kNegativeDeltasFieldNumber = 9, + kNegativeCountsFieldNumber = 10, + kPositiveSpansFieldNumber = 11, + kPositiveDeltasFieldNumber = 12, + kPositiveCountsFieldNumber = 13, + kCustomValuesFieldNumber = 16, + kSumFieldNumber = 3, + kZeroThresholdFieldNumber = 5, + kSchemaFieldNumber = 4, + kResetHintFieldNumber = 14, + kTimestampFieldNumber = 15, + kCountIntFieldNumber = 1, + kCountFloatFieldNumber = 2, + kZeroCountIntFieldNumber = 6, + kZeroCountFloatFieldNumber = 7, + }; + // repeated .prometheus.BucketSpan negative_spans = 8; + int negative_spans_size() const; + private: + int _internal_negative_spans_size() const; + public: + void clear_negative_spans(); + ::prometheus::BucketSpan* mutable_negative_spans(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >* + mutable_negative_spans(); + private: + const ::prometheus::BucketSpan& _internal_negative_spans(int index) const; + ::prometheus::BucketSpan* _internal_add_negative_spans(); + public: + const ::prometheus::BucketSpan& negative_spans(int index) const; + ::prometheus::BucketSpan* add_negative_spans(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >& + negative_spans() const; + + // repeated sint64 negative_deltas = 9; + int negative_deltas_size() const; + private: + int _internal_negative_deltas_size() const; + public: + void clear_negative_deltas(); + private: + int64_t _internal_negative_deltas(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& + _internal_negative_deltas() const; + void _internal_add_negative_deltas(int64_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* + _internal_mutable_negative_deltas(); + public: + int64_t negative_deltas(int index) const; + void set_negative_deltas(int index, int64_t value); + void add_negative_deltas(int64_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& + negative_deltas() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* + mutable_negative_deltas(); + + // repeated double negative_counts = 10; + int negative_counts_size() const; + private: + int _internal_negative_counts_size() const; + public: + void clear_negative_counts(); + private: + double _internal_negative_counts(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& + _internal_negative_counts() const; + void _internal_add_negative_counts(double value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* + _internal_mutable_negative_counts(); + public: + double negative_counts(int index) const; + void set_negative_counts(int index, double value); + void add_negative_counts(double value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& + negative_counts() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* + mutable_negative_counts(); + + // repeated .prometheus.BucketSpan positive_spans = 11; + int positive_spans_size() const; + private: + int _internal_positive_spans_size() const; + public: + void clear_positive_spans(); + ::prometheus::BucketSpan* mutable_positive_spans(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >* + mutable_positive_spans(); + private: + const ::prometheus::BucketSpan& _internal_positive_spans(int index) const; + ::prometheus::BucketSpan* _internal_add_positive_spans(); + public: + const ::prometheus::BucketSpan& positive_spans(int index) const; + ::prometheus::BucketSpan* add_positive_spans(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >& + positive_spans() const; + + // repeated sint64 positive_deltas = 12; + int positive_deltas_size() const; + private: + int _internal_positive_deltas_size() const; + public: + void clear_positive_deltas(); + private: + int64_t _internal_positive_deltas(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& + _internal_positive_deltas() const; + void _internal_add_positive_deltas(int64_t value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* + _internal_mutable_positive_deltas(); + public: + int64_t positive_deltas(int index) const; + void set_positive_deltas(int index, int64_t value); + void add_positive_deltas(int64_t value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& + positive_deltas() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* + mutable_positive_deltas(); + + // repeated double positive_counts = 13; + int positive_counts_size() const; + private: + int _internal_positive_counts_size() const; + public: + void clear_positive_counts(); + private: + double _internal_positive_counts(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& + _internal_positive_counts() const; + void _internal_add_positive_counts(double value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* + _internal_mutable_positive_counts(); + public: + double positive_counts(int index) const; + void set_positive_counts(int index, double value); + void add_positive_counts(double value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& + positive_counts() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* + mutable_positive_counts(); + + // repeated double custom_values = 16; + int custom_values_size() const; + private: + int _internal_custom_values_size() const; + public: + void clear_custom_values(); + private: + double _internal_custom_values(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& + _internal_custom_values() const; + void _internal_add_custom_values(double value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* + _internal_mutable_custom_values(); + public: + double custom_values(int index) const; + void set_custom_values(int index, double value); + void add_custom_values(double value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& + custom_values() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* + mutable_custom_values(); + + // double sum = 3; + void clear_sum(); + double sum() const; + void set_sum(double value); + private: + double _internal_sum() const; + void _internal_set_sum(double value); + public: + + // double zero_threshold = 5; + void clear_zero_threshold(); + double zero_threshold() const; + void set_zero_threshold(double value); + private: + double _internal_zero_threshold() const; + void _internal_set_zero_threshold(double value); + public: + + // sint32 schema = 4; + void clear_schema(); + int32_t schema() const; + void set_schema(int32_t value); + private: + int32_t _internal_schema() const; + void _internal_set_schema(int32_t value); + public: + + // .prometheus.Histogram.ResetHint reset_hint = 14; + void clear_reset_hint(); + ::prometheus::Histogram_ResetHint reset_hint() const; + void set_reset_hint(::prometheus::Histogram_ResetHint value); + private: + ::prometheus::Histogram_ResetHint _internal_reset_hint() const; + void _internal_set_reset_hint(::prometheus::Histogram_ResetHint value); + public: + + // int64 timestamp = 15; + void clear_timestamp(); + int64_t timestamp() const; + void set_timestamp(int64_t value); + private: + int64_t _internal_timestamp() const; + void _internal_set_timestamp(int64_t value); + public: + + // uint64 count_int = 1; + bool has_count_int() const; + private: + bool _internal_has_count_int() const; + public: + void clear_count_int(); + uint64_t count_int() const; + void set_count_int(uint64_t value); + private: + uint64_t _internal_count_int() const; + void _internal_set_count_int(uint64_t value); + public: + + // double count_float = 2; + bool has_count_float() const; + private: + bool _internal_has_count_float() const; + public: + void clear_count_float(); + double count_float() const; + void set_count_float(double value); + private: + double _internal_count_float() const; + void _internal_set_count_float(double value); + public: + + // uint64 zero_count_int = 6; + bool has_zero_count_int() const; + private: + bool _internal_has_zero_count_int() const; + public: + void clear_zero_count_int(); + uint64_t zero_count_int() const; + void set_zero_count_int(uint64_t value); + private: + uint64_t _internal_zero_count_int() const; + void _internal_set_zero_count_int(uint64_t value); + public: + + // double zero_count_float = 7; + bool has_zero_count_float() const; + private: + bool _internal_has_zero_count_float() const; + public: + void clear_zero_count_float(); + double zero_count_float() const; + void set_zero_count_float(double value); + private: + double _internal_zero_count_float() const; + void _internal_set_zero_count_float(double value); + public: + + void clear_count(); + CountCase count_case() const; + void clear_zero_count(); + ZeroCountCase zero_count_case() const; + // @@protoc_insertion_point(class_scope:prometheus.Histogram) + private: + class _Internal; + void set_has_count_int(); + void set_has_count_float(); + void set_has_zero_count_int(); + void set_has_zero_count_float(); + + inline bool has_count() const; + inline void clear_has_count(); + + inline bool has_zero_count() const; + inline void clear_has_zero_count(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan > negative_spans_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > negative_deltas_; + mutable std::atomic _negative_deltas_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > negative_counts_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan > positive_spans_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t > positive_deltas_; + mutable std::atomic _positive_deltas_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > positive_counts_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > custom_values_; + double sum_; + double zero_threshold_; + int32_t schema_; + int reset_hint_; + int64_t timestamp_; + union CountUnion { + constexpr CountUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + uint64_t count_int_; + double count_float_; + } count_; + union ZeroCountUnion { + constexpr ZeroCountUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + uint64_t zero_count_int_; + double zero_count_float_; + } zero_count_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[2]; + + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_prometheus_2fremote_2ftypes_2eproto; +}; +// ------------------------------------------------------------------- + +class BucketSpan final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:prometheus.BucketSpan) */ { + public: + inline BucketSpan() : BucketSpan(nullptr) {} + ~BucketSpan() override; + explicit PROTOBUF_CONSTEXPR BucketSpan(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + BucketSpan(const BucketSpan& from); + BucketSpan(BucketSpan&& from) noexcept + : BucketSpan() { + *this = ::std::move(from); + } + + inline BucketSpan& operator=(const BucketSpan& from) { + CopyFrom(from); + return *this; + } + inline BucketSpan& operator=(BucketSpan&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const BucketSpan& default_instance() { + return *internal_default_instance(); + } + static inline const BucketSpan* internal_default_instance() { + return reinterpret_cast( + &_BucketSpan_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(BucketSpan& a, BucketSpan& b) { + a.Swap(&b); + } + inline void Swap(BucketSpan* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(BucketSpan* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + BucketSpan* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const BucketSpan& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const BucketSpan& from) { + BucketSpan::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(BucketSpan* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "prometheus.BucketSpan"; + } + protected: + explicit BucketSpan(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kOffsetFieldNumber = 1, + kLengthFieldNumber = 2, + }; + // sint32 offset = 1; + void clear_offset(); + int32_t offset() const; + void set_offset(int32_t value); private: - double _internal_value() const; - void _internal_set_value(double value); + int32_t _internal_offset() const; + void _internal_set_offset(int32_t value); public: - // int64 timestamp = 3; - void clear_timestamp(); - int64_t timestamp() const; - void set_timestamp(int64_t value); + // uint32 length = 2; + void clear_length(); + uint32_t length() const; + void set_length(uint32_t value); private: - int64_t _internal_timestamp() const; - void _internal_set_timestamp(int64_t value); + uint32_t _internal_length() const; + void _internal_set_length(uint32_t value); public: - // @@protoc_insertion_point(class_scope:prometheus.Exemplar) + // @@protoc_insertion_point(class_scope:prometheus.BucketSpan) private: class _Internal; @@ -742,9 +1423,8 @@ class Exemplar final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Label > labels_; - double value_; - int64_t timestamp_; + int32_t offset_; + uint32_t length_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -800,7 +1480,7 @@ class TimeSeries final : &_TimeSeries_default_instance_); } static constexpr int kIndexInFileMessages = - 3; + 5; friend void swap(TimeSeries& a, TimeSeries& b) { a.Swap(&b); @@ -876,6 +1556,7 @@ class TimeSeries final : kLabelsFieldNumber = 1, kSamplesFieldNumber = 2, kExemplarsFieldNumber = 3, + kHistogramsFieldNumber = 4, }; // repeated .prometheus.Label labels = 1; int labels_size() const; @@ -931,6 +1612,24 @@ class TimeSeries final : const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Exemplar >& exemplars() const; + // repeated .prometheus.Histogram histograms = 4; + int histograms_size() const; + private: + int _internal_histograms_size() const; + public: + void clear_histograms(); + ::prometheus::Histogram* mutable_histograms(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Histogram >* + mutable_histograms(); + private: + const ::prometheus::Histogram& _internal_histograms(int index) const; + ::prometheus::Histogram* _internal_add_histograms(); + public: + const ::prometheus::Histogram& histograms(int index) const; + ::prometheus::Histogram* add_histograms(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Histogram >& + histograms() const; + // @@protoc_insertion_point(class_scope:prometheus.TimeSeries) private: class _Internal; @@ -942,6 +1641,7 @@ class TimeSeries final : ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Label > labels_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Sample > samples_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Exemplar > exemplars_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Histogram > histograms_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union { Impl_ _impl_; }; @@ -997,7 +1697,7 @@ class Label final : &_Label_default_instance_); } static constexpr int kIndexInFileMessages = - 4; + 6; friend void swap(Label& a, Label& b) { a.Swap(&b); @@ -1166,7 +1866,7 @@ class Labels final : &_Labels_default_instance_); } static constexpr int kIndexInFileMessages = - 5; + 7; friend void swap(Labels& a, Labels& b) { a.Swap(&b); @@ -1323,7 +2023,7 @@ class LabelMatcher final : &_LabelMatcher_default_instance_); } static constexpr int kIndexInFileMessages = - 6; + 8; friend void swap(LabelMatcher& a, LabelMatcher& b) { a.Swap(&b); @@ -1537,7 +2237,7 @@ class ReadHints final : &_ReadHints_default_instance_); } static constexpr int kIndexInFileMessages = - 7; + 9; friend void swap(ReadHints& a, ReadHints& b) { a.Swap(&b); @@ -1771,7 +2471,7 @@ class Chunk final : &_Chunk_default_instance_); } static constexpr int kIndexInFileMessages = - 8; + 10; friend void swap(Chunk& a, Chunk& b) { a.Swap(&b); @@ -1846,6 +2546,10 @@ class Chunk final : Chunk_Encoding_UNKNOWN; static constexpr Encoding XOR = Chunk_Encoding_XOR; + static constexpr Encoding HISTOGRAM = + Chunk_Encoding_HISTOGRAM; + static constexpr Encoding FLOAT_HISTOGRAM = + Chunk_Encoding_FLOAT_HISTOGRAM; static inline bool Encoding_IsValid(int value) { return Chunk_Encoding_IsValid(value); } @@ -1987,7 +2691,7 @@ class ChunkedSeries final : &_ChunkedSeries_default_instance_); } static constexpr int kIndexInFileMessages = - 9; + 11; friend void swap(ChunkedSeries& a, ChunkedSeries& b) { a.Swap(&b); @@ -2425,6 +3129,639 @@ inline void Exemplar::set_timestamp(int64_t value) { // ------------------------------------------------------------------- +// Histogram + +// uint64 count_int = 1; +inline bool Histogram::_internal_has_count_int() const { + return count_case() == kCountInt; +} +inline bool Histogram::has_count_int() const { + return _internal_has_count_int(); +} +inline void Histogram::set_has_count_int() { + _impl_._oneof_case_[0] = kCountInt; +} +inline void Histogram::clear_count_int() { + if (_internal_has_count_int()) { + _impl_.count_.count_int_ = uint64_t{0u}; + clear_has_count(); + } +} +inline uint64_t Histogram::_internal_count_int() const { + if (_internal_has_count_int()) { + return _impl_.count_.count_int_; + } + return uint64_t{0u}; +} +inline void Histogram::_internal_set_count_int(uint64_t value) { + if (!_internal_has_count_int()) { + clear_count(); + set_has_count_int(); + } + _impl_.count_.count_int_ = value; +} +inline uint64_t Histogram::count_int() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.count_int) + return _internal_count_int(); +} +inline void Histogram::set_count_int(uint64_t value) { + _internal_set_count_int(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.count_int) +} + +// double count_float = 2; +inline bool Histogram::_internal_has_count_float() const { + return count_case() == kCountFloat; +} +inline bool Histogram::has_count_float() const { + return _internal_has_count_float(); +} +inline void Histogram::set_has_count_float() { + _impl_._oneof_case_[0] = kCountFloat; +} +inline void Histogram::clear_count_float() { + if (_internal_has_count_float()) { + _impl_.count_.count_float_ = 0; + clear_has_count(); + } +} +inline double Histogram::_internal_count_float() const { + if (_internal_has_count_float()) { + return _impl_.count_.count_float_; + } + return 0; +} +inline void Histogram::_internal_set_count_float(double value) { + if (!_internal_has_count_float()) { + clear_count(); + set_has_count_float(); + } + _impl_.count_.count_float_ = value; +} +inline double Histogram::count_float() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.count_float) + return _internal_count_float(); +} +inline void Histogram::set_count_float(double value) { + _internal_set_count_float(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.count_float) +} + +// double sum = 3; +inline void Histogram::clear_sum() { + _impl_.sum_ = 0; +} +inline double Histogram::_internal_sum() const { + return _impl_.sum_; +} +inline double Histogram::sum() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.sum) + return _internal_sum(); +} +inline void Histogram::_internal_set_sum(double value) { + + _impl_.sum_ = value; +} +inline void Histogram::set_sum(double value) { + _internal_set_sum(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.sum) +} + +// sint32 schema = 4; +inline void Histogram::clear_schema() { + _impl_.schema_ = 0; +} +inline int32_t Histogram::_internal_schema() const { + return _impl_.schema_; +} +inline int32_t Histogram::schema() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.schema) + return _internal_schema(); +} +inline void Histogram::_internal_set_schema(int32_t value) { + + _impl_.schema_ = value; +} +inline void Histogram::set_schema(int32_t value) { + _internal_set_schema(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.schema) +} + +// double zero_threshold = 5; +inline void Histogram::clear_zero_threshold() { + _impl_.zero_threshold_ = 0; +} +inline double Histogram::_internal_zero_threshold() const { + return _impl_.zero_threshold_; +} +inline double Histogram::zero_threshold() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.zero_threshold) + return _internal_zero_threshold(); +} +inline void Histogram::_internal_set_zero_threshold(double value) { + + _impl_.zero_threshold_ = value; +} +inline void Histogram::set_zero_threshold(double value) { + _internal_set_zero_threshold(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.zero_threshold) +} + +// uint64 zero_count_int = 6; +inline bool Histogram::_internal_has_zero_count_int() const { + return zero_count_case() == kZeroCountInt; +} +inline bool Histogram::has_zero_count_int() const { + return _internal_has_zero_count_int(); +} +inline void Histogram::set_has_zero_count_int() { + _impl_._oneof_case_[1] = kZeroCountInt; +} +inline void Histogram::clear_zero_count_int() { + if (_internal_has_zero_count_int()) { + _impl_.zero_count_.zero_count_int_ = uint64_t{0u}; + clear_has_zero_count(); + } +} +inline uint64_t Histogram::_internal_zero_count_int() const { + if (_internal_has_zero_count_int()) { + return _impl_.zero_count_.zero_count_int_; + } + return uint64_t{0u}; +} +inline void Histogram::_internal_set_zero_count_int(uint64_t value) { + if (!_internal_has_zero_count_int()) { + clear_zero_count(); + set_has_zero_count_int(); + } + _impl_.zero_count_.zero_count_int_ = value; +} +inline uint64_t Histogram::zero_count_int() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.zero_count_int) + return _internal_zero_count_int(); +} +inline void Histogram::set_zero_count_int(uint64_t value) { + _internal_set_zero_count_int(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.zero_count_int) +} + +// double zero_count_float = 7; +inline bool Histogram::_internal_has_zero_count_float() const { + return zero_count_case() == kZeroCountFloat; +} +inline bool Histogram::has_zero_count_float() const { + return _internal_has_zero_count_float(); +} +inline void Histogram::set_has_zero_count_float() { + _impl_._oneof_case_[1] = kZeroCountFloat; +} +inline void Histogram::clear_zero_count_float() { + if (_internal_has_zero_count_float()) { + _impl_.zero_count_.zero_count_float_ = 0; + clear_has_zero_count(); + } +} +inline double Histogram::_internal_zero_count_float() const { + if (_internal_has_zero_count_float()) { + return _impl_.zero_count_.zero_count_float_; + } + return 0; +} +inline void Histogram::_internal_set_zero_count_float(double value) { + if (!_internal_has_zero_count_float()) { + clear_zero_count(); + set_has_zero_count_float(); + } + _impl_.zero_count_.zero_count_float_ = value; +} +inline double Histogram::zero_count_float() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.zero_count_float) + return _internal_zero_count_float(); +} +inline void Histogram::set_zero_count_float(double value) { + _internal_set_zero_count_float(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.zero_count_float) +} + +// repeated .prometheus.BucketSpan negative_spans = 8; +inline int Histogram::_internal_negative_spans_size() const { + return _impl_.negative_spans_.size(); +} +inline int Histogram::negative_spans_size() const { + return _internal_negative_spans_size(); +} +inline void Histogram::clear_negative_spans() { + _impl_.negative_spans_.Clear(); +} +inline ::prometheus::BucketSpan* Histogram::mutable_negative_spans(int index) { + // @@protoc_insertion_point(field_mutable:prometheus.Histogram.negative_spans) + return _impl_.negative_spans_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >* +Histogram::mutable_negative_spans() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.negative_spans) + return &_impl_.negative_spans_; +} +inline const ::prometheus::BucketSpan& Histogram::_internal_negative_spans(int index) const { + return _impl_.negative_spans_.Get(index); +} +inline const ::prometheus::BucketSpan& Histogram::negative_spans(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.negative_spans) + return _internal_negative_spans(index); +} +inline ::prometheus::BucketSpan* Histogram::_internal_add_negative_spans() { + return _impl_.negative_spans_.Add(); +} +inline ::prometheus::BucketSpan* Histogram::add_negative_spans() { + ::prometheus::BucketSpan* _add = _internal_add_negative_spans(); + // @@protoc_insertion_point(field_add:prometheus.Histogram.negative_spans) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >& +Histogram::negative_spans() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.negative_spans) + return _impl_.negative_spans_; +} + +// repeated sint64 negative_deltas = 9; +inline int Histogram::_internal_negative_deltas_size() const { + return _impl_.negative_deltas_.size(); +} +inline int Histogram::negative_deltas_size() const { + return _internal_negative_deltas_size(); +} +inline void Histogram::clear_negative_deltas() { + _impl_.negative_deltas_.Clear(); +} +inline int64_t Histogram::_internal_negative_deltas(int index) const { + return _impl_.negative_deltas_.Get(index); +} +inline int64_t Histogram::negative_deltas(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.negative_deltas) + return _internal_negative_deltas(index); +} +inline void Histogram::set_negative_deltas(int index, int64_t value) { + _impl_.negative_deltas_.Set(index, value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.negative_deltas) +} +inline void Histogram::_internal_add_negative_deltas(int64_t value) { + _impl_.negative_deltas_.Add(value); +} +inline void Histogram::add_negative_deltas(int64_t value) { + _internal_add_negative_deltas(value); + // @@protoc_insertion_point(field_add:prometheus.Histogram.negative_deltas) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& +Histogram::_internal_negative_deltas() const { + return _impl_.negative_deltas_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& +Histogram::negative_deltas() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.negative_deltas) + return _internal_negative_deltas(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* +Histogram::_internal_mutable_negative_deltas() { + return &_impl_.negative_deltas_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* +Histogram::mutable_negative_deltas() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.negative_deltas) + return _internal_mutable_negative_deltas(); +} + +// repeated double negative_counts = 10; +inline int Histogram::_internal_negative_counts_size() const { + return _impl_.negative_counts_.size(); +} +inline int Histogram::negative_counts_size() const { + return _internal_negative_counts_size(); +} +inline void Histogram::clear_negative_counts() { + _impl_.negative_counts_.Clear(); +} +inline double Histogram::_internal_negative_counts(int index) const { + return _impl_.negative_counts_.Get(index); +} +inline double Histogram::negative_counts(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.negative_counts) + return _internal_negative_counts(index); +} +inline void Histogram::set_negative_counts(int index, double value) { + _impl_.negative_counts_.Set(index, value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.negative_counts) +} +inline void Histogram::_internal_add_negative_counts(double value) { + _impl_.negative_counts_.Add(value); +} +inline void Histogram::add_negative_counts(double value) { + _internal_add_negative_counts(value); + // @@protoc_insertion_point(field_add:prometheus.Histogram.negative_counts) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& +Histogram::_internal_negative_counts() const { + return _impl_.negative_counts_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& +Histogram::negative_counts() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.negative_counts) + return _internal_negative_counts(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* +Histogram::_internal_mutable_negative_counts() { + return &_impl_.negative_counts_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* +Histogram::mutable_negative_counts() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.negative_counts) + return _internal_mutable_negative_counts(); +} + +// repeated .prometheus.BucketSpan positive_spans = 11; +inline int Histogram::_internal_positive_spans_size() const { + return _impl_.positive_spans_.size(); +} +inline int Histogram::positive_spans_size() const { + return _internal_positive_spans_size(); +} +inline void Histogram::clear_positive_spans() { + _impl_.positive_spans_.Clear(); +} +inline ::prometheus::BucketSpan* Histogram::mutable_positive_spans(int index) { + // @@protoc_insertion_point(field_mutable:prometheus.Histogram.positive_spans) + return _impl_.positive_spans_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >* +Histogram::mutable_positive_spans() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.positive_spans) + return &_impl_.positive_spans_; +} +inline const ::prometheus::BucketSpan& Histogram::_internal_positive_spans(int index) const { + return _impl_.positive_spans_.Get(index); +} +inline const ::prometheus::BucketSpan& Histogram::positive_spans(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.positive_spans) + return _internal_positive_spans(index); +} +inline ::prometheus::BucketSpan* Histogram::_internal_add_positive_spans() { + return _impl_.positive_spans_.Add(); +} +inline ::prometheus::BucketSpan* Histogram::add_positive_spans() { + ::prometheus::BucketSpan* _add = _internal_add_positive_spans(); + // @@protoc_insertion_point(field_add:prometheus.Histogram.positive_spans) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::BucketSpan >& +Histogram::positive_spans() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.positive_spans) + return _impl_.positive_spans_; +} + +// repeated sint64 positive_deltas = 12; +inline int Histogram::_internal_positive_deltas_size() const { + return _impl_.positive_deltas_.size(); +} +inline int Histogram::positive_deltas_size() const { + return _internal_positive_deltas_size(); +} +inline void Histogram::clear_positive_deltas() { + _impl_.positive_deltas_.Clear(); +} +inline int64_t Histogram::_internal_positive_deltas(int index) const { + return _impl_.positive_deltas_.Get(index); +} +inline int64_t Histogram::positive_deltas(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.positive_deltas) + return _internal_positive_deltas(index); +} +inline void Histogram::set_positive_deltas(int index, int64_t value) { + _impl_.positive_deltas_.Set(index, value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.positive_deltas) +} +inline void Histogram::_internal_add_positive_deltas(int64_t value) { + _impl_.positive_deltas_.Add(value); +} +inline void Histogram::add_positive_deltas(int64_t value) { + _internal_add_positive_deltas(value); + // @@protoc_insertion_point(field_add:prometheus.Histogram.positive_deltas) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& +Histogram::_internal_positive_deltas() const { + return _impl_.positive_deltas_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >& +Histogram::positive_deltas() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.positive_deltas) + return _internal_positive_deltas(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* +Histogram::_internal_mutable_positive_deltas() { + return &_impl_.positive_deltas_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< int64_t >* +Histogram::mutable_positive_deltas() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.positive_deltas) + return _internal_mutable_positive_deltas(); +} + +// repeated double positive_counts = 13; +inline int Histogram::_internal_positive_counts_size() const { + return _impl_.positive_counts_.size(); +} +inline int Histogram::positive_counts_size() const { + return _internal_positive_counts_size(); +} +inline void Histogram::clear_positive_counts() { + _impl_.positive_counts_.Clear(); +} +inline double Histogram::_internal_positive_counts(int index) const { + return _impl_.positive_counts_.Get(index); +} +inline double Histogram::positive_counts(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.positive_counts) + return _internal_positive_counts(index); +} +inline void Histogram::set_positive_counts(int index, double value) { + _impl_.positive_counts_.Set(index, value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.positive_counts) +} +inline void Histogram::_internal_add_positive_counts(double value) { + _impl_.positive_counts_.Add(value); +} +inline void Histogram::add_positive_counts(double value) { + _internal_add_positive_counts(value); + // @@protoc_insertion_point(field_add:prometheus.Histogram.positive_counts) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& +Histogram::_internal_positive_counts() const { + return _impl_.positive_counts_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& +Histogram::positive_counts() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.positive_counts) + return _internal_positive_counts(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* +Histogram::_internal_mutable_positive_counts() { + return &_impl_.positive_counts_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* +Histogram::mutable_positive_counts() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.positive_counts) + return _internal_mutable_positive_counts(); +} + +// .prometheus.Histogram.ResetHint reset_hint = 14; +inline void Histogram::clear_reset_hint() { + _impl_.reset_hint_ = 0; +} +inline ::prometheus::Histogram_ResetHint Histogram::_internal_reset_hint() const { + return static_cast< ::prometheus::Histogram_ResetHint >(_impl_.reset_hint_); +} +inline ::prometheus::Histogram_ResetHint Histogram::reset_hint() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.reset_hint) + return _internal_reset_hint(); +} +inline void Histogram::_internal_set_reset_hint(::prometheus::Histogram_ResetHint value) { + + _impl_.reset_hint_ = value; +} +inline void Histogram::set_reset_hint(::prometheus::Histogram_ResetHint value) { + _internal_set_reset_hint(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.reset_hint) +} + +// int64 timestamp = 15; +inline void Histogram::clear_timestamp() { + _impl_.timestamp_ = int64_t{0}; +} +inline int64_t Histogram::_internal_timestamp() const { + return _impl_.timestamp_; +} +inline int64_t Histogram::timestamp() const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.timestamp) + return _internal_timestamp(); +} +inline void Histogram::_internal_set_timestamp(int64_t value) { + + _impl_.timestamp_ = value; +} +inline void Histogram::set_timestamp(int64_t value) { + _internal_set_timestamp(value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.timestamp) +} + +// repeated double custom_values = 16; +inline int Histogram::_internal_custom_values_size() const { + return _impl_.custom_values_.size(); +} +inline int Histogram::custom_values_size() const { + return _internal_custom_values_size(); +} +inline void Histogram::clear_custom_values() { + _impl_.custom_values_.Clear(); +} +inline double Histogram::_internal_custom_values(int index) const { + return _impl_.custom_values_.Get(index); +} +inline double Histogram::custom_values(int index) const { + // @@protoc_insertion_point(field_get:prometheus.Histogram.custom_values) + return _internal_custom_values(index); +} +inline void Histogram::set_custom_values(int index, double value) { + _impl_.custom_values_.Set(index, value); + // @@protoc_insertion_point(field_set:prometheus.Histogram.custom_values) +} +inline void Histogram::_internal_add_custom_values(double value) { + _impl_.custom_values_.Add(value); +} +inline void Histogram::add_custom_values(double value) { + _internal_add_custom_values(value); + // @@protoc_insertion_point(field_add:prometheus.Histogram.custom_values) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& +Histogram::_internal_custom_values() const { + return _impl_.custom_values_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >& +Histogram::custom_values() const { + // @@protoc_insertion_point(field_list:prometheus.Histogram.custom_values) + return _internal_custom_values(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* +Histogram::_internal_mutable_custom_values() { + return &_impl_.custom_values_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< double >* +Histogram::mutable_custom_values() { + // @@protoc_insertion_point(field_mutable_list:prometheus.Histogram.custom_values) + return _internal_mutable_custom_values(); +} + +inline bool Histogram::has_count() const { + return count_case() != COUNT_NOT_SET; +} +inline void Histogram::clear_has_count() { + _impl_._oneof_case_[0] = COUNT_NOT_SET; +} +inline bool Histogram::has_zero_count() const { + return zero_count_case() != ZERO_COUNT_NOT_SET; +} +inline void Histogram::clear_has_zero_count() { + _impl_._oneof_case_[1] = ZERO_COUNT_NOT_SET; +} +inline Histogram::CountCase Histogram::count_case() const { + return Histogram::CountCase(_impl_._oneof_case_[0]); +} +inline Histogram::ZeroCountCase Histogram::zero_count_case() const { + return Histogram::ZeroCountCase(_impl_._oneof_case_[1]); +} +// ------------------------------------------------------------------- + +// BucketSpan + +// sint32 offset = 1; +inline void BucketSpan::clear_offset() { + _impl_.offset_ = 0; +} +inline int32_t BucketSpan::_internal_offset() const { + return _impl_.offset_; +} +inline int32_t BucketSpan::offset() const { + // @@protoc_insertion_point(field_get:prometheus.BucketSpan.offset) + return _internal_offset(); +} +inline void BucketSpan::_internal_set_offset(int32_t value) { + + _impl_.offset_ = value; +} +inline void BucketSpan::set_offset(int32_t value) { + _internal_set_offset(value); + // @@protoc_insertion_point(field_set:prometheus.BucketSpan.offset) +} + +// uint32 length = 2; +inline void BucketSpan::clear_length() { + _impl_.length_ = 0u; +} +inline uint32_t BucketSpan::_internal_length() const { + return _impl_.length_; +} +inline uint32_t BucketSpan::length() const { + // @@protoc_insertion_point(field_get:prometheus.BucketSpan.length) + return _internal_length(); +} +inline void BucketSpan::_internal_set_length(uint32_t value) { + + _impl_.length_ = value; +} +inline void BucketSpan::set_length(uint32_t value) { + _internal_set_length(value); + // @@protoc_insertion_point(field_set:prometheus.BucketSpan.length) +} + +// ------------------------------------------------------------------- + // TimeSeries // repeated .prometheus.Label labels = 1; @@ -2547,6 +3884,46 @@ TimeSeries::exemplars() const { return _impl_.exemplars_; } +// repeated .prometheus.Histogram histograms = 4; +inline int TimeSeries::_internal_histograms_size() const { + return _impl_.histograms_.size(); +} +inline int TimeSeries::histograms_size() const { + return _internal_histograms_size(); +} +inline void TimeSeries::clear_histograms() { + _impl_.histograms_.Clear(); +} +inline ::prometheus::Histogram* TimeSeries::mutable_histograms(int index) { + // @@protoc_insertion_point(field_mutable:prometheus.TimeSeries.histograms) + return _impl_.histograms_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Histogram >* +TimeSeries::mutable_histograms() { + // @@protoc_insertion_point(field_mutable_list:prometheus.TimeSeries.histograms) + return &_impl_.histograms_; +} +inline const ::prometheus::Histogram& TimeSeries::_internal_histograms(int index) const { + return _impl_.histograms_.Get(index); +} +inline const ::prometheus::Histogram& TimeSeries::histograms(int index) const { + // @@protoc_insertion_point(field_get:prometheus.TimeSeries.histograms) + return _internal_histograms(index); +} +inline ::prometheus::Histogram* TimeSeries::_internal_add_histograms() { + return _impl_.histograms_.Add(); +} +inline ::prometheus::Histogram* TimeSeries::add_histograms() { + ::prometheus::Histogram* _add = _internal_add_histograms(); + // @@protoc_insertion_point(field_add:prometheus.TimeSeries.histograms) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::prometheus::Histogram >& +TimeSeries::histograms() const { + // @@protoc_insertion_point(field_list:prometheus.TimeSeries.histograms) + return _impl_.histograms_; +} + // ------------------------------------------------------------------- // Label @@ -3267,6 +4644,10 @@ ChunkedSeries::chunks() const { // ------------------------------------------------------------------- +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + // @@protoc_insertion_point(namespace_scope) @@ -3279,6 +4660,11 @@ template <> inline const EnumDescriptor* GetEnumDescriptor< ::prometheus::MetricMetadata_MetricType>() { return ::prometheus::MetricMetadata_MetricType_descriptor(); } +template <> struct is_proto_enum< ::prometheus::Histogram_ResetHint> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::prometheus::Histogram_ResetHint>() { + return ::prometheus::Histogram_ResetHint_descriptor(); +} template <> struct is_proto_enum< ::prometheus::LabelMatcher_Type> : ::std::true_type {}; template <> inline const EnumDescriptor* GetEnumDescriptor< ::prometheus::LabelMatcher_Type>() { diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..8a30674d --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1765186076, + "narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..3f5c04ea --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "A Nix-flake-based Protobuf development environment"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # unstable Nixpkgs + + outputs = + { self, ... }@inputs: + + let + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + forEachSupportedSystem = + f: + inputs.nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + pkgs = import inputs.nixpkgs { inherit system; }; + } + ); + in + { + devShells = forEachSupportedSystem ( + { pkgs }: + { + default = pkgs.mkShellNoCC { + packages = with pkgs; [ + protobuf + buf + rustc + cargo + clang + go + gnumake + ]; + }; + } + ); + }; +} diff --git a/go/prometheus/remote/types.pb.go b/go/prometheus/remote/types.pb.go index 0351f4a8..3a618f62 100644 --- a/go/prometheus/remote/types.pb.go +++ b/go/prometheus/remote/types.pb.go @@ -97,6 +97,58 @@ func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { return file_prometheus_remote_types_proto_rawDescGZIP(), []int{0, 0} } +type Histogram_ResetHint int32 + +const ( + Histogram_UNKNOWN Histogram_ResetHint = 0 // Need to test for a counter reset explicitly. + Histogram_YES Histogram_ResetHint = 1 // This is the 1st histogram after a counter reset. + Histogram_NO Histogram_ResetHint = 2 // There was no counter reset between this and the previous Histogram. + Histogram_GAUGE Histogram_ResetHint = 3 // This is a gauge histogram where counter resets don't happen. +) + +// Enum value maps for Histogram_ResetHint. +var ( + Histogram_ResetHint_name = map[int32]string{ + 0: "UNKNOWN", + 1: "YES", + 2: "NO", + 3: "GAUGE", + } + Histogram_ResetHint_value = map[string]int32{ + "UNKNOWN": 0, + "YES": 1, + "NO": 2, + "GAUGE": 3, + } +) + +func (x Histogram_ResetHint) Enum() *Histogram_ResetHint { + p := new(Histogram_ResetHint) + *p = x + return p +} + +func (x Histogram_ResetHint) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Histogram_ResetHint) Descriptor() protoreflect.EnumDescriptor { + return file_prometheus_remote_types_proto_enumTypes[1].Descriptor() +} + +func (Histogram_ResetHint) Type() protoreflect.EnumType { + return &file_prometheus_remote_types_proto_enumTypes[1] +} + +func (x Histogram_ResetHint) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Histogram_ResetHint.Descriptor instead. +func (Histogram_ResetHint) EnumDescriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{3, 0} +} + type LabelMatcher_Type int32 const ( @@ -133,11 +185,11 @@ func (x LabelMatcher_Type) String() string { } func (LabelMatcher_Type) Descriptor() protoreflect.EnumDescriptor { - return file_prometheus_remote_types_proto_enumTypes[1].Descriptor() + return file_prometheus_remote_types_proto_enumTypes[2].Descriptor() } func (LabelMatcher_Type) Type() protoreflect.EnumType { - return &file_prometheus_remote_types_proto_enumTypes[1] + return &file_prometheus_remote_types_proto_enumTypes[2] } func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { @@ -146,15 +198,17 @@ func (x LabelMatcher_Type) Number() protoreflect.EnumNumber { // Deprecated: Use LabelMatcher_Type.Descriptor instead. func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{6, 0} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{8, 0} } // We require this to match chunkenc.Encoding. type Chunk_Encoding int32 const ( - Chunk_UNKNOWN Chunk_Encoding = 0 - Chunk_XOR Chunk_Encoding = 1 + Chunk_UNKNOWN Chunk_Encoding = 0 + Chunk_XOR Chunk_Encoding = 1 + Chunk_HISTOGRAM Chunk_Encoding = 2 + Chunk_FLOAT_HISTOGRAM Chunk_Encoding = 3 ) // Enum value maps for Chunk_Encoding. @@ -162,10 +216,14 @@ var ( Chunk_Encoding_name = map[int32]string{ 0: "UNKNOWN", 1: "XOR", + 2: "HISTOGRAM", + 3: "FLOAT_HISTOGRAM", } Chunk_Encoding_value = map[string]int32{ - "UNKNOWN": 0, - "XOR": 1, + "UNKNOWN": 0, + "XOR": 1, + "HISTOGRAM": 2, + "FLOAT_HISTOGRAM": 3, } ) @@ -180,11 +238,11 @@ func (x Chunk_Encoding) String() string { } func (Chunk_Encoding) Descriptor() protoreflect.EnumDescriptor { - return file_prometheus_remote_types_proto_enumTypes[2].Descriptor() + return file_prometheus_remote_types_proto_enumTypes[3].Descriptor() } func (Chunk_Encoding) Type() protoreflect.EnumType { - return &file_prometheus_remote_types_proto_enumTypes[2] + return &file_prometheus_remote_types_proto_enumTypes[3] } func (x Chunk_Encoding) Number() protoreflect.EnumNumber { @@ -193,7 +251,7 @@ func (x Chunk_Encoding) Number() protoreflect.EnumNumber { // Deprecated: Use Chunk_Encoding.Descriptor instead. func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{8, 0} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{10, 0} } type MetricMetadata struct { @@ -202,7 +260,7 @@ type MetricMetadata struct { unknownFields protoimpl.UnknownFields // Represents the metric type, these match the set from Prometheus. - // Refer to model/textparse/interface.go for details. + // Refer to github.com/prometheus/common/model/metadata.go for details. Type MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus.MetricMetadata_MetricType" json:"type,omitempty"` MetricFamilyName string `protobuf:"bytes,2,opt,name=metric_family_name,json=metricFamilyName,proto3" json:"metric_family_name,omitempty"` Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"` @@ -392,6 +450,310 @@ func (x *Exemplar) GetTimestamp() int64 { return 0 } +// A native histogram, also known as a sparse histogram. +// Original design doc: +// https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit +// The appendix of this design doc also explains the concept of float +// histograms. This Histogram message can represent both, the usual +// integer histogram as well as a float histogram. +type Histogram struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Count: + // + // *Histogram_CountInt + // *Histogram_CountFloat + Count isHistogram_Count `protobuf_oneof:"count"` + Sum float64 `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` // Sum of observations in the histogram. + // The schema defines the bucket schema. Currently, valid numbers + // are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1 + // is a bucket boundary in each case, and then each power of two is + // divided into 2^n logarithmic buckets. Or in other words, each + // bucket boundary is the previous boundary times 2^(2^-n). In the + // future, more bucket schemas may be added using numbers < -4 or > + // 8. + Schema int32 `protobuf:"zigzag32,4,opt,name=schema,proto3" json:"schema,omitempty"` + ZeroThreshold float64 `protobuf:"fixed64,5,opt,name=zero_threshold,json=zeroThreshold,proto3" json:"zero_threshold,omitempty"` // Breadth of the zero bucket. + // Types that are assignable to ZeroCount: + // + // *Histogram_ZeroCountInt + // *Histogram_ZeroCountFloat + ZeroCount isHistogram_ZeroCount `protobuf_oneof:"zero_count"` + // Negative Buckets. + NegativeSpans []*BucketSpan `protobuf:"bytes,8,rep,name=negative_spans,json=negativeSpans,proto3" json:"negative_spans,omitempty"` + // Use either "negative_deltas" or "negative_counts", the former for + // regular histograms with integer counts, the latter for float + // histograms. + NegativeDeltas []int64 `protobuf:"zigzag64,9,rep,packed,name=negative_deltas,json=negativeDeltas,proto3" json:"negative_deltas,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + NegativeCounts []float64 `protobuf:"fixed64,10,rep,packed,name=negative_counts,json=negativeCounts,proto3" json:"negative_counts,omitempty"` // Absolute count of each bucket. + // Positive Buckets. + PositiveSpans []*BucketSpan `protobuf:"bytes,11,rep,name=positive_spans,json=positiveSpans,proto3" json:"positive_spans,omitempty"` + // Use either "positive_deltas" or "positive_counts", the former for + // regular histograms with integer counts, the latter for float + // histograms. + PositiveDeltas []int64 `protobuf:"zigzag64,12,rep,packed,name=positive_deltas,json=positiveDeltas,proto3" json:"positive_deltas,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket). + PositiveCounts []float64 `protobuf:"fixed64,13,rep,packed,name=positive_counts,json=positiveCounts,proto3" json:"positive_counts,omitempty"` // Absolute count of each bucket. + ResetHint Histogram_ResetHint `protobuf:"varint,14,opt,name=reset_hint,json=resetHint,proto3,enum=prometheus.Histogram_ResetHint" json:"reset_hint,omitempty"` + // timestamp is in ms format, see model/timestamp/timestamp.go for + // conversion from time.Time to Prometheus timestamp. + Timestamp int64 `protobuf:"varint,15,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // custom_values are not part of the specification, DO NOT use in remote write clients. + // Used only for converting from OpenTelemetry to Prometheus internally. + CustomValues []float64 `protobuf:"fixed64,16,rep,packed,name=custom_values,json=customValues,proto3" json:"custom_values,omitempty"` +} + +func (x *Histogram) Reset() { + *x = Histogram{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Histogram) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Histogram) ProtoMessage() {} + +func (x *Histogram) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Histogram.ProtoReflect.Descriptor instead. +func (*Histogram) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{3} +} + +func (m *Histogram) GetCount() isHistogram_Count { + if m != nil { + return m.Count + } + return nil +} + +func (x *Histogram) GetCountInt() uint64 { + if x, ok := x.GetCount().(*Histogram_CountInt); ok { + return x.CountInt + } + return 0 +} + +func (x *Histogram) GetCountFloat() float64 { + if x, ok := x.GetCount().(*Histogram_CountFloat); ok { + return x.CountFloat + } + return 0 +} + +func (x *Histogram) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *Histogram) GetSchema() int32 { + if x != nil { + return x.Schema + } + return 0 +} + +func (x *Histogram) GetZeroThreshold() float64 { + if x != nil { + return x.ZeroThreshold + } + return 0 +} + +func (m *Histogram) GetZeroCount() isHistogram_ZeroCount { + if m != nil { + return m.ZeroCount + } + return nil +} + +func (x *Histogram) GetZeroCountInt() uint64 { + if x, ok := x.GetZeroCount().(*Histogram_ZeroCountInt); ok { + return x.ZeroCountInt + } + return 0 +} + +func (x *Histogram) GetZeroCountFloat() float64 { + if x, ok := x.GetZeroCount().(*Histogram_ZeroCountFloat); ok { + return x.ZeroCountFloat + } + return 0 +} + +func (x *Histogram) GetNegativeSpans() []*BucketSpan { + if x != nil { + return x.NegativeSpans + } + return nil +} + +func (x *Histogram) GetNegativeDeltas() []int64 { + if x != nil { + return x.NegativeDeltas + } + return nil +} + +func (x *Histogram) GetNegativeCounts() []float64 { + if x != nil { + return x.NegativeCounts + } + return nil +} + +func (x *Histogram) GetPositiveSpans() []*BucketSpan { + if x != nil { + return x.PositiveSpans + } + return nil +} + +func (x *Histogram) GetPositiveDeltas() []int64 { + if x != nil { + return x.PositiveDeltas + } + return nil +} + +func (x *Histogram) GetPositiveCounts() []float64 { + if x != nil { + return x.PositiveCounts + } + return nil +} + +func (x *Histogram) GetResetHint() Histogram_ResetHint { + if x != nil { + return x.ResetHint + } + return Histogram_UNKNOWN +} + +func (x *Histogram) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *Histogram) GetCustomValues() []float64 { + if x != nil { + return x.CustomValues + } + return nil +} + +type isHistogram_Count interface { + isHistogram_Count() +} + +type Histogram_CountInt struct { + CountInt uint64 `protobuf:"varint,1,opt,name=count_int,json=countInt,proto3,oneof"` +} + +type Histogram_CountFloat struct { + CountFloat float64 `protobuf:"fixed64,2,opt,name=count_float,json=countFloat,proto3,oneof"` +} + +func (*Histogram_CountInt) isHistogram_Count() {} + +func (*Histogram_CountFloat) isHistogram_Count() {} + +type isHistogram_ZeroCount interface { + isHistogram_ZeroCount() +} + +type Histogram_ZeroCountInt struct { + ZeroCountInt uint64 `protobuf:"varint,6,opt,name=zero_count_int,json=zeroCountInt,proto3,oneof"` +} + +type Histogram_ZeroCountFloat struct { + ZeroCountFloat float64 `protobuf:"fixed64,7,opt,name=zero_count_float,json=zeroCountFloat,proto3,oneof"` +} + +func (*Histogram_ZeroCountInt) isHistogram_ZeroCount() {} + +func (*Histogram_ZeroCountFloat) isHistogram_ZeroCount() {} + +// A BucketSpan defines a number of consecutive buckets with their +// offset. Logically, it would be more straightforward to include the +// bucket counts in the Span. However, the protobuf representation is +// more compact in the way the data is structured here (with all the +// buckets in a single array separate from the Spans). +type BucketSpan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offset int32 `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"` // Gap to previous span, or starting point for 1st span (which can be negative). + Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` // Length of consecutive buckets. +} + +func (x *BucketSpan) Reset() { + *x = BucketSpan{} + if protoimpl.UnsafeEnabled { + mi := &file_prometheus_remote_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BucketSpan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BucketSpan) ProtoMessage() {} + +func (x *BucketSpan) ProtoReflect() protoreflect.Message { + mi := &file_prometheus_remote_types_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BucketSpan.ProtoReflect.Descriptor instead. +func (*BucketSpan) Descriptor() ([]byte, []int) { + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{4} +} + +func (x *BucketSpan) GetOffset() int32 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *BucketSpan) GetLength() uint32 { + if x != nil { + return x.Length + } + return 0 +} + // TimeSeries represents samples and labels for a single time series. type TimeSeries struct { state protoimpl.MessageState @@ -400,15 +762,16 @@ type TimeSeries struct { // For a timeseries to be valid, and for the samples and exemplars // to be ingested by the remote system properly, the labels field is required. - Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` - Samples []*Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples,omitempty"` - Exemplars []*Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + Samples []*Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples,omitempty"` + Exemplars []*Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + Histograms []*Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms,omitempty"` } func (x *TimeSeries) Reset() { *x = TimeSeries{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[3] + mi := &file_prometheus_remote_types_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -421,7 +784,7 @@ func (x *TimeSeries) String() string { func (*TimeSeries) ProtoMessage() {} func (x *TimeSeries) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[3] + mi := &file_prometheus_remote_types_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -434,7 +797,7 @@ func (x *TimeSeries) ProtoReflect() protoreflect.Message { // Deprecated: Use TimeSeries.ProtoReflect.Descriptor instead. func (*TimeSeries) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{3} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{5} } func (x *TimeSeries) GetLabels() []*Label { @@ -458,6 +821,13 @@ func (x *TimeSeries) GetExemplars() []*Exemplar { return nil } +func (x *TimeSeries) GetHistograms() []*Histogram { + if x != nil { + return x.Histograms + } + return nil +} + type Label struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -470,7 +840,7 @@ type Label struct { func (x *Label) Reset() { *x = Label{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[4] + mi := &file_prometheus_remote_types_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -483,7 +853,7 @@ func (x *Label) String() string { func (*Label) ProtoMessage() {} func (x *Label) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[4] + mi := &file_prometheus_remote_types_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -496,7 +866,7 @@ func (x *Label) ProtoReflect() protoreflect.Message { // Deprecated: Use Label.ProtoReflect.Descriptor instead. func (*Label) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{4} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{6} } func (x *Label) GetName() string { @@ -524,7 +894,7 @@ type Labels struct { func (x *Labels) Reset() { *x = Labels{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[5] + mi := &file_prometheus_remote_types_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -537,7 +907,7 @@ func (x *Labels) String() string { func (*Labels) ProtoMessage() {} func (x *Labels) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[5] + mi := &file_prometheus_remote_types_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -550,7 +920,7 @@ func (x *Labels) ProtoReflect() protoreflect.Message { // Deprecated: Use Labels.ProtoReflect.Descriptor instead. func (*Labels) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{5} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{7} } func (x *Labels) GetLabels() []*Label { @@ -574,7 +944,7 @@ type LabelMatcher struct { func (x *LabelMatcher) Reset() { *x = LabelMatcher{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[6] + mi := &file_prometheus_remote_types_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -587,7 +957,7 @@ func (x *LabelMatcher) String() string { func (*LabelMatcher) ProtoMessage() {} func (x *LabelMatcher) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[6] + mi := &file_prometheus_remote_types_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -600,7 +970,7 @@ func (x *LabelMatcher) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelMatcher.ProtoReflect.Descriptor instead. func (*LabelMatcher) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{6} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{8} } func (x *LabelMatcher) GetType() LabelMatcher_Type { @@ -641,7 +1011,7 @@ type ReadHints struct { func (x *ReadHints) Reset() { *x = ReadHints{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[7] + mi := &file_prometheus_remote_types_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -654,7 +1024,7 @@ func (x *ReadHints) String() string { func (*ReadHints) ProtoMessage() {} func (x *ReadHints) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[7] + mi := &file_prometheus_remote_types_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -667,7 +1037,7 @@ func (x *ReadHints) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadHints.ProtoReflect.Descriptor instead. func (*ReadHints) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{7} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{9} } func (x *ReadHints) GetStepMs() int64 { @@ -735,7 +1105,7 @@ type Chunk struct { func (x *Chunk) Reset() { *x = Chunk{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[8] + mi := &file_prometheus_remote_types_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -748,7 +1118,7 @@ func (x *Chunk) String() string { func (*Chunk) ProtoMessage() {} func (x *Chunk) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[8] + mi := &file_prometheus_remote_types_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -761,7 +1131,7 @@ func (x *Chunk) ProtoReflect() protoreflect.Message { // Deprecated: Use Chunk.ProtoReflect.Descriptor instead. func (*Chunk) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{8} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{10} } func (x *Chunk) GetMinTimeMs() int64 { @@ -807,7 +1177,7 @@ type ChunkedSeries struct { func (x *ChunkedSeries) Reset() { *x = ChunkedSeries{} if protoimpl.UnsafeEnabled { - mi := &file_prometheus_remote_types_proto_msgTypes[9] + mi := &file_prometheus_remote_types_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -820,7 +1190,7 @@ func (x *ChunkedSeries) String() string { func (*ChunkedSeries) ProtoMessage() {} func (x *ChunkedSeries) ProtoReflect() protoreflect.Message { - mi := &file_prometheus_remote_types_proto_msgTypes[9] + mi := &file_prometheus_remote_types_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -833,7 +1203,7 @@ func (x *ChunkedSeries) ProtoReflect() protoreflect.Message { // Deprecated: Use ChunkedSeries.ProtoReflect.Descriptor instead. func (*ChunkedSeries) Descriptor() ([]byte, []int) { - return file_prometheus_remote_types_proto_rawDescGZIP(), []int{9} + return file_prometheus_remote_types_proto_rawDescGZIP(), []int{11} } func (x *ChunkedSeries) GetLabels() []*Label { @@ -884,55 +1254,111 @@ var file_prometheus_remote_types_proto_rawDesc = []byte{ 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x22, 0x99, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2c, 0x0a, - 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x53, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x09, 0x65, - 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x22, - 0x31, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x33, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x06, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, - 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, - 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, - 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, - 0x02, 0x45, 0x51, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, - 0x0a, 0x02, 0x52, 0x45, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x52, 0x45, 0x10, 0x03, 0x22, - 0xb1, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x0a, - 0x07, 0x73, 0x74, 0x65, 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x73, 0x74, 0x65, 0x70, 0x4d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x5f, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x4d, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x64, 0x5f, 0x6d, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x12, 0x1a, 0x0a, 0x08, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x79, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x62, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x4d, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x1e, 0x0a, - 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x12, 0x1e, 0x0a, - 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x12, 0x2e, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x70, 0x72, - 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x45, - 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x20, 0x0a, 0x08, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x4f, - 0x52, 0x10, 0x01, 0x22, 0x65, 0x0a, 0x0d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, + 0x61, 0x6d, 0x70, 0x22, 0xe4, 0x05, 0x0a, 0x09, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x12, 0x1d, 0x0a, 0x09, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x08, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x74, + 0x12, 0x21, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x25, 0x0a, + 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0d, 0x7a, 0x65, 0x72, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x0c, + 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, + 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x0e, 0x7a, 0x65, 0x72, 0x6f, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x3d, 0x0a, 0x0e, 0x6e, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x12, + 0x52, 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x73, + 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0e, 0x6e, 0x65, 0x67, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x0a, 0x0e, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x52, 0x0d, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x76, 0x65, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x12, 0x52, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x44, 0x65, 0x6c, 0x74, 0x61, + 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0e, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, + 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x48, 0x69, 0x6e, 0x74, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x01, 0x52, + 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x34, 0x0a, + 0x09, 0x52, 0x65, 0x73, 0x65, 0x74, 0x48, 0x69, 0x6e, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x59, 0x45, 0x53, 0x10, 0x01, + 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x4f, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, + 0x45, 0x10, 0x03, 0x42, 0x07, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0c, 0x0a, 0x0a, + 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x0a, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xd0, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x6d, + 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, + 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, + 0x2e, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, + 0x12, 0x32, 0x0a, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, + 0x2e, 0x45, 0x78, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x72, 0x52, 0x09, 0x65, 0x78, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x72, 0x73, 0x12, 0x35, 0x0a, 0x0a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, + 0x0a, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x31, 0x0a, 0x05, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x33, + 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, + 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x45, 0x51, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x45, 0x51, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x45, + 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x4e, 0x52, 0x45, 0x10, 0x03, 0x22, 0xb1, 0x01, 0x0a, 0x09, + 0x52, 0x65, 0x61, 0x64, 0x48, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x74, 0x65, + 0x70, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x65, 0x70, + 0x4d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x66, 0x75, 0x6e, 0x63, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4d, + 0x73, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x64, 0x5f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x02, 0x62, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x73, 0x22, + 0xd1, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x61, 0x78, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, + 0x68, 0x65, 0x75, 0x73, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x44, 0x0a, + 0x08, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x58, 0x4f, 0x52, 0x10, 0x01, 0x12, + 0x0d, 0x0a, 0x09, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, 0x4d, 0x10, 0x02, 0x12, 0x13, + 0x0a, 0x0f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x47, 0x52, 0x41, + 0x4d, 0x10, 0x03, 0x22, 0x65, 0x0a, 0x0d, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x65, 0x75, 0x73, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, @@ -958,39 +1384,46 @@ func file_prometheus_remote_types_proto_rawDescGZIP() []byte { return file_prometheus_remote_types_proto_rawDescData } -var file_prometheus_remote_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_prometheus_remote_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_prometheus_remote_types_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_prometheus_remote_types_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_prometheus_remote_types_proto_goTypes = []interface{}{ (MetricMetadata_MetricType)(0), // 0: prometheus.MetricMetadata.MetricType - (LabelMatcher_Type)(0), // 1: prometheus.LabelMatcher.Type - (Chunk_Encoding)(0), // 2: prometheus.Chunk.Encoding - (*MetricMetadata)(nil), // 3: prometheus.MetricMetadata - (*Sample)(nil), // 4: prometheus.Sample - (*Exemplar)(nil), // 5: prometheus.Exemplar - (*TimeSeries)(nil), // 6: prometheus.TimeSeries - (*Label)(nil), // 7: prometheus.Label - (*Labels)(nil), // 8: prometheus.Labels - (*LabelMatcher)(nil), // 9: prometheus.LabelMatcher - (*ReadHints)(nil), // 10: prometheus.ReadHints - (*Chunk)(nil), // 11: prometheus.Chunk - (*ChunkedSeries)(nil), // 12: prometheus.ChunkedSeries + (Histogram_ResetHint)(0), // 1: prometheus.Histogram.ResetHint + (LabelMatcher_Type)(0), // 2: prometheus.LabelMatcher.Type + (Chunk_Encoding)(0), // 3: prometheus.Chunk.Encoding + (*MetricMetadata)(nil), // 4: prometheus.MetricMetadata + (*Sample)(nil), // 5: prometheus.Sample + (*Exemplar)(nil), // 6: prometheus.Exemplar + (*Histogram)(nil), // 7: prometheus.Histogram + (*BucketSpan)(nil), // 8: prometheus.BucketSpan + (*TimeSeries)(nil), // 9: prometheus.TimeSeries + (*Label)(nil), // 10: prometheus.Label + (*Labels)(nil), // 11: prometheus.Labels + (*LabelMatcher)(nil), // 12: prometheus.LabelMatcher + (*ReadHints)(nil), // 13: prometheus.ReadHints + (*Chunk)(nil), // 14: prometheus.Chunk + (*ChunkedSeries)(nil), // 15: prometheus.ChunkedSeries } var file_prometheus_remote_types_proto_depIdxs = []int32{ 0, // 0: prometheus.MetricMetadata.type:type_name -> prometheus.MetricMetadata.MetricType - 7, // 1: prometheus.Exemplar.labels:type_name -> prometheus.Label - 7, // 2: prometheus.TimeSeries.labels:type_name -> prometheus.Label - 4, // 3: prometheus.TimeSeries.samples:type_name -> prometheus.Sample - 5, // 4: prometheus.TimeSeries.exemplars:type_name -> prometheus.Exemplar - 7, // 5: prometheus.Labels.labels:type_name -> prometheus.Label - 1, // 6: prometheus.LabelMatcher.type:type_name -> prometheus.LabelMatcher.Type - 2, // 7: prometheus.Chunk.type:type_name -> prometheus.Chunk.Encoding - 7, // 8: prometheus.ChunkedSeries.labels:type_name -> prometheus.Label - 11, // 9: prometheus.ChunkedSeries.chunks:type_name -> prometheus.Chunk - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 10, // 1: prometheus.Exemplar.labels:type_name -> prometheus.Label + 8, // 2: prometheus.Histogram.negative_spans:type_name -> prometheus.BucketSpan + 8, // 3: prometheus.Histogram.positive_spans:type_name -> prometheus.BucketSpan + 1, // 4: prometheus.Histogram.reset_hint:type_name -> prometheus.Histogram.ResetHint + 10, // 5: prometheus.TimeSeries.labels:type_name -> prometheus.Label + 5, // 6: prometheus.TimeSeries.samples:type_name -> prometheus.Sample + 6, // 7: prometheus.TimeSeries.exemplars:type_name -> prometheus.Exemplar + 7, // 8: prometheus.TimeSeries.histograms:type_name -> prometheus.Histogram + 10, // 9: prometheus.Labels.labels:type_name -> prometheus.Label + 2, // 10: prometheus.LabelMatcher.type:type_name -> prometheus.LabelMatcher.Type + 3, // 11: prometheus.Chunk.type:type_name -> prometheus.Chunk.Encoding + 10, // 12: prometheus.ChunkedSeries.labels:type_name -> prometheus.Label + 14, // 13: prometheus.ChunkedSeries.chunks:type_name -> prometheus.Chunk + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_prometheus_remote_types_proto_init() } @@ -1036,7 +1469,7 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TimeSeries); i { + switch v := v.(*Histogram); i { case 0: return &v.state case 1: @@ -1048,7 +1481,7 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Label); i { + switch v := v.(*BucketSpan); i { case 0: return &v.state case 1: @@ -1060,7 +1493,7 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Labels); i { + switch v := v.(*TimeSeries); i { case 0: return &v.state case 1: @@ -1072,7 +1505,7 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelMatcher); i { + switch v := v.(*Label); i { case 0: return &v.state case 1: @@ -1084,7 +1517,7 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadHints); i { + switch v := v.(*Labels); i { case 0: return &v.state case 1: @@ -1096,7 +1529,7 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Chunk); i { + switch v := v.(*LabelMatcher); i { case 0: return &v.state case 1: @@ -1108,6 +1541,30 @@ func file_prometheus_remote_types_proto_init() { } } file_prometheus_remote_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadHints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chunk); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_prometheus_remote_types_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChunkedSeries); i { case 0: return &v.state @@ -1120,13 +1577,19 @@ func file_prometheus_remote_types_proto_init() { } } } + file_prometheus_remote_types_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*Histogram_CountInt)(nil), + (*Histogram_CountFloat)(nil), + (*Histogram_ZeroCountInt)(nil), + (*Histogram_ZeroCountFloat)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_prometheus_remote_types_proto_rawDesc, - NumEnums: 3, - NumMessages: 10, + NumEnums: 4, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/java/src/main/java/prometheus/Types.java b/java/src/main/java/prometheus/Types.java index 7f6ecdc4..178c5b54 100644 --- a/java/src/main/java/prometheus/Types.java +++ b/java/src/main/java/prometheus/Types.java @@ -21,7 +21,7 @@ public interface MetricMetadataOrBuilder extends /** *
      * Represents the metric type, these match the set from Prometheus.
-     * Refer to model/textparse/interface.go for details.
+     * Refer to github.com/prometheus/common/model/metadata.go for details.
      * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -31,7 +31,7 @@ public interface MetricMetadataOrBuilder extends /** *
      * Represents the metric type, these match the set from Prometheus.
-     * Refer to model/textparse/interface.go for details.
+     * Refer to github.com/prometheus/common/model/metadata.go for details.
      * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -349,7 +349,7 @@ private MetricType(int value) { /** *
      * Represents the metric type, these match the set from Prometheus.
-     * Refer to model/textparse/interface.go for details.
+     * Refer to github.com/prometheus/common/model/metadata.go for details.
      * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -361,7 +361,7 @@ private MetricType(int value) { /** *
      * Represents the metric type, these match the set from Prometheus.
-     * Refer to model/textparse/interface.go for details.
+     * Refer to github.com/prometheus/common/model/metadata.go for details.
      * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -843,7 +843,7 @@ public Builder mergeFrom( /** *
        * Represents the metric type, these match the set from Prometheus.
-       * Refer to model/textparse/interface.go for details.
+       * Refer to github.com/prometheus/common/model/metadata.go for details.
        * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -855,7 +855,7 @@ public Builder mergeFrom( /** *
        * Represents the metric type, these match the set from Prometheus.
-       * Refer to model/textparse/interface.go for details.
+       * Refer to github.com/prometheus/common/model/metadata.go for details.
        * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -871,7 +871,7 @@ public Builder setTypeValue(int value) { /** *
        * Represents the metric type, these match the set from Prometheus.
-       * Refer to model/textparse/interface.go for details.
+       * Refer to github.com/prometheus/common/model/metadata.go for details.
        * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -886,7 +886,7 @@ public prometheus.Types.MetricMetadata.MetricType getType() { /** *
        * Represents the metric type, these match the set from Prometheus.
-       * Refer to model/textparse/interface.go for details.
+       * Refer to github.com/prometheus/common/model/metadata.go for details.
        * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -905,7 +905,7 @@ public Builder setType(prometheus.Types.MetricMetadata.MetricType value) { /** *
        * Represents the metric type, these match the set from Prometheus.
-       * Refer to model/textparse/interface.go for details.
+       * Refer to github.com/prometheus/common/model/metadata.go for details.
        * 
* * .prometheus.MetricMetadata.MetricType type = 1; @@ -2861,6 +2861,4542 @@ public prometheus.Types.Exemplar getDefaultInstanceForType() { } + public interface HistogramOrBuilder extends + // @@protoc_insertion_point(interface_extends:prometheus.Histogram) + com.google.protobuf.MessageOrBuilder { + + /** + * uint64 count_int = 1; + * @return Whether the countInt field is set. + */ + boolean hasCountInt(); + /** + * uint64 count_int = 1; + * @return The countInt. + */ + long getCountInt(); + + /** + * double count_float = 2; + * @return Whether the countFloat field is set. + */ + boolean hasCountFloat(); + /** + * double count_float = 2; + * @return The countFloat. + */ + double getCountFloat(); + + /** + *
+     * Sum of observations in the histogram.
+     * 
+ * + * double sum = 3; + * @return The sum. + */ + double getSum(); + + /** + *
+     * The schema defines the bucket schema. Currently, valid numbers
+     * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+     * is a bucket boundary in each case, and then each power of two is
+     * divided into 2^n logarithmic buckets. Or in other words, each
+     * bucket boundary is the previous boundary times 2^(2^-n). In the
+     * future, more bucket schemas may be added using numbers < -4 or >
+     * 8.
+     * 
+ * + * sint32 schema = 4; + * @return The schema. + */ + int getSchema(); + + /** + *
+     * Breadth of the zero bucket.
+     * 
+ * + * double zero_threshold = 5; + * @return The zeroThreshold. + */ + double getZeroThreshold(); + + /** + * uint64 zero_count_int = 6; + * @return Whether the zeroCountInt field is set. + */ + boolean hasZeroCountInt(); + /** + * uint64 zero_count_int = 6; + * @return The zeroCountInt. + */ + long getZeroCountInt(); + + /** + * double zero_count_float = 7; + * @return Whether the zeroCountFloat field is set. + */ + boolean hasZeroCountFloat(); + /** + * double zero_count_float = 7; + * @return The zeroCountFloat. + */ + double getZeroCountFloat(); + + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + java.util.List + getNegativeSpansList(); + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + prometheus.Types.BucketSpan getNegativeSpans(int index); + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + int getNegativeSpansCount(); + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + java.util.List + getNegativeSpansOrBuilderList(); + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + prometheus.Types.BucketSpanOrBuilder getNegativeSpansOrBuilder( + int index); + + /** + *
+     * Use either "negative_deltas" or "negative_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 negative_deltas = 9; + * @return A list containing the negativeDeltas. + */ + java.util.List getNegativeDeltasList(); + /** + *
+     * Use either "negative_deltas" or "negative_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 negative_deltas = 9; + * @return The count of negativeDeltas. + */ + int getNegativeDeltasCount(); + /** + *
+     * Use either "negative_deltas" or "negative_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 negative_deltas = 9; + * @param index The index of the element to return. + * @return The negativeDeltas at the given index. + */ + long getNegativeDeltas(int index); + + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double negative_counts = 10; + * @return A list containing the negativeCounts. + */ + java.util.List getNegativeCountsList(); + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double negative_counts = 10; + * @return The count of negativeCounts. + */ + int getNegativeCountsCount(); + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double negative_counts = 10; + * @param index The index of the element to return. + * @return The negativeCounts at the given index. + */ + double getNegativeCounts(int index); + + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + java.util.List + getPositiveSpansList(); + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + prometheus.Types.BucketSpan getPositiveSpans(int index); + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + int getPositiveSpansCount(); + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + java.util.List + getPositiveSpansOrBuilderList(); + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + prometheus.Types.BucketSpanOrBuilder getPositiveSpansOrBuilder( + int index); + + /** + *
+     * Use either "positive_deltas" or "positive_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 positive_deltas = 12; + * @return A list containing the positiveDeltas. + */ + java.util.List getPositiveDeltasList(); + /** + *
+     * Use either "positive_deltas" or "positive_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 positive_deltas = 12; + * @return The count of positiveDeltas. + */ + int getPositiveDeltasCount(); + /** + *
+     * Use either "positive_deltas" or "positive_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 positive_deltas = 12; + * @param index The index of the element to return. + * @return The positiveDeltas at the given index. + */ + long getPositiveDeltas(int index); + + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double positive_counts = 13; + * @return A list containing the positiveCounts. + */ + java.util.List getPositiveCountsList(); + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double positive_counts = 13; + * @return The count of positiveCounts. + */ + int getPositiveCountsCount(); + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double positive_counts = 13; + * @param index The index of the element to return. + * @return The positiveCounts at the given index. + */ + double getPositiveCounts(int index); + + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return The enum numeric value on the wire for resetHint. + */ + int getResetHintValue(); + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return The resetHint. + */ + prometheus.Types.Histogram.ResetHint getResetHint(); + + /** + *
+     * timestamp is in ms format, see model/timestamp/timestamp.go for
+     * conversion from time.Time to Prometheus timestamp.
+     * 
+ * + * int64 timestamp = 15; + * @return The timestamp. + */ + long getTimestamp(); + + /** + *
+     * custom_values are not part of the specification, DO NOT use in remote write clients.
+     * Used only for converting from OpenTelemetry to Prometheus internally.
+     * 
+ * + * repeated double custom_values = 16; + * @return A list containing the customValues. + */ + java.util.List getCustomValuesList(); + /** + *
+     * custom_values are not part of the specification, DO NOT use in remote write clients.
+     * Used only for converting from OpenTelemetry to Prometheus internally.
+     * 
+ * + * repeated double custom_values = 16; + * @return The count of customValues. + */ + int getCustomValuesCount(); + /** + *
+     * custom_values are not part of the specification, DO NOT use in remote write clients.
+     * Used only for converting from OpenTelemetry to Prometheus internally.
+     * 
+ * + * repeated double custom_values = 16; + * @param index The index of the element to return. + * @return The customValues at the given index. + */ + double getCustomValues(int index); + + public prometheus.Types.Histogram.CountCase getCountCase(); + + public prometheus.Types.Histogram.ZeroCountCase getZeroCountCase(); + } + /** + *
+   * A native histogram, also known as a sparse histogram.
+   * Original design doc:
+   * https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit
+   * The appendix of this design doc also explains the concept of float
+   * histograms. This Histogram message can represent both, the usual
+   * integer histogram as well as a float histogram.
+   * 
+ * + * Protobuf type {@code prometheus.Histogram} + */ + public static final class Histogram extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:prometheus.Histogram) + HistogramOrBuilder { + private static final long serialVersionUID = 0L; + // Use Histogram.newBuilder() to construct. + private Histogram(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Histogram() { + negativeSpans_ = java.util.Collections.emptyList(); + negativeDeltas_ = emptyLongList(); + negativeCounts_ = emptyDoubleList(); + positiveSpans_ = java.util.Collections.emptyList(); + positiveDeltas_ = emptyLongList(); + positiveCounts_ = emptyDoubleList(); + resetHint_ = 0; + customValues_ = emptyDoubleList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Histogram(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Histogram( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + count_ = input.readUInt64(); + countCase_ = 1; + break; + } + case 17: { + count_ = input.readDouble(); + countCase_ = 2; + break; + } + case 25: { + + sum_ = input.readDouble(); + break; + } + case 32: { + + schema_ = input.readSInt32(); + break; + } + case 41: { + + zeroThreshold_ = input.readDouble(); + break; + } + case 48: { + zeroCount_ = input.readUInt64(); + zeroCountCase_ = 6; + break; + } + case 57: { + zeroCount_ = input.readDouble(); + zeroCountCase_ = 7; + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + negativeSpans_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + negativeSpans_.add( + input.readMessage(prometheus.Types.BucketSpan.parser(), extensionRegistry)); + break; + } + case 72: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + negativeDeltas_ = newLongList(); + mutable_bitField0_ |= 0x00000002; + } + negativeDeltas_.addLong(input.readSInt64()); + break; + } + case 74: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) { + negativeDeltas_ = newLongList(); + mutable_bitField0_ |= 0x00000002; + } + while (input.getBytesUntilLimit() > 0) { + negativeDeltas_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } + case 81: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + negativeCounts_ = newDoubleList(); + mutable_bitField0_ |= 0x00000004; + } + negativeCounts_.addDouble(input.readDouble()); + break; + } + case 82: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) { + negativeCounts_ = newDoubleList(); + mutable_bitField0_ |= 0x00000004; + } + while (input.getBytesUntilLimit() > 0) { + negativeCounts_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + case 90: { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + positiveSpans_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + positiveSpans_.add( + input.readMessage(prometheus.Types.BucketSpan.parser(), extensionRegistry)); + break; + } + case 96: { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + positiveDeltas_ = newLongList(); + mutable_bitField0_ |= 0x00000010; + } + positiveDeltas_.addLong(input.readSInt64()); + break; + } + case 98: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000010) != 0) && input.getBytesUntilLimit() > 0) { + positiveDeltas_ = newLongList(); + mutable_bitField0_ |= 0x00000010; + } + while (input.getBytesUntilLimit() > 0) { + positiveDeltas_.addLong(input.readSInt64()); + } + input.popLimit(limit); + break; + } + case 105: { + if (!((mutable_bitField0_ & 0x00000020) != 0)) { + positiveCounts_ = newDoubleList(); + mutable_bitField0_ |= 0x00000020; + } + positiveCounts_.addDouble(input.readDouble()); + break; + } + case 106: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000020) != 0) && input.getBytesUntilLimit() > 0) { + positiveCounts_ = newDoubleList(); + mutable_bitField0_ |= 0x00000020; + } + while (input.getBytesUntilLimit() > 0) { + positiveCounts_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + case 112: { + int rawValue = input.readEnum(); + + resetHint_ = rawValue; + break; + } + case 120: { + + timestamp_ = input.readInt64(); + break; + } + case 129: { + if (!((mutable_bitField0_ & 0x00000040) != 0)) { + customValues_ = newDoubleList(); + mutable_bitField0_ |= 0x00000040; + } + customValues_.addDouble(input.readDouble()); + break; + } + case 130: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000040) != 0) && input.getBytesUntilLimit() > 0) { + customValues_ = newDoubleList(); + mutable_bitField0_ |= 0x00000040; + } + while (input.getBytesUntilLimit() > 0) { + customValues_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + negativeSpans_ = java.util.Collections.unmodifiableList(negativeSpans_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + negativeDeltas_.makeImmutable(); // C + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + negativeCounts_.makeImmutable(); // C + } + if (((mutable_bitField0_ & 0x00000008) != 0)) { + positiveSpans_ = java.util.Collections.unmodifiableList(positiveSpans_); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + positiveDeltas_.makeImmutable(); // C + } + if (((mutable_bitField0_ & 0x00000020) != 0)) { + positiveCounts_.makeImmutable(); // C + } + if (((mutable_bitField0_ & 0x00000040) != 0)) { + customValues_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return prometheus.Types.internal_static_prometheus_Histogram_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return prometheus.Types.internal_static_prometheus_Histogram_fieldAccessorTable + .ensureFieldAccessorsInitialized( + prometheus.Types.Histogram.class, prometheus.Types.Histogram.Builder.class); + } + + /** + * Protobuf enum {@code prometheus.Histogram.ResetHint} + */ + public enum ResetHint + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * Need to test for a counter reset explicitly.
+       * 
+ * + * UNKNOWN = 0; + */ + UNKNOWN(0), + /** + *
+       * This is the 1st histogram after a counter reset.
+       * 
+ * + * YES = 1; + */ + YES(1), + /** + *
+       * There was no counter reset between this and the previous Histogram.
+       * 
+ * + * NO = 2; + */ + NO(2), + /** + *
+       * This is a gauge histogram where counter resets don't happen.
+       * 
+ * + * GAUGE = 3; + */ + GAUGE(3), + UNRECOGNIZED(-1), + ; + + /** + *
+       * Need to test for a counter reset explicitly.
+       * 
+ * + * UNKNOWN = 0; + */ + public static final int UNKNOWN_VALUE = 0; + /** + *
+       * This is the 1st histogram after a counter reset.
+       * 
+ * + * YES = 1; + */ + public static final int YES_VALUE = 1; + /** + *
+       * There was no counter reset between this and the previous Histogram.
+       * 
+ * + * NO = 2; + */ + public static final int NO_VALUE = 2; + /** + *
+       * This is a gauge histogram where counter resets don't happen.
+       * 
+ * + * GAUGE = 3; + */ + public static final int GAUGE_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResetHint valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ResetHint forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return YES; + case 2: return NO; + case 3: return GAUGE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ResetHint> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResetHint findValueByNumber(int number) { + return ResetHint.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return prometheus.Types.Histogram.getDescriptor().getEnumTypes().get(0); + } + + private static final ResetHint[] VALUES = values(); + + public static ResetHint valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResetHint(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:prometheus.Histogram.ResetHint) + } + + private int countCase_ = 0; + private java.lang.Object count_; + public enum CountCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + COUNT_INT(1), + COUNT_FLOAT(2), + COUNT_NOT_SET(0); + private final int value; + private CountCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CountCase valueOf(int value) { + return forNumber(value); + } + + public static CountCase forNumber(int value) { + switch (value) { + case 1: return COUNT_INT; + case 2: return COUNT_FLOAT; + case 0: return COUNT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public CountCase + getCountCase() { + return CountCase.forNumber( + countCase_); + } + + private int zeroCountCase_ = 0; + private java.lang.Object zeroCount_; + public enum ZeroCountCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ZERO_COUNT_INT(6), + ZERO_COUNT_FLOAT(7), + ZEROCOUNT_NOT_SET(0); + private final int value; + private ZeroCountCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ZeroCountCase valueOf(int value) { + return forNumber(value); + } + + public static ZeroCountCase forNumber(int value) { + switch (value) { + case 6: return ZERO_COUNT_INT; + case 7: return ZERO_COUNT_FLOAT; + case 0: return ZEROCOUNT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ZeroCountCase + getZeroCountCase() { + return ZeroCountCase.forNumber( + zeroCountCase_); + } + + public static final int COUNT_INT_FIELD_NUMBER = 1; + /** + * uint64 count_int = 1; + * @return Whether the countInt field is set. + */ + @java.lang.Override + public boolean hasCountInt() { + return countCase_ == 1; + } + /** + * uint64 count_int = 1; + * @return The countInt. + */ + @java.lang.Override + public long getCountInt() { + if (countCase_ == 1) { + return (java.lang.Long) count_; + } + return 0L; + } + + public static final int COUNT_FLOAT_FIELD_NUMBER = 2; + /** + * double count_float = 2; + * @return Whether the countFloat field is set. + */ + @java.lang.Override + public boolean hasCountFloat() { + return countCase_ == 2; + } + /** + * double count_float = 2; + * @return The countFloat. + */ + @java.lang.Override + public double getCountFloat() { + if (countCase_ == 2) { + return (java.lang.Double) count_; + } + return 0D; + } + + public static final int SUM_FIELD_NUMBER = 3; + private double sum_; + /** + *
+     * Sum of observations in the histogram.
+     * 
+ * + * double sum = 3; + * @return The sum. + */ + @java.lang.Override + public double getSum() { + return sum_; + } + + public static final int SCHEMA_FIELD_NUMBER = 4; + private int schema_; + /** + *
+     * The schema defines the bucket schema. Currently, valid numbers
+     * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+     * is a bucket boundary in each case, and then each power of two is
+     * divided into 2^n logarithmic buckets. Or in other words, each
+     * bucket boundary is the previous boundary times 2^(2^-n). In the
+     * future, more bucket schemas may be added using numbers < -4 or >
+     * 8.
+     * 
+ * + * sint32 schema = 4; + * @return The schema. + */ + @java.lang.Override + public int getSchema() { + return schema_; + } + + public static final int ZERO_THRESHOLD_FIELD_NUMBER = 5; + private double zeroThreshold_; + /** + *
+     * Breadth of the zero bucket.
+     * 
+ * + * double zero_threshold = 5; + * @return The zeroThreshold. + */ + @java.lang.Override + public double getZeroThreshold() { + return zeroThreshold_; + } + + public static final int ZERO_COUNT_INT_FIELD_NUMBER = 6; + /** + * uint64 zero_count_int = 6; + * @return Whether the zeroCountInt field is set. + */ + @java.lang.Override + public boolean hasZeroCountInt() { + return zeroCountCase_ == 6; + } + /** + * uint64 zero_count_int = 6; + * @return The zeroCountInt. + */ + @java.lang.Override + public long getZeroCountInt() { + if (zeroCountCase_ == 6) { + return (java.lang.Long) zeroCount_; + } + return 0L; + } + + public static final int ZERO_COUNT_FLOAT_FIELD_NUMBER = 7; + /** + * double zero_count_float = 7; + * @return Whether the zeroCountFloat field is set. + */ + @java.lang.Override + public boolean hasZeroCountFloat() { + return zeroCountCase_ == 7; + } + /** + * double zero_count_float = 7; + * @return The zeroCountFloat. + */ + @java.lang.Override + public double getZeroCountFloat() { + if (zeroCountCase_ == 7) { + return (java.lang.Double) zeroCount_; + } + return 0D; + } + + public static final int NEGATIVE_SPANS_FIELD_NUMBER = 8; + private java.util.List negativeSpans_; + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + @java.lang.Override + public java.util.List getNegativeSpansList() { + return negativeSpans_; + } + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + @java.lang.Override + public java.util.List + getNegativeSpansOrBuilderList() { + return negativeSpans_; + } + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + @java.lang.Override + public int getNegativeSpansCount() { + return negativeSpans_.size(); + } + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + @java.lang.Override + public prometheus.Types.BucketSpan getNegativeSpans(int index) { + return negativeSpans_.get(index); + } + /** + *
+     * Negative Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + @java.lang.Override + public prometheus.Types.BucketSpanOrBuilder getNegativeSpansOrBuilder( + int index) { + return negativeSpans_.get(index); + } + + public static final int NEGATIVE_DELTAS_FIELD_NUMBER = 9; + private com.google.protobuf.Internal.LongList negativeDeltas_; + /** + *
+     * Use either "negative_deltas" or "negative_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 negative_deltas = 9; + * @return A list containing the negativeDeltas. + */ + @java.lang.Override + public java.util.List + getNegativeDeltasList() { + return negativeDeltas_; + } + /** + *
+     * Use either "negative_deltas" or "negative_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 negative_deltas = 9; + * @return The count of negativeDeltas. + */ + public int getNegativeDeltasCount() { + return negativeDeltas_.size(); + } + /** + *
+     * Use either "negative_deltas" or "negative_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 negative_deltas = 9; + * @param index The index of the element to return. + * @return The negativeDeltas at the given index. + */ + public long getNegativeDeltas(int index) { + return negativeDeltas_.getLong(index); + } + private int negativeDeltasMemoizedSerializedSize = -1; + + public static final int NEGATIVE_COUNTS_FIELD_NUMBER = 10; + private com.google.protobuf.Internal.DoubleList negativeCounts_; + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double negative_counts = 10; + * @return A list containing the negativeCounts. + */ + @java.lang.Override + public java.util.List + getNegativeCountsList() { + return negativeCounts_; + } + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double negative_counts = 10; + * @return The count of negativeCounts. + */ + public int getNegativeCountsCount() { + return negativeCounts_.size(); + } + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double negative_counts = 10; + * @param index The index of the element to return. + * @return The negativeCounts at the given index. + */ + public double getNegativeCounts(int index) { + return negativeCounts_.getDouble(index); + } + private int negativeCountsMemoizedSerializedSize = -1; + + public static final int POSITIVE_SPANS_FIELD_NUMBER = 11; + private java.util.List positiveSpans_; + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + @java.lang.Override + public java.util.List getPositiveSpansList() { + return positiveSpans_; + } + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + @java.lang.Override + public java.util.List + getPositiveSpansOrBuilderList() { + return positiveSpans_; + } + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + @java.lang.Override + public int getPositiveSpansCount() { + return positiveSpans_.size(); + } + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + @java.lang.Override + public prometheus.Types.BucketSpan getPositiveSpans(int index) { + return positiveSpans_.get(index); + } + /** + *
+     * Positive Buckets.
+     * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + @java.lang.Override + public prometheus.Types.BucketSpanOrBuilder getPositiveSpansOrBuilder( + int index) { + return positiveSpans_.get(index); + } + + public static final int POSITIVE_DELTAS_FIELD_NUMBER = 12; + private com.google.protobuf.Internal.LongList positiveDeltas_; + /** + *
+     * Use either "positive_deltas" or "positive_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 positive_deltas = 12; + * @return A list containing the positiveDeltas. + */ + @java.lang.Override + public java.util.List + getPositiveDeltasList() { + return positiveDeltas_; + } + /** + *
+     * Use either "positive_deltas" or "positive_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 positive_deltas = 12; + * @return The count of positiveDeltas. + */ + public int getPositiveDeltasCount() { + return positiveDeltas_.size(); + } + /** + *
+     * Use either "positive_deltas" or "positive_counts", the former for
+     * regular histograms with integer counts, the latter for float
+     * histograms.
+     * 
+ * + * repeated sint64 positive_deltas = 12; + * @param index The index of the element to return. + * @return The positiveDeltas at the given index. + */ + public long getPositiveDeltas(int index) { + return positiveDeltas_.getLong(index); + } + private int positiveDeltasMemoizedSerializedSize = -1; + + public static final int POSITIVE_COUNTS_FIELD_NUMBER = 13; + private com.google.protobuf.Internal.DoubleList positiveCounts_; + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double positive_counts = 13; + * @return A list containing the positiveCounts. + */ + @java.lang.Override + public java.util.List + getPositiveCountsList() { + return positiveCounts_; + } + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double positive_counts = 13; + * @return The count of positiveCounts. + */ + public int getPositiveCountsCount() { + return positiveCounts_.size(); + } + /** + *
+     * Absolute count of each bucket.
+     * 
+ * + * repeated double positive_counts = 13; + * @param index The index of the element to return. + * @return The positiveCounts at the given index. + */ + public double getPositiveCounts(int index) { + return positiveCounts_.getDouble(index); + } + private int positiveCountsMemoizedSerializedSize = -1; + + public static final int RESET_HINT_FIELD_NUMBER = 14; + private int resetHint_; + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return The enum numeric value on the wire for resetHint. + */ + @java.lang.Override public int getResetHintValue() { + return resetHint_; + } + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return The resetHint. + */ + @java.lang.Override public prometheus.Types.Histogram.ResetHint getResetHint() { + @SuppressWarnings("deprecation") + prometheus.Types.Histogram.ResetHint result = prometheus.Types.Histogram.ResetHint.valueOf(resetHint_); + return result == null ? prometheus.Types.Histogram.ResetHint.UNRECOGNIZED : result; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 15; + private long timestamp_; + /** + *
+     * timestamp is in ms format, see model/timestamp/timestamp.go for
+     * conversion from time.Time to Prometheus timestamp.
+     * 
+ * + * int64 timestamp = 15; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + + public static final int CUSTOM_VALUES_FIELD_NUMBER = 16; + private com.google.protobuf.Internal.DoubleList customValues_; + /** + *
+     * custom_values are not part of the specification, DO NOT use in remote write clients.
+     * Used only for converting from OpenTelemetry to Prometheus internally.
+     * 
+ * + * repeated double custom_values = 16; + * @return A list containing the customValues. + */ + @java.lang.Override + public java.util.List + getCustomValuesList() { + return customValues_; + } + /** + *
+     * custom_values are not part of the specification, DO NOT use in remote write clients.
+     * Used only for converting from OpenTelemetry to Prometheus internally.
+     * 
+ * + * repeated double custom_values = 16; + * @return The count of customValues. + */ + public int getCustomValuesCount() { + return customValues_.size(); + } + /** + *
+     * custom_values are not part of the specification, DO NOT use in remote write clients.
+     * Used only for converting from OpenTelemetry to Prometheus internally.
+     * 
+ * + * repeated double custom_values = 16; + * @param index The index of the element to return. + * @return The customValues at the given index. + */ + public double getCustomValues(int index) { + return customValues_.getDouble(index); + } + private int customValuesMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (countCase_ == 1) { + output.writeUInt64( + 1, (long)((java.lang.Long) count_)); + } + if (countCase_ == 2) { + output.writeDouble( + 2, (double)((java.lang.Double) count_)); + } + if (java.lang.Double.doubleToRawLongBits(sum_) != 0) { + output.writeDouble(3, sum_); + } + if (schema_ != 0) { + output.writeSInt32(4, schema_); + } + if (java.lang.Double.doubleToRawLongBits(zeroThreshold_) != 0) { + output.writeDouble(5, zeroThreshold_); + } + if (zeroCountCase_ == 6) { + output.writeUInt64( + 6, (long)((java.lang.Long) zeroCount_)); + } + if (zeroCountCase_ == 7) { + output.writeDouble( + 7, (double)((java.lang.Double) zeroCount_)); + } + for (int i = 0; i < negativeSpans_.size(); i++) { + output.writeMessage(8, negativeSpans_.get(i)); + } + if (getNegativeDeltasList().size() > 0) { + output.writeUInt32NoTag(74); + output.writeUInt32NoTag(negativeDeltasMemoizedSerializedSize); + } + for (int i = 0; i < negativeDeltas_.size(); i++) { + output.writeSInt64NoTag(negativeDeltas_.getLong(i)); + } + if (getNegativeCountsList().size() > 0) { + output.writeUInt32NoTag(82); + output.writeUInt32NoTag(negativeCountsMemoizedSerializedSize); + } + for (int i = 0; i < negativeCounts_.size(); i++) { + output.writeDoubleNoTag(negativeCounts_.getDouble(i)); + } + for (int i = 0; i < positiveSpans_.size(); i++) { + output.writeMessage(11, positiveSpans_.get(i)); + } + if (getPositiveDeltasList().size() > 0) { + output.writeUInt32NoTag(98); + output.writeUInt32NoTag(positiveDeltasMemoizedSerializedSize); + } + for (int i = 0; i < positiveDeltas_.size(); i++) { + output.writeSInt64NoTag(positiveDeltas_.getLong(i)); + } + if (getPositiveCountsList().size() > 0) { + output.writeUInt32NoTag(106); + output.writeUInt32NoTag(positiveCountsMemoizedSerializedSize); + } + for (int i = 0; i < positiveCounts_.size(); i++) { + output.writeDoubleNoTag(positiveCounts_.getDouble(i)); + } + if (resetHint_ != prometheus.Types.Histogram.ResetHint.UNKNOWN.getNumber()) { + output.writeEnum(14, resetHint_); + } + if (timestamp_ != 0L) { + output.writeInt64(15, timestamp_); + } + if (getCustomValuesList().size() > 0) { + output.writeUInt32NoTag(130); + output.writeUInt32NoTag(customValuesMemoizedSerializedSize); + } + for (int i = 0; i < customValues_.size(); i++) { + output.writeDoubleNoTag(customValues_.getDouble(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (countCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size( + 1, (long)((java.lang.Long) count_)); + } + if (countCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize( + 2, (double)((java.lang.Double) count_)); + } + if (java.lang.Double.doubleToRawLongBits(sum_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(3, sum_); + } + if (schema_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(4, schema_); + } + if (java.lang.Double.doubleToRawLongBits(zeroThreshold_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(5, zeroThreshold_); + } + if (zeroCountCase_ == 6) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size( + 6, (long)((java.lang.Long) zeroCount_)); + } + if (zeroCountCase_ == 7) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize( + 7, (double)((java.lang.Double) zeroCount_)); + } + for (int i = 0; i < negativeSpans_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, negativeSpans_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < negativeDeltas_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeSInt64SizeNoTag(negativeDeltas_.getLong(i)); + } + size += dataSize; + if (!getNegativeDeltasList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + negativeDeltasMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getNegativeCountsList().size(); + size += dataSize; + if (!getNegativeCountsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + negativeCountsMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < positiveSpans_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, positiveSpans_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < positiveDeltas_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeSInt64SizeNoTag(positiveDeltas_.getLong(i)); + } + size += dataSize; + if (!getPositiveDeltasList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + positiveDeltasMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * getPositiveCountsList().size(); + size += dataSize; + if (!getPositiveCountsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + positiveCountsMemoizedSerializedSize = dataSize; + } + if (resetHint_ != prometheus.Types.Histogram.ResetHint.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(14, resetHint_); + } + if (timestamp_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(15, timestamp_); + } + { + int dataSize = 0; + dataSize = 8 * getCustomValuesList().size(); + size += dataSize; + if (!getCustomValuesList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + customValuesMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof prometheus.Types.Histogram)) { + return super.equals(obj); + } + prometheus.Types.Histogram other = (prometheus.Types.Histogram) obj; + + if (java.lang.Double.doubleToLongBits(getSum()) + != java.lang.Double.doubleToLongBits( + other.getSum())) return false; + if (getSchema() + != other.getSchema()) return false; + if (java.lang.Double.doubleToLongBits(getZeroThreshold()) + != java.lang.Double.doubleToLongBits( + other.getZeroThreshold())) return false; + if (!getNegativeSpansList() + .equals(other.getNegativeSpansList())) return false; + if (!getNegativeDeltasList() + .equals(other.getNegativeDeltasList())) return false; + if (!getNegativeCountsList() + .equals(other.getNegativeCountsList())) return false; + if (!getPositiveSpansList() + .equals(other.getPositiveSpansList())) return false; + if (!getPositiveDeltasList() + .equals(other.getPositiveDeltasList())) return false; + if (!getPositiveCountsList() + .equals(other.getPositiveCountsList())) return false; + if (resetHint_ != other.resetHint_) return false; + if (getTimestamp() + != other.getTimestamp()) return false; + if (!getCustomValuesList() + .equals(other.getCustomValuesList())) return false; + if (!getCountCase().equals(other.getCountCase())) return false; + switch (countCase_) { + case 1: + if (getCountInt() + != other.getCountInt()) return false; + break; + case 2: + if (java.lang.Double.doubleToLongBits(getCountFloat()) + != java.lang.Double.doubleToLongBits( + other.getCountFloat())) return false; + break; + case 0: + default: + } + if (!getZeroCountCase().equals(other.getZeroCountCase())) return false; + switch (zeroCountCase_) { + case 6: + if (getZeroCountInt() + != other.getZeroCountInt()) return false; + break; + case 7: + if (java.lang.Double.doubleToLongBits(getZeroCountFloat()) + != java.lang.Double.doubleToLongBits( + other.getZeroCountFloat())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUM_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getSum())); + hash = (37 * hash) + SCHEMA_FIELD_NUMBER; + hash = (53 * hash) + getSchema(); + hash = (37 * hash) + ZERO_THRESHOLD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getZeroThreshold())); + if (getNegativeSpansCount() > 0) { + hash = (37 * hash) + NEGATIVE_SPANS_FIELD_NUMBER; + hash = (53 * hash) + getNegativeSpansList().hashCode(); + } + if (getNegativeDeltasCount() > 0) { + hash = (37 * hash) + NEGATIVE_DELTAS_FIELD_NUMBER; + hash = (53 * hash) + getNegativeDeltasList().hashCode(); + } + if (getNegativeCountsCount() > 0) { + hash = (37 * hash) + NEGATIVE_COUNTS_FIELD_NUMBER; + hash = (53 * hash) + getNegativeCountsList().hashCode(); + } + if (getPositiveSpansCount() > 0) { + hash = (37 * hash) + POSITIVE_SPANS_FIELD_NUMBER; + hash = (53 * hash) + getPositiveSpansList().hashCode(); + } + if (getPositiveDeltasCount() > 0) { + hash = (37 * hash) + POSITIVE_DELTAS_FIELD_NUMBER; + hash = (53 * hash) + getPositiveDeltasList().hashCode(); + } + if (getPositiveCountsCount() > 0) { + hash = (37 * hash) + POSITIVE_COUNTS_FIELD_NUMBER; + hash = (53 * hash) + getPositiveCountsList().hashCode(); + } + hash = (37 * hash) + RESET_HINT_FIELD_NUMBER; + hash = (53 * hash) + resetHint_; + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTimestamp()); + if (getCustomValuesCount() > 0) { + hash = (37 * hash) + CUSTOM_VALUES_FIELD_NUMBER; + hash = (53 * hash) + getCustomValuesList().hashCode(); + } + switch (countCase_) { + case 1: + hash = (37 * hash) + COUNT_INT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getCountInt()); + break; + case 2: + hash = (37 * hash) + COUNT_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCountFloat())); + break; + case 0: + default: + } + switch (zeroCountCase_) { + case 6: + hash = (37 * hash) + ZERO_COUNT_INT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getZeroCountInt()); + break; + case 7: + hash = (37 * hash) + ZERO_COUNT_FLOAT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getZeroCountFloat())); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static prometheus.Types.Histogram parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static prometheus.Types.Histogram parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static prometheus.Types.Histogram parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static prometheus.Types.Histogram parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static prometheus.Types.Histogram parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static prometheus.Types.Histogram parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static prometheus.Types.Histogram parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static prometheus.Types.Histogram parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static prometheus.Types.Histogram parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static prometheus.Types.Histogram parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static prometheus.Types.Histogram parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static prometheus.Types.Histogram parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(prometheus.Types.Histogram prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A native histogram, also known as a sparse histogram.
+     * Original design doc:
+     * https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit
+     * The appendix of this design doc also explains the concept of float
+     * histograms. This Histogram message can represent both, the usual
+     * integer histogram as well as a float histogram.
+     * 
+ * + * Protobuf type {@code prometheus.Histogram} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:prometheus.Histogram) + prometheus.Types.HistogramOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return prometheus.Types.internal_static_prometheus_Histogram_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return prometheus.Types.internal_static_prometheus_Histogram_fieldAccessorTable + .ensureFieldAccessorsInitialized( + prometheus.Types.Histogram.class, prometheus.Types.Histogram.Builder.class); + } + + // Construct using prometheus.Types.Histogram.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNegativeSpansFieldBuilder(); + getPositiveSpansFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + sum_ = 0D; + + schema_ = 0; + + zeroThreshold_ = 0D; + + if (negativeSpansBuilder_ == null) { + negativeSpans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + negativeSpansBuilder_.clear(); + } + negativeDeltas_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + negativeCounts_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000004); + if (positiveSpansBuilder_ == null) { + positiveSpans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + positiveSpansBuilder_.clear(); + } + positiveDeltas_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000010); + positiveCounts_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000020); + resetHint_ = 0; + + timestamp_ = 0L; + + customValues_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000040); + countCase_ = 0; + count_ = null; + zeroCountCase_ = 0; + zeroCount_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return prometheus.Types.internal_static_prometheus_Histogram_descriptor; + } + + @java.lang.Override + public prometheus.Types.Histogram getDefaultInstanceForType() { + return prometheus.Types.Histogram.getDefaultInstance(); + } + + @java.lang.Override + public prometheus.Types.Histogram build() { + prometheus.Types.Histogram result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public prometheus.Types.Histogram buildPartial() { + prometheus.Types.Histogram result = new prometheus.Types.Histogram(this); + int from_bitField0_ = bitField0_; + if (countCase_ == 1) { + result.count_ = count_; + } + if (countCase_ == 2) { + result.count_ = count_; + } + result.sum_ = sum_; + result.schema_ = schema_; + result.zeroThreshold_ = zeroThreshold_; + if (zeroCountCase_ == 6) { + result.zeroCount_ = zeroCount_; + } + if (zeroCountCase_ == 7) { + result.zeroCount_ = zeroCount_; + } + if (negativeSpansBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + negativeSpans_ = java.util.Collections.unmodifiableList(negativeSpans_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.negativeSpans_ = negativeSpans_; + } else { + result.negativeSpans_ = negativeSpansBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + negativeDeltas_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.negativeDeltas_ = negativeDeltas_; + if (((bitField0_ & 0x00000004) != 0)) { + negativeCounts_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.negativeCounts_ = negativeCounts_; + if (positiveSpansBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + positiveSpans_ = java.util.Collections.unmodifiableList(positiveSpans_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.positiveSpans_ = positiveSpans_; + } else { + result.positiveSpans_ = positiveSpansBuilder_.build(); + } + if (((bitField0_ & 0x00000010) != 0)) { + positiveDeltas_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.positiveDeltas_ = positiveDeltas_; + if (((bitField0_ & 0x00000020) != 0)) { + positiveCounts_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.positiveCounts_ = positiveCounts_; + result.resetHint_ = resetHint_; + result.timestamp_ = timestamp_; + if (((bitField0_ & 0x00000040) != 0)) { + customValues_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.customValues_ = customValues_; + result.countCase_ = countCase_; + result.zeroCountCase_ = zeroCountCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof prometheus.Types.Histogram) { + return mergeFrom((prometheus.Types.Histogram)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(prometheus.Types.Histogram other) { + if (other == prometheus.Types.Histogram.getDefaultInstance()) return this; + if (other.getSum() != 0D) { + setSum(other.getSum()); + } + if (other.getSchema() != 0) { + setSchema(other.getSchema()); + } + if (other.getZeroThreshold() != 0D) { + setZeroThreshold(other.getZeroThreshold()); + } + if (negativeSpansBuilder_ == null) { + if (!other.negativeSpans_.isEmpty()) { + if (negativeSpans_.isEmpty()) { + negativeSpans_ = other.negativeSpans_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNegativeSpansIsMutable(); + negativeSpans_.addAll(other.negativeSpans_); + } + onChanged(); + } + } else { + if (!other.negativeSpans_.isEmpty()) { + if (negativeSpansBuilder_.isEmpty()) { + negativeSpansBuilder_.dispose(); + negativeSpansBuilder_ = null; + negativeSpans_ = other.negativeSpans_; + bitField0_ = (bitField0_ & ~0x00000001); + negativeSpansBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNegativeSpansFieldBuilder() : null; + } else { + negativeSpansBuilder_.addAllMessages(other.negativeSpans_); + } + } + } + if (!other.negativeDeltas_.isEmpty()) { + if (negativeDeltas_.isEmpty()) { + negativeDeltas_ = other.negativeDeltas_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureNegativeDeltasIsMutable(); + negativeDeltas_.addAll(other.negativeDeltas_); + } + onChanged(); + } + if (!other.negativeCounts_.isEmpty()) { + if (negativeCounts_.isEmpty()) { + negativeCounts_ = other.negativeCounts_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNegativeCountsIsMutable(); + negativeCounts_.addAll(other.negativeCounts_); + } + onChanged(); + } + if (positiveSpansBuilder_ == null) { + if (!other.positiveSpans_.isEmpty()) { + if (positiveSpans_.isEmpty()) { + positiveSpans_ = other.positiveSpans_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePositiveSpansIsMutable(); + positiveSpans_.addAll(other.positiveSpans_); + } + onChanged(); + } + } else { + if (!other.positiveSpans_.isEmpty()) { + if (positiveSpansBuilder_.isEmpty()) { + positiveSpansBuilder_.dispose(); + positiveSpansBuilder_ = null; + positiveSpans_ = other.positiveSpans_; + bitField0_ = (bitField0_ & ~0x00000008); + positiveSpansBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPositiveSpansFieldBuilder() : null; + } else { + positiveSpansBuilder_.addAllMessages(other.positiveSpans_); + } + } + } + if (!other.positiveDeltas_.isEmpty()) { + if (positiveDeltas_.isEmpty()) { + positiveDeltas_ = other.positiveDeltas_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensurePositiveDeltasIsMutable(); + positiveDeltas_.addAll(other.positiveDeltas_); + } + onChanged(); + } + if (!other.positiveCounts_.isEmpty()) { + if (positiveCounts_.isEmpty()) { + positiveCounts_ = other.positiveCounts_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensurePositiveCountsIsMutable(); + positiveCounts_.addAll(other.positiveCounts_); + } + onChanged(); + } + if (other.resetHint_ != 0) { + setResetHintValue(other.getResetHintValue()); + } + if (other.getTimestamp() != 0L) { + setTimestamp(other.getTimestamp()); + } + if (!other.customValues_.isEmpty()) { + if (customValues_.isEmpty()) { + customValues_ = other.customValues_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureCustomValuesIsMutable(); + customValues_.addAll(other.customValues_); + } + onChanged(); + } + switch (other.getCountCase()) { + case COUNT_INT: { + setCountInt(other.getCountInt()); + break; + } + case COUNT_FLOAT: { + setCountFloat(other.getCountFloat()); + break; + } + case COUNT_NOT_SET: { + break; + } + } + switch (other.getZeroCountCase()) { + case ZERO_COUNT_INT: { + setZeroCountInt(other.getZeroCountInt()); + break; + } + case ZERO_COUNT_FLOAT: { + setZeroCountFloat(other.getZeroCountFloat()); + break; + } + case ZEROCOUNT_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + prometheus.Types.Histogram parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (prometheus.Types.Histogram) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int countCase_ = 0; + private java.lang.Object count_; + public CountCase + getCountCase() { + return CountCase.forNumber( + countCase_); + } + + public Builder clearCount() { + countCase_ = 0; + count_ = null; + onChanged(); + return this; + } + + private int zeroCountCase_ = 0; + private java.lang.Object zeroCount_; + public ZeroCountCase + getZeroCountCase() { + return ZeroCountCase.forNumber( + zeroCountCase_); + } + + public Builder clearZeroCount() { + zeroCountCase_ = 0; + zeroCount_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * uint64 count_int = 1; + * @return Whether the countInt field is set. + */ + public boolean hasCountInt() { + return countCase_ == 1; + } + /** + * uint64 count_int = 1; + * @return The countInt. + */ + public long getCountInt() { + if (countCase_ == 1) { + return (java.lang.Long) count_; + } + return 0L; + } + /** + * uint64 count_int = 1; + * @param value The countInt to set. + * @return This builder for chaining. + */ + public Builder setCountInt(long value) { + countCase_ = 1; + count_ = value; + onChanged(); + return this; + } + /** + * uint64 count_int = 1; + * @return This builder for chaining. + */ + public Builder clearCountInt() { + if (countCase_ == 1) { + countCase_ = 0; + count_ = null; + onChanged(); + } + return this; + } + + /** + * double count_float = 2; + * @return Whether the countFloat field is set. + */ + public boolean hasCountFloat() { + return countCase_ == 2; + } + /** + * double count_float = 2; + * @return The countFloat. + */ + public double getCountFloat() { + if (countCase_ == 2) { + return (java.lang.Double) count_; + } + return 0D; + } + /** + * double count_float = 2; + * @param value The countFloat to set. + * @return This builder for chaining. + */ + public Builder setCountFloat(double value) { + countCase_ = 2; + count_ = value; + onChanged(); + return this; + } + /** + * double count_float = 2; + * @return This builder for chaining. + */ + public Builder clearCountFloat() { + if (countCase_ == 2) { + countCase_ = 0; + count_ = null; + onChanged(); + } + return this; + } + + private double sum_ ; + /** + *
+       * Sum of observations in the histogram.
+       * 
+ * + * double sum = 3; + * @return The sum. + */ + @java.lang.Override + public double getSum() { + return sum_; + } + /** + *
+       * Sum of observations in the histogram.
+       * 
+ * + * double sum = 3; + * @param value The sum to set. + * @return This builder for chaining. + */ + public Builder setSum(double value) { + + sum_ = value; + onChanged(); + return this; + } + /** + *
+       * Sum of observations in the histogram.
+       * 
+ * + * double sum = 3; + * @return This builder for chaining. + */ + public Builder clearSum() { + + sum_ = 0D; + onChanged(); + return this; + } + + private int schema_ ; + /** + *
+       * The schema defines the bucket schema. Currently, valid numbers
+       * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+       * is a bucket boundary in each case, and then each power of two is
+       * divided into 2^n logarithmic buckets. Or in other words, each
+       * bucket boundary is the previous boundary times 2^(2^-n). In the
+       * future, more bucket schemas may be added using numbers < -4 or >
+       * 8.
+       * 
+ * + * sint32 schema = 4; + * @return The schema. + */ + @java.lang.Override + public int getSchema() { + return schema_; + } + /** + *
+       * The schema defines the bucket schema. Currently, valid numbers
+       * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+       * is a bucket boundary in each case, and then each power of two is
+       * divided into 2^n logarithmic buckets. Or in other words, each
+       * bucket boundary is the previous boundary times 2^(2^-n). In the
+       * future, more bucket schemas may be added using numbers < -4 or >
+       * 8.
+       * 
+ * + * sint32 schema = 4; + * @param value The schema to set. + * @return This builder for chaining. + */ + public Builder setSchema(int value) { + + schema_ = value; + onChanged(); + return this; + } + /** + *
+       * The schema defines the bucket schema. Currently, valid numbers
+       * are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+       * is a bucket boundary in each case, and then each power of two is
+       * divided into 2^n logarithmic buckets. Or in other words, each
+       * bucket boundary is the previous boundary times 2^(2^-n). In the
+       * future, more bucket schemas may be added using numbers < -4 or >
+       * 8.
+       * 
+ * + * sint32 schema = 4; + * @return This builder for chaining. + */ + public Builder clearSchema() { + + schema_ = 0; + onChanged(); + return this; + } + + private double zeroThreshold_ ; + /** + *
+       * Breadth of the zero bucket.
+       * 
+ * + * double zero_threshold = 5; + * @return The zeroThreshold. + */ + @java.lang.Override + public double getZeroThreshold() { + return zeroThreshold_; + } + /** + *
+       * Breadth of the zero bucket.
+       * 
+ * + * double zero_threshold = 5; + * @param value The zeroThreshold to set. + * @return This builder for chaining. + */ + public Builder setZeroThreshold(double value) { + + zeroThreshold_ = value; + onChanged(); + return this; + } + /** + *
+       * Breadth of the zero bucket.
+       * 
+ * + * double zero_threshold = 5; + * @return This builder for chaining. + */ + public Builder clearZeroThreshold() { + + zeroThreshold_ = 0D; + onChanged(); + return this; + } + + /** + * uint64 zero_count_int = 6; + * @return Whether the zeroCountInt field is set. + */ + public boolean hasZeroCountInt() { + return zeroCountCase_ == 6; + } + /** + * uint64 zero_count_int = 6; + * @return The zeroCountInt. + */ + public long getZeroCountInt() { + if (zeroCountCase_ == 6) { + return (java.lang.Long) zeroCount_; + } + return 0L; + } + /** + * uint64 zero_count_int = 6; + * @param value The zeroCountInt to set. + * @return This builder for chaining. + */ + public Builder setZeroCountInt(long value) { + zeroCountCase_ = 6; + zeroCount_ = value; + onChanged(); + return this; + } + /** + * uint64 zero_count_int = 6; + * @return This builder for chaining. + */ + public Builder clearZeroCountInt() { + if (zeroCountCase_ == 6) { + zeroCountCase_ = 0; + zeroCount_ = null; + onChanged(); + } + return this; + } + + /** + * double zero_count_float = 7; + * @return Whether the zeroCountFloat field is set. + */ + public boolean hasZeroCountFloat() { + return zeroCountCase_ == 7; + } + /** + * double zero_count_float = 7; + * @return The zeroCountFloat. + */ + public double getZeroCountFloat() { + if (zeroCountCase_ == 7) { + return (java.lang.Double) zeroCount_; + } + return 0D; + } + /** + * double zero_count_float = 7; + * @param value The zeroCountFloat to set. + * @return This builder for chaining. + */ + public Builder setZeroCountFloat(double value) { + zeroCountCase_ = 7; + zeroCount_ = value; + onChanged(); + return this; + } + /** + * double zero_count_float = 7; + * @return This builder for chaining. + */ + public Builder clearZeroCountFloat() { + if (zeroCountCase_ == 7) { + zeroCountCase_ = 0; + zeroCount_ = null; + onChanged(); + } + return this; + } + + private java.util.List negativeSpans_ = + java.util.Collections.emptyList(); + private void ensureNegativeSpansIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + negativeSpans_ = new java.util.ArrayList(negativeSpans_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + prometheus.Types.BucketSpan, prometheus.Types.BucketSpan.Builder, prometheus.Types.BucketSpanOrBuilder> negativeSpansBuilder_; + + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public java.util.List getNegativeSpansList() { + if (negativeSpansBuilder_ == null) { + return java.util.Collections.unmodifiableList(negativeSpans_); + } else { + return negativeSpansBuilder_.getMessageList(); + } + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public int getNegativeSpansCount() { + if (negativeSpansBuilder_ == null) { + return negativeSpans_.size(); + } else { + return negativeSpansBuilder_.getCount(); + } + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public prometheus.Types.BucketSpan getNegativeSpans(int index) { + if (negativeSpansBuilder_ == null) { + return negativeSpans_.get(index); + } else { + return negativeSpansBuilder_.getMessage(index); + } + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder setNegativeSpans( + int index, prometheus.Types.BucketSpan value) { + if (negativeSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpansIsMutable(); + negativeSpans_.set(index, value); + onChanged(); + } else { + negativeSpansBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder setNegativeSpans( + int index, prometheus.Types.BucketSpan.Builder builderForValue) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.set(index, builderForValue.build()); + onChanged(); + } else { + negativeSpansBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder addNegativeSpans(prometheus.Types.BucketSpan value) { + if (negativeSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpansIsMutable(); + negativeSpans_.add(value); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder addNegativeSpans( + int index, prometheus.Types.BucketSpan value) { + if (negativeSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNegativeSpansIsMutable(); + negativeSpans_.add(index, value); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder addNegativeSpans( + prometheus.Types.BucketSpan.Builder builderForValue) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.add(builderForValue.build()); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder addNegativeSpans( + int index, prometheus.Types.BucketSpan.Builder builderForValue) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.add(index, builderForValue.build()); + onChanged(); + } else { + negativeSpansBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder addAllNegativeSpans( + java.lang.Iterable values) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, negativeSpans_); + onChanged(); + } else { + negativeSpansBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder clearNegativeSpans() { + if (negativeSpansBuilder_ == null) { + negativeSpans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + negativeSpansBuilder_.clear(); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public Builder removeNegativeSpans(int index) { + if (negativeSpansBuilder_ == null) { + ensureNegativeSpansIsMutable(); + negativeSpans_.remove(index); + onChanged(); + } else { + negativeSpansBuilder_.remove(index); + } + return this; + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public prometheus.Types.BucketSpan.Builder getNegativeSpansBuilder( + int index) { + return getNegativeSpansFieldBuilder().getBuilder(index); + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public prometheus.Types.BucketSpanOrBuilder getNegativeSpansOrBuilder( + int index) { + if (negativeSpansBuilder_ == null) { + return negativeSpans_.get(index); } else { + return negativeSpansBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public java.util.List + getNegativeSpansOrBuilderList() { + if (negativeSpansBuilder_ != null) { + return negativeSpansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(negativeSpans_); + } + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public prometheus.Types.BucketSpan.Builder addNegativeSpansBuilder() { + return getNegativeSpansFieldBuilder().addBuilder( + prometheus.Types.BucketSpan.getDefaultInstance()); + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public prometheus.Types.BucketSpan.Builder addNegativeSpansBuilder( + int index) { + return getNegativeSpansFieldBuilder().addBuilder( + index, prometheus.Types.BucketSpan.getDefaultInstance()); + } + /** + *
+       * Negative Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan negative_spans = 8; + */ + public java.util.List + getNegativeSpansBuilderList() { + return getNegativeSpansFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + prometheus.Types.BucketSpan, prometheus.Types.BucketSpan.Builder, prometheus.Types.BucketSpanOrBuilder> + getNegativeSpansFieldBuilder() { + if (negativeSpansBuilder_ == null) { + negativeSpansBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + prometheus.Types.BucketSpan, prometheus.Types.BucketSpan.Builder, prometheus.Types.BucketSpanOrBuilder>( + negativeSpans_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + negativeSpans_ = null; + } + return negativeSpansBuilder_; + } + + private com.google.protobuf.Internal.LongList negativeDeltas_ = emptyLongList(); + private void ensureNegativeDeltasIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + negativeDeltas_ = mutableCopy(negativeDeltas_); + bitField0_ |= 0x00000002; + } + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @return A list containing the negativeDeltas. + */ + public java.util.List + getNegativeDeltasList() { + return ((bitField0_ & 0x00000002) != 0) ? + java.util.Collections.unmodifiableList(negativeDeltas_) : negativeDeltas_; + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @return The count of negativeDeltas. + */ + public int getNegativeDeltasCount() { + return negativeDeltas_.size(); + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @param index The index of the element to return. + * @return The negativeDeltas at the given index. + */ + public long getNegativeDeltas(int index) { + return negativeDeltas_.getLong(index); + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @param index The index to set the value at. + * @param value The negativeDeltas to set. + * @return This builder for chaining. + */ + public Builder setNegativeDeltas( + int index, long value) { + ensureNegativeDeltasIsMutable(); + negativeDeltas_.setLong(index, value); + onChanged(); + return this; + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @param value The negativeDeltas to add. + * @return This builder for chaining. + */ + public Builder addNegativeDeltas(long value) { + ensureNegativeDeltasIsMutable(); + negativeDeltas_.addLong(value); + onChanged(); + return this; + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @param values The negativeDeltas to add. + * @return This builder for chaining. + */ + public Builder addAllNegativeDeltas( + java.lang.Iterable values) { + ensureNegativeDeltasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, negativeDeltas_); + onChanged(); + return this; + } + /** + *
+       * Use either "negative_deltas" or "negative_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 negative_deltas = 9; + * @return This builder for chaining. + */ + public Builder clearNegativeDeltas() { + negativeDeltas_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList negativeCounts_ = emptyDoubleList(); + private void ensureNegativeCountsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + negativeCounts_ = mutableCopy(negativeCounts_); + bitField0_ |= 0x00000004; + } + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @return A list containing the negativeCounts. + */ + public java.util.List + getNegativeCountsList() { + return ((bitField0_ & 0x00000004) != 0) ? + java.util.Collections.unmodifiableList(negativeCounts_) : negativeCounts_; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @return The count of negativeCounts. + */ + public int getNegativeCountsCount() { + return negativeCounts_.size(); + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @param index The index of the element to return. + * @return The negativeCounts at the given index. + */ + public double getNegativeCounts(int index) { + return negativeCounts_.getDouble(index); + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @param index The index to set the value at. + * @param value The negativeCounts to set. + * @return This builder for chaining. + */ + public Builder setNegativeCounts( + int index, double value) { + ensureNegativeCountsIsMutable(); + negativeCounts_.setDouble(index, value); + onChanged(); + return this; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @param value The negativeCounts to add. + * @return This builder for chaining. + */ + public Builder addNegativeCounts(double value) { + ensureNegativeCountsIsMutable(); + negativeCounts_.addDouble(value); + onChanged(); + return this; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @param values The negativeCounts to add. + * @return This builder for chaining. + */ + public Builder addAllNegativeCounts( + java.lang.Iterable values) { + ensureNegativeCountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, negativeCounts_); + onChanged(); + return this; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double negative_counts = 10; + * @return This builder for chaining. + */ + public Builder clearNegativeCounts() { + negativeCounts_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + private java.util.List positiveSpans_ = + java.util.Collections.emptyList(); + private void ensurePositiveSpansIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + positiveSpans_ = new java.util.ArrayList(positiveSpans_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + prometheus.Types.BucketSpan, prometheus.Types.BucketSpan.Builder, prometheus.Types.BucketSpanOrBuilder> positiveSpansBuilder_; + + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public java.util.List getPositiveSpansList() { + if (positiveSpansBuilder_ == null) { + return java.util.Collections.unmodifiableList(positiveSpans_); + } else { + return positiveSpansBuilder_.getMessageList(); + } + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public int getPositiveSpansCount() { + if (positiveSpansBuilder_ == null) { + return positiveSpans_.size(); + } else { + return positiveSpansBuilder_.getCount(); + } + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public prometheus.Types.BucketSpan getPositiveSpans(int index) { + if (positiveSpansBuilder_ == null) { + return positiveSpans_.get(index); + } else { + return positiveSpansBuilder_.getMessage(index); + } + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder setPositiveSpans( + int index, prometheus.Types.BucketSpan value) { + if (positiveSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpansIsMutable(); + positiveSpans_.set(index, value); + onChanged(); + } else { + positiveSpansBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder setPositiveSpans( + int index, prometheus.Types.BucketSpan.Builder builderForValue) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.set(index, builderForValue.build()); + onChanged(); + } else { + positiveSpansBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder addPositiveSpans(prometheus.Types.BucketSpan value) { + if (positiveSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpansIsMutable(); + positiveSpans_.add(value); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder addPositiveSpans( + int index, prometheus.Types.BucketSpan value) { + if (positiveSpansBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositiveSpansIsMutable(); + positiveSpans_.add(index, value); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder addPositiveSpans( + prometheus.Types.BucketSpan.Builder builderForValue) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.add(builderForValue.build()); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder addPositiveSpans( + int index, prometheus.Types.BucketSpan.Builder builderForValue) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.add(index, builderForValue.build()); + onChanged(); + } else { + positiveSpansBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder addAllPositiveSpans( + java.lang.Iterable values) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positiveSpans_); + onChanged(); + } else { + positiveSpansBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder clearPositiveSpans() { + if (positiveSpansBuilder_ == null) { + positiveSpans_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + positiveSpansBuilder_.clear(); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public Builder removePositiveSpans(int index) { + if (positiveSpansBuilder_ == null) { + ensurePositiveSpansIsMutable(); + positiveSpans_.remove(index); + onChanged(); + } else { + positiveSpansBuilder_.remove(index); + } + return this; + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public prometheus.Types.BucketSpan.Builder getPositiveSpansBuilder( + int index) { + return getPositiveSpansFieldBuilder().getBuilder(index); + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public prometheus.Types.BucketSpanOrBuilder getPositiveSpansOrBuilder( + int index) { + if (positiveSpansBuilder_ == null) { + return positiveSpans_.get(index); } else { + return positiveSpansBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public java.util.List + getPositiveSpansOrBuilderList() { + if (positiveSpansBuilder_ != null) { + return positiveSpansBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(positiveSpans_); + } + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public prometheus.Types.BucketSpan.Builder addPositiveSpansBuilder() { + return getPositiveSpansFieldBuilder().addBuilder( + prometheus.Types.BucketSpan.getDefaultInstance()); + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public prometheus.Types.BucketSpan.Builder addPositiveSpansBuilder( + int index) { + return getPositiveSpansFieldBuilder().addBuilder( + index, prometheus.Types.BucketSpan.getDefaultInstance()); + } + /** + *
+       * Positive Buckets.
+       * 
+ * + * repeated .prometheus.BucketSpan positive_spans = 11; + */ + public java.util.List + getPositiveSpansBuilderList() { + return getPositiveSpansFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + prometheus.Types.BucketSpan, prometheus.Types.BucketSpan.Builder, prometheus.Types.BucketSpanOrBuilder> + getPositiveSpansFieldBuilder() { + if (positiveSpansBuilder_ == null) { + positiveSpansBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + prometheus.Types.BucketSpan, prometheus.Types.BucketSpan.Builder, prometheus.Types.BucketSpanOrBuilder>( + positiveSpans_, + ((bitField0_ & 0x00000008) != 0), + getParentForChildren(), + isClean()); + positiveSpans_ = null; + } + return positiveSpansBuilder_; + } + + private com.google.protobuf.Internal.LongList positiveDeltas_ = emptyLongList(); + private void ensurePositiveDeltasIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + positiveDeltas_ = mutableCopy(positiveDeltas_); + bitField0_ |= 0x00000010; + } + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @return A list containing the positiveDeltas. + */ + public java.util.List + getPositiveDeltasList() { + return ((bitField0_ & 0x00000010) != 0) ? + java.util.Collections.unmodifiableList(positiveDeltas_) : positiveDeltas_; + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @return The count of positiveDeltas. + */ + public int getPositiveDeltasCount() { + return positiveDeltas_.size(); + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @param index The index of the element to return. + * @return The positiveDeltas at the given index. + */ + public long getPositiveDeltas(int index) { + return positiveDeltas_.getLong(index); + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @param index The index to set the value at. + * @param value The positiveDeltas to set. + * @return This builder for chaining. + */ + public Builder setPositiveDeltas( + int index, long value) { + ensurePositiveDeltasIsMutable(); + positiveDeltas_.setLong(index, value); + onChanged(); + return this; + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @param value The positiveDeltas to add. + * @return This builder for chaining. + */ + public Builder addPositiveDeltas(long value) { + ensurePositiveDeltasIsMutable(); + positiveDeltas_.addLong(value); + onChanged(); + return this; + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @param values The positiveDeltas to add. + * @return This builder for chaining. + */ + public Builder addAllPositiveDeltas( + java.lang.Iterable values) { + ensurePositiveDeltasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positiveDeltas_); + onChanged(); + return this; + } + /** + *
+       * Use either "positive_deltas" or "positive_counts", the former for
+       * regular histograms with integer counts, the latter for float
+       * histograms.
+       * 
+ * + * repeated sint64 positive_deltas = 12; + * @return This builder for chaining. + */ + public Builder clearPositiveDeltas() { + positiveDeltas_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList positiveCounts_ = emptyDoubleList(); + private void ensurePositiveCountsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + positiveCounts_ = mutableCopy(positiveCounts_); + bitField0_ |= 0x00000020; + } + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @return A list containing the positiveCounts. + */ + public java.util.List + getPositiveCountsList() { + return ((bitField0_ & 0x00000020) != 0) ? + java.util.Collections.unmodifiableList(positiveCounts_) : positiveCounts_; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @return The count of positiveCounts. + */ + public int getPositiveCountsCount() { + return positiveCounts_.size(); + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @param index The index of the element to return. + * @return The positiveCounts at the given index. + */ + public double getPositiveCounts(int index) { + return positiveCounts_.getDouble(index); + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @param index The index to set the value at. + * @param value The positiveCounts to set. + * @return This builder for chaining. + */ + public Builder setPositiveCounts( + int index, double value) { + ensurePositiveCountsIsMutable(); + positiveCounts_.setDouble(index, value); + onChanged(); + return this; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @param value The positiveCounts to add. + * @return This builder for chaining. + */ + public Builder addPositiveCounts(double value) { + ensurePositiveCountsIsMutable(); + positiveCounts_.addDouble(value); + onChanged(); + return this; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @param values The positiveCounts to add. + * @return This builder for chaining. + */ + public Builder addAllPositiveCounts( + java.lang.Iterable values) { + ensurePositiveCountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positiveCounts_); + onChanged(); + return this; + } + /** + *
+       * Absolute count of each bucket.
+       * 
+ * + * repeated double positive_counts = 13; + * @return This builder for chaining. + */ + public Builder clearPositiveCounts() { + positiveCounts_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + private int resetHint_ = 0; + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return The enum numeric value on the wire for resetHint. + */ + @java.lang.Override public int getResetHintValue() { + return resetHint_; + } + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @param value The enum numeric value on the wire for resetHint to set. + * @return This builder for chaining. + */ + public Builder setResetHintValue(int value) { + + resetHint_ = value; + onChanged(); + return this; + } + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return The resetHint. + */ + @java.lang.Override + public prometheus.Types.Histogram.ResetHint getResetHint() { + @SuppressWarnings("deprecation") + prometheus.Types.Histogram.ResetHint result = prometheus.Types.Histogram.ResetHint.valueOf(resetHint_); + return result == null ? prometheus.Types.Histogram.ResetHint.UNRECOGNIZED : result; + } + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @param value The resetHint to set. + * @return This builder for chaining. + */ + public Builder setResetHint(prometheus.Types.Histogram.ResetHint value) { + if (value == null) { + throw new NullPointerException(); + } + + resetHint_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .prometheus.Histogram.ResetHint reset_hint = 14; + * @return This builder for chaining. + */ + public Builder clearResetHint() { + + resetHint_ = 0; + onChanged(); + return this; + } + + private long timestamp_ ; + /** + *
+       * timestamp is in ms format, see model/timestamp/timestamp.go for
+       * conversion from time.Time to Prometheus timestamp.
+       * 
+ * + * int64 timestamp = 15; + * @return The timestamp. + */ + @java.lang.Override + public long getTimestamp() { + return timestamp_; + } + /** + *
+       * timestamp is in ms format, see model/timestamp/timestamp.go for
+       * conversion from time.Time to Prometheus timestamp.
+       * 
+ * + * int64 timestamp = 15; + * @param value The timestamp to set. + * @return This builder for chaining. + */ + public Builder setTimestamp(long value) { + + timestamp_ = value; + onChanged(); + return this; + } + /** + *
+       * timestamp is in ms format, see model/timestamp/timestamp.go for
+       * conversion from time.Time to Prometheus timestamp.
+       * 
+ * + * int64 timestamp = 15; + * @return This builder for chaining. + */ + public Builder clearTimestamp() { + + timestamp_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.DoubleList customValues_ = emptyDoubleList(); + private void ensureCustomValuesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + customValues_ = mutableCopy(customValues_); + bitField0_ |= 0x00000040; + } + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @return A list containing the customValues. + */ + public java.util.List + getCustomValuesList() { + return ((bitField0_ & 0x00000040) != 0) ? + java.util.Collections.unmodifiableList(customValues_) : customValues_; + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @return The count of customValues. + */ + public int getCustomValuesCount() { + return customValues_.size(); + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @param index The index of the element to return. + * @return The customValues at the given index. + */ + public double getCustomValues(int index) { + return customValues_.getDouble(index); + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @param index The index to set the value at. + * @param value The customValues to set. + * @return This builder for chaining. + */ + public Builder setCustomValues( + int index, double value) { + ensureCustomValuesIsMutable(); + customValues_.setDouble(index, value); + onChanged(); + return this; + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @param value The customValues to add. + * @return This builder for chaining. + */ + public Builder addCustomValues(double value) { + ensureCustomValuesIsMutable(); + customValues_.addDouble(value); + onChanged(); + return this; + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @param values The customValues to add. + * @return This builder for chaining. + */ + public Builder addAllCustomValues( + java.lang.Iterable values) { + ensureCustomValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customValues_); + onChanged(); + return this; + } + /** + *
+       * custom_values are not part of the specification, DO NOT use in remote write clients.
+       * Used only for converting from OpenTelemetry to Prometheus internally.
+       * 
+ * + * repeated double custom_values = 16; + * @return This builder for chaining. + */ + public Builder clearCustomValues() { + customValues_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:prometheus.Histogram) + } + + // @@protoc_insertion_point(class_scope:prometheus.Histogram) + private static final prometheus.Types.Histogram DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new prometheus.Types.Histogram(); + } + + public static prometheus.Types.Histogram getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Histogram parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Histogram(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public prometheus.Types.Histogram getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BucketSpanOrBuilder extends + // @@protoc_insertion_point(interface_extends:prometheus.BucketSpan) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Gap to previous span, or starting point for 1st span (which can be negative).
+     * 
+ * + * sint32 offset = 1; + * @return The offset. + */ + int getOffset(); + + /** + *
+     * Length of consecutive buckets.
+     * 
+ * + * uint32 length = 2; + * @return The length. + */ + int getLength(); + } + /** + *
+   * A BucketSpan defines a number of consecutive buckets with their
+   * offset. Logically, it would be more straightforward to include the
+   * bucket counts in the Span. However, the protobuf representation is
+   * more compact in the way the data is structured here (with all the
+   * buckets in a single array separate from the Spans).
+   * 
+ * + * Protobuf type {@code prometheus.BucketSpan} + */ + public static final class BucketSpan extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:prometheus.BucketSpan) + BucketSpanOrBuilder { + private static final long serialVersionUID = 0L; + // Use BucketSpan.newBuilder() to construct. + private BucketSpan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BucketSpan() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BucketSpan(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BucketSpan( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + offset_ = input.readSInt32(); + break; + } + case 16: { + + length_ = input.readUInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return prometheus.Types.internal_static_prometheus_BucketSpan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return prometheus.Types.internal_static_prometheus_BucketSpan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + prometheus.Types.BucketSpan.class, prometheus.Types.BucketSpan.Builder.class); + } + + public static final int OFFSET_FIELD_NUMBER = 1; + private int offset_; + /** + *
+     * Gap to previous span, or starting point for 1st span (which can be negative).
+     * 
+ * + * sint32 offset = 1; + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + + public static final int LENGTH_FIELD_NUMBER = 2; + private int length_; + /** + *
+     * Length of consecutive buckets.
+     * 
+ * + * uint32 length = 2; + * @return The length. + */ + @java.lang.Override + public int getLength() { + return length_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (offset_ != 0) { + output.writeSInt32(1, offset_); + } + if (length_ != 0) { + output.writeUInt32(2, length_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (offset_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(1, offset_); + } + if (length_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, length_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof prometheus.Types.BucketSpan)) { + return super.equals(obj); + } + prometheus.Types.BucketSpan other = (prometheus.Types.BucketSpan) obj; + + if (getOffset() + != other.getOffset()) return false; + if (getLength() + != other.getLength()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getOffset(); + hash = (37 * hash) + LENGTH_FIELD_NUMBER; + hash = (53 * hash) + getLength(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static prometheus.Types.BucketSpan parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static prometheus.Types.BucketSpan parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static prometheus.Types.BucketSpan parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static prometheus.Types.BucketSpan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static prometheus.Types.BucketSpan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static prometheus.Types.BucketSpan parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static prometheus.Types.BucketSpan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static prometheus.Types.BucketSpan parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static prometheus.Types.BucketSpan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static prometheus.Types.BucketSpan parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static prometheus.Types.BucketSpan parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static prometheus.Types.BucketSpan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(prometheus.Types.BucketSpan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A BucketSpan defines a number of consecutive buckets with their
+     * offset. Logically, it would be more straightforward to include the
+     * bucket counts in the Span. However, the protobuf representation is
+     * more compact in the way the data is structured here (with all the
+     * buckets in a single array separate from the Spans).
+     * 
+ * + * Protobuf type {@code prometheus.BucketSpan} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:prometheus.BucketSpan) + prometheus.Types.BucketSpanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return prometheus.Types.internal_static_prometheus_BucketSpan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return prometheus.Types.internal_static_prometheus_BucketSpan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + prometheus.Types.BucketSpan.class, prometheus.Types.BucketSpan.Builder.class); + } + + // Construct using prometheus.Types.BucketSpan.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + offset_ = 0; + + length_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return prometheus.Types.internal_static_prometheus_BucketSpan_descriptor; + } + + @java.lang.Override + public prometheus.Types.BucketSpan getDefaultInstanceForType() { + return prometheus.Types.BucketSpan.getDefaultInstance(); + } + + @java.lang.Override + public prometheus.Types.BucketSpan build() { + prometheus.Types.BucketSpan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public prometheus.Types.BucketSpan buildPartial() { + prometheus.Types.BucketSpan result = new prometheus.Types.BucketSpan(this); + result.offset_ = offset_; + result.length_ = length_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof prometheus.Types.BucketSpan) { + return mergeFrom((prometheus.Types.BucketSpan)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(prometheus.Types.BucketSpan other) { + if (other == prometheus.Types.BucketSpan.getDefaultInstance()) return this; + if (other.getOffset() != 0) { + setOffset(other.getOffset()); + } + if (other.getLength() != 0) { + setLength(other.getLength()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + prometheus.Types.BucketSpan parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (prometheus.Types.BucketSpan) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int offset_ ; + /** + *
+       * Gap to previous span, or starting point for 1st span (which can be negative).
+       * 
+ * + * sint32 offset = 1; + * @return The offset. + */ + @java.lang.Override + public int getOffset() { + return offset_; + } + /** + *
+       * Gap to previous span, or starting point for 1st span (which can be negative).
+       * 
+ * + * sint32 offset = 1; + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(int value) { + + offset_ = value; + onChanged(); + return this; + } + /** + *
+       * Gap to previous span, or starting point for 1st span (which can be negative).
+       * 
+ * + * sint32 offset = 1; + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0; + onChanged(); + return this; + } + + private int length_ ; + /** + *
+       * Length of consecutive buckets.
+       * 
+ * + * uint32 length = 2; + * @return The length. + */ + @java.lang.Override + public int getLength() { + return length_; + } + /** + *
+       * Length of consecutive buckets.
+       * 
+ * + * uint32 length = 2; + * @param value The length to set. + * @return This builder for chaining. + */ + public Builder setLength(int value) { + + length_ = value; + onChanged(); + return this; + } + /** + *
+       * Length of consecutive buckets.
+       * 
+ * + * uint32 length = 2; + * @return This builder for chaining. + */ + public Builder clearLength() { + + length_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:prometheus.BucketSpan) + } + + // @@protoc_insertion_point(class_scope:prometheus.BucketSpan) + private static final prometheus.Types.BucketSpan DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new prometheus.Types.BucketSpan(); + } + + public static prometheus.Types.BucketSpan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BucketSpan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BucketSpan(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public prometheus.Types.BucketSpan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + public interface TimeSeriesOrBuilder extends // @@protoc_insertion_point(interface_extends:prometheus.TimeSeries) com.google.protobuf.MessageOrBuilder { @@ -2961,6 +7497,30 @@ prometheus.Types.SampleOrBuilder getSamplesOrBuilder( */ prometheus.Types.ExemplarOrBuilder getExemplarsOrBuilder( int index); + + /** + * repeated .prometheus.Histogram histograms = 4; + */ + java.util.List + getHistogramsList(); + /** + * repeated .prometheus.Histogram histograms = 4; + */ + prometheus.Types.Histogram getHistograms(int index); + /** + * repeated .prometheus.Histogram histograms = 4; + */ + int getHistogramsCount(); + /** + * repeated .prometheus.Histogram histograms = 4; + */ + java.util.List + getHistogramsOrBuilderList(); + /** + * repeated .prometheus.Histogram histograms = 4; + */ + prometheus.Types.HistogramOrBuilder getHistogramsOrBuilder( + int index); } /** *
@@ -2982,6 +7542,7 @@ private TimeSeries() {
       labels_ = java.util.Collections.emptyList();
       samples_ = java.util.Collections.emptyList();
       exemplars_ = java.util.Collections.emptyList();
+      histograms_ = java.util.Collections.emptyList();
     }
 
     @java.lang.Override
@@ -3042,6 +7603,15 @@ private TimeSeries(
                   input.readMessage(prometheus.Types.Exemplar.parser(), extensionRegistry));
               break;
             }
+            case 34: {
+              if (!((mutable_bitField0_ & 0x00000008) != 0)) {
+                histograms_ = new java.util.ArrayList();
+                mutable_bitField0_ |= 0x00000008;
+              }
+              histograms_.add(
+                  input.readMessage(prometheus.Types.Histogram.parser(), extensionRegistry));
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -3068,6 +7638,9 @@ private TimeSeries(
         if (((mutable_bitField0_ & 0x00000004) != 0)) {
           exemplars_ = java.util.Collections.unmodifiableList(exemplars_);
         }
+        if (((mutable_bitField0_ & 0x00000008) != 0)) {
+          histograms_ = java.util.Collections.unmodifiableList(histograms_);
+        }
         this.unknownFields = unknownFields.build();
         makeExtensionsImmutable();
       }
@@ -3230,6 +7803,46 @@ public prometheus.Types.ExemplarOrBuilder getExemplarsOrBuilder(
       return exemplars_.get(index);
     }
 
+    public static final int HISTOGRAMS_FIELD_NUMBER = 4;
+    private java.util.List histograms_;
+    /**
+     * repeated .prometheus.Histogram histograms = 4;
+     */
+    @java.lang.Override
+    public java.util.List getHistogramsList() {
+      return histograms_;
+    }
+    /**
+     * repeated .prometheus.Histogram histograms = 4;
+     */
+    @java.lang.Override
+    public java.util.List 
+        getHistogramsOrBuilderList() {
+      return histograms_;
+    }
+    /**
+     * repeated .prometheus.Histogram histograms = 4;
+     */
+    @java.lang.Override
+    public int getHistogramsCount() {
+      return histograms_.size();
+    }
+    /**
+     * repeated .prometheus.Histogram histograms = 4;
+     */
+    @java.lang.Override
+    public prometheus.Types.Histogram getHistograms(int index) {
+      return histograms_.get(index);
+    }
+    /**
+     * repeated .prometheus.Histogram histograms = 4;
+     */
+    @java.lang.Override
+    public prometheus.Types.HistogramOrBuilder getHistogramsOrBuilder(
+        int index) {
+      return histograms_.get(index);
+    }
+
     private byte memoizedIsInitialized = -1;
     @java.lang.Override
     public final boolean isInitialized() {
@@ -3253,6 +7866,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
       for (int i = 0; i < exemplars_.size(); i++) {
         output.writeMessage(3, exemplars_.get(i));
       }
+      for (int i = 0; i < histograms_.size(); i++) {
+        output.writeMessage(4, histograms_.get(i));
+      }
       unknownFields.writeTo(output);
     }
 
@@ -3274,6 +7890,10 @@ public int getSerializedSize() {
         size += com.google.protobuf.CodedOutputStream
           .computeMessageSize(3, exemplars_.get(i));
       }
+      for (int i = 0; i < histograms_.size(); i++) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(4, histograms_.get(i));
+      }
       size += unknownFields.getSerializedSize();
       memoizedSize = size;
       return size;
@@ -3295,6 +7915,8 @@ public boolean equals(final java.lang.Object obj) {
           .equals(other.getSamplesList())) return false;
       if (!getExemplarsList()
           .equals(other.getExemplarsList())) return false;
+      if (!getHistogramsList()
+          .equals(other.getHistogramsList())) return false;
       if (!unknownFields.equals(other.unknownFields)) return false;
       return true;
     }
@@ -3318,6 +7940,10 @@ public int hashCode() {
         hash = (37 * hash) + EXEMPLARS_FIELD_NUMBER;
         hash = (53 * hash) + getExemplarsList().hashCode();
       }
+      if (getHistogramsCount() > 0) {
+        hash = (37 * hash) + HISTOGRAMS_FIELD_NUMBER;
+        hash = (53 * hash) + getHistogramsList().hashCode();
+      }
       hash = (29 * hash) + unknownFields.hashCode();
       memoizedHashCode = hash;
       return hash;
@@ -3453,6 +8079,7 @@ private void maybeForceBuilderInitialization() {
           getLabelsFieldBuilder();
           getSamplesFieldBuilder();
           getExemplarsFieldBuilder();
+          getHistogramsFieldBuilder();
         }
       }
       @java.lang.Override
@@ -3476,6 +8103,12 @@ public Builder clear() {
         } else {
           exemplarsBuilder_.clear();
         }
+        if (histogramsBuilder_ == null) {
+          histograms_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000008);
+        } else {
+          histogramsBuilder_.clear();
+        }
         return this;
       }
 
@@ -3530,6 +8163,15 @@ public prometheus.Types.TimeSeries buildPartial() {
         } else {
           result.exemplars_ = exemplarsBuilder_.build();
         }
+        if (histogramsBuilder_ == null) {
+          if (((bitField0_ & 0x00000008) != 0)) {
+            histograms_ = java.util.Collections.unmodifiableList(histograms_);
+            bitField0_ = (bitField0_ & ~0x00000008);
+          }
+          result.histograms_ = histograms_;
+        } else {
+          result.histograms_ = histogramsBuilder_.build();
+        }
         onBuilt();
         return result;
       }
@@ -3656,6 +8298,32 @@ public Builder mergeFrom(prometheus.Types.TimeSeries other) {
             }
           }
         }
+        if (histogramsBuilder_ == null) {
+          if (!other.histograms_.isEmpty()) {
+            if (histograms_.isEmpty()) {
+              histograms_ = other.histograms_;
+              bitField0_ = (bitField0_ & ~0x00000008);
+            } else {
+              ensureHistogramsIsMutable();
+              histograms_.addAll(other.histograms_);
+            }
+            onChanged();
+          }
+        } else {
+          if (!other.histograms_.isEmpty()) {
+            if (histogramsBuilder_.isEmpty()) {
+              histogramsBuilder_.dispose();
+              histogramsBuilder_ = null;
+              histograms_ = other.histograms_;
+              bitField0_ = (bitField0_ & ~0x00000008);
+              histogramsBuilder_ = 
+                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
+                   getHistogramsFieldBuilder() : null;
+            } else {
+              histogramsBuilder_.addAllMessages(other.histograms_);
+            }
+          }
+        }
         this.mergeUnknownFields(other.unknownFields);
         onChanged();
         return this;
@@ -4495,6 +9163,246 @@ public prometheus.Types.Exemplar.Builder addExemplarsBuilder(
         }
         return exemplarsBuilder_;
       }
+
+      private java.util.List histograms_ =
+        java.util.Collections.emptyList();
+      private void ensureHistogramsIsMutable() {
+        if (!((bitField0_ & 0x00000008) != 0)) {
+          histograms_ = new java.util.ArrayList(histograms_);
+          bitField0_ |= 0x00000008;
+         }
+      }
+
+      private com.google.protobuf.RepeatedFieldBuilderV3<
+          prometheus.Types.Histogram, prometheus.Types.Histogram.Builder, prometheus.Types.HistogramOrBuilder> histogramsBuilder_;
+
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public java.util.List getHistogramsList() {
+        if (histogramsBuilder_ == null) {
+          return java.util.Collections.unmodifiableList(histograms_);
+        } else {
+          return histogramsBuilder_.getMessageList();
+        }
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public int getHistogramsCount() {
+        if (histogramsBuilder_ == null) {
+          return histograms_.size();
+        } else {
+          return histogramsBuilder_.getCount();
+        }
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public prometheus.Types.Histogram getHistograms(int index) {
+        if (histogramsBuilder_ == null) {
+          return histograms_.get(index);
+        } else {
+          return histogramsBuilder_.getMessage(index);
+        }
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder setHistograms(
+          int index, prometheus.Types.Histogram value) {
+        if (histogramsBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureHistogramsIsMutable();
+          histograms_.set(index, value);
+          onChanged();
+        } else {
+          histogramsBuilder_.setMessage(index, value);
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder setHistograms(
+          int index, prometheus.Types.Histogram.Builder builderForValue) {
+        if (histogramsBuilder_ == null) {
+          ensureHistogramsIsMutable();
+          histograms_.set(index, builderForValue.build());
+          onChanged();
+        } else {
+          histogramsBuilder_.setMessage(index, builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder addHistograms(prometheus.Types.Histogram value) {
+        if (histogramsBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureHistogramsIsMutable();
+          histograms_.add(value);
+          onChanged();
+        } else {
+          histogramsBuilder_.addMessage(value);
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder addHistograms(
+          int index, prometheus.Types.Histogram value) {
+        if (histogramsBuilder_ == null) {
+          if (value == null) {
+            throw new NullPointerException();
+          }
+          ensureHistogramsIsMutable();
+          histograms_.add(index, value);
+          onChanged();
+        } else {
+          histogramsBuilder_.addMessage(index, value);
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder addHistograms(
+          prometheus.Types.Histogram.Builder builderForValue) {
+        if (histogramsBuilder_ == null) {
+          ensureHistogramsIsMutable();
+          histograms_.add(builderForValue.build());
+          onChanged();
+        } else {
+          histogramsBuilder_.addMessage(builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder addHistograms(
+          int index, prometheus.Types.Histogram.Builder builderForValue) {
+        if (histogramsBuilder_ == null) {
+          ensureHistogramsIsMutable();
+          histograms_.add(index, builderForValue.build());
+          onChanged();
+        } else {
+          histogramsBuilder_.addMessage(index, builderForValue.build());
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder addAllHistograms(
+          java.lang.Iterable values) {
+        if (histogramsBuilder_ == null) {
+          ensureHistogramsIsMutable();
+          com.google.protobuf.AbstractMessageLite.Builder.addAll(
+              values, histograms_);
+          onChanged();
+        } else {
+          histogramsBuilder_.addAllMessages(values);
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder clearHistograms() {
+        if (histogramsBuilder_ == null) {
+          histograms_ = java.util.Collections.emptyList();
+          bitField0_ = (bitField0_ & ~0x00000008);
+          onChanged();
+        } else {
+          histogramsBuilder_.clear();
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public Builder removeHistograms(int index) {
+        if (histogramsBuilder_ == null) {
+          ensureHistogramsIsMutable();
+          histograms_.remove(index);
+          onChanged();
+        } else {
+          histogramsBuilder_.remove(index);
+        }
+        return this;
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public prometheus.Types.Histogram.Builder getHistogramsBuilder(
+          int index) {
+        return getHistogramsFieldBuilder().getBuilder(index);
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public prometheus.Types.HistogramOrBuilder getHistogramsOrBuilder(
+          int index) {
+        if (histogramsBuilder_ == null) {
+          return histograms_.get(index);  } else {
+          return histogramsBuilder_.getMessageOrBuilder(index);
+        }
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public java.util.List 
+           getHistogramsOrBuilderList() {
+        if (histogramsBuilder_ != null) {
+          return histogramsBuilder_.getMessageOrBuilderList();
+        } else {
+          return java.util.Collections.unmodifiableList(histograms_);
+        }
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public prometheus.Types.Histogram.Builder addHistogramsBuilder() {
+        return getHistogramsFieldBuilder().addBuilder(
+            prometheus.Types.Histogram.getDefaultInstance());
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public prometheus.Types.Histogram.Builder addHistogramsBuilder(
+          int index) {
+        return getHistogramsFieldBuilder().addBuilder(
+            index, prometheus.Types.Histogram.getDefaultInstance());
+      }
+      /**
+       * repeated .prometheus.Histogram histograms = 4;
+       */
+      public java.util.List 
+           getHistogramsBuilderList() {
+        return getHistogramsFieldBuilder().getBuilderList();
+      }
+      private com.google.protobuf.RepeatedFieldBuilderV3<
+          prometheus.Types.Histogram, prometheus.Types.Histogram.Builder, prometheus.Types.HistogramOrBuilder> 
+          getHistogramsFieldBuilder() {
+        if (histogramsBuilder_ == null) {
+          histogramsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
+              prometheus.Types.Histogram, prometheus.Types.Histogram.Builder, prometheus.Types.HistogramOrBuilder>(
+                  histograms_,
+                  ((bitField0_ & 0x00000008) != 0),
+                  getParentForChildren(),
+                  isClean());
+          histograms_ = null;
+        }
+        return histogramsBuilder_;
+      }
       @java.lang.Override
       public final Builder setUnknownFields(
           final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -8530,6 +13438,14 @@ public enum Encoding
        * XOR = 1;
        */
       XOR(1),
+      /**
+       * HISTOGRAM = 2;
+       */
+      HISTOGRAM(2),
+      /**
+       * FLOAT_HISTOGRAM = 3;
+       */
+      FLOAT_HISTOGRAM(3),
       UNRECOGNIZED(-1),
       ;
 
@@ -8541,6 +13457,14 @@ public enum Encoding
        * XOR = 1;
        */
       public static final int XOR_VALUE = 1;
+      /**
+       * HISTOGRAM = 2;
+       */
+      public static final int HISTOGRAM_VALUE = 2;
+      /**
+       * FLOAT_HISTOGRAM = 3;
+       */
+      public static final int FLOAT_HISTOGRAM_VALUE = 3;
 
 
       public final int getNumber() {
@@ -8569,6 +13493,8 @@ public static Encoding forNumber(int value) {
         switch (value) {
           case 0: return UNKNOWN;
           case 1: return XOR;
+          case 2: return HISTOGRAM;
+          case 3: return FLOAT_HISTOGRAM;
           default: return null;
         }
       }
@@ -10652,6 +15578,16 @@ public prometheus.Types.ChunkedSeries getDefaultInstanceForType() {
   private static final 
     com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internal_static_prometheus_Exemplar_fieldAccessorTable;
+  private static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_prometheus_Histogram_descriptor;
+  private static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_prometheus_Histogram_fieldAccessorTable;
+  private static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_prometheus_BucketSpan_descriptor;
+  private static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_prometheus_BucketSpan_fieldAccessorTable;
   private static final com.google.protobuf.Descriptors.Descriptor
     internal_static_prometheus_TimeSeries_descriptor;
   private static final 
@@ -10706,26 +15642,43 @@ public prometheus.Types.ChunkedSeries getDefaultInstanceForType() {
       "\022\014\n\010STATESET\020\007\"*\n\006Sample\022\r\n\005value\030\001 \001(\001\022" +
       "\021\n\ttimestamp\030\002 \001(\003\"O\n\010Exemplar\022!\n\006labels" +
       "\030\001 \003(\0132\021.prometheus.Label\022\r\n\005value\030\002 \001(\001" +
-      "\022\021\n\ttimestamp\030\003 \001(\003\"}\n\nTimeSeries\022!\n\006lab" +
-      "els\030\001 \003(\0132\021.prometheus.Label\022#\n\007samples\030" +
-      "\002 \003(\0132\022.prometheus.Sample\022\'\n\texemplars\030\003" +
-      " \003(\0132\024.prometheus.Exemplar\"$\n\005Label\022\014\n\004n" +
-      "ame\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"+\n\006Labels\022!\n\006la" +
-      "bels\030\001 \003(\0132\021.prometheus.Label\"\202\001\n\014LabelM" +
-      "atcher\022+\n\004type\030\001 \001(\0162\035.prometheus.LabelM" +
-      "atcher.Type\022\014\n\004name\030\002 \001(\t\022\r\n\005value\030\003 \001(\t" +
-      "\"(\n\004Type\022\006\n\002EQ\020\000\022\007\n\003NEQ\020\001\022\006\n\002RE\020\002\022\007\n\003NRE" +
-      "\020\003\"|\n\tReadHints\022\017\n\007step_ms\030\001 \001(\003\022\014\n\004func" +
-      "\030\002 \001(\t\022\020\n\010start_ms\030\003 \001(\003\022\016\n\006end_ms\030\004 \001(\003" +
-      "\022\020\n\010grouping\030\005 \003(\t\022\n\n\002by\030\006 \001(\010\022\020\n\010range_" +
-      "ms\030\007 \001(\003\"\213\001\n\005Chunk\022\023\n\013min_time_ms\030\001 \001(\003\022" +
-      "\023\n\013max_time_ms\030\002 \001(\003\022(\n\004type\030\003 \001(\0162\032.pro" +
-      "metheus.Chunk.Encoding\022\014\n\004data\030\004 \001(\014\" \n\010" +
-      "Encoding\022\013\n\007UNKNOWN\020\000\022\007\n\003XOR\020\001\"U\n\rChunke" +
-      "dSeries\022!\n\006labels\030\001 \003(\0132\021.prometheus.Lab" +
-      "el\022!\n\006chunks\030\002 \003(\0132\021.prometheus.ChunkB=Z" +
-      ";github.com/GreptimeTeam/greptime-proto/" +
-      "go/prometheus/remoteb\006proto3"
+      "\022\021\n\ttimestamp\030\003 \001(\003\"\222\004\n\tHistogram\022\023\n\tcou" +
+      "nt_int\030\001 \001(\004H\000\022\025\n\013count_float\030\002 \001(\001H\000\022\013\n" +
+      "\003sum\030\003 \001(\001\022\016\n\006schema\030\004 \001(\021\022\026\n\016zero_thres" +
+      "hold\030\005 \001(\001\022\030\n\016zero_count_int\030\006 \001(\004H\001\022\032\n\020" +
+      "zero_count_float\030\007 \001(\001H\001\022.\n\016negative_spa" +
+      "ns\030\010 \003(\0132\026.prometheus.BucketSpan\022\027\n\017nega" +
+      "tive_deltas\030\t \003(\022\022\027\n\017negative_counts\030\n \003" +
+      "(\001\022.\n\016positive_spans\030\013 \003(\0132\026.prometheus." +
+      "BucketSpan\022\027\n\017positive_deltas\030\014 \003(\022\022\027\n\017p" +
+      "ositive_counts\030\r \003(\001\0223\n\nreset_hint\030\016 \001(\016" +
+      "2\037.prometheus.Histogram.ResetHint\022\021\n\ttim" +
+      "estamp\030\017 \001(\003\022\025\n\rcustom_values\030\020 \003(\001\"4\n\tR" +
+      "esetHint\022\013\n\007UNKNOWN\020\000\022\007\n\003YES\020\001\022\006\n\002NO\020\002\022\t" +
+      "\n\005GAUGE\020\003B\007\n\005countB\014\n\nzero_count\",\n\nBuck" +
+      "etSpan\022\016\n\006offset\030\001 \001(\021\022\016\n\006length\030\002 \001(\r\"\250" +
+      "\001\n\nTimeSeries\022!\n\006labels\030\001 \003(\0132\021.promethe" +
+      "us.Label\022#\n\007samples\030\002 \003(\0132\022.prometheus.S" +
+      "ample\022\'\n\texemplars\030\003 \003(\0132\024.prometheus.Ex" +
+      "emplar\022)\n\nhistograms\030\004 \003(\0132\025.prometheus." +
+      "Histogram\"$\n\005Label\022\014\n\004name\030\001 \001(\t\022\r\n\005valu" +
+      "e\030\002 \001(\t\"+\n\006Labels\022!\n\006labels\030\001 \003(\0132\021.prom" +
+      "etheus.Label\"\202\001\n\014LabelMatcher\022+\n\004type\030\001 " +
+      "\001(\0162\035.prometheus.LabelMatcher.Type\022\014\n\004na" +
+      "me\030\002 \001(\t\022\r\n\005value\030\003 \001(\t\"(\n\004Type\022\006\n\002EQ\020\000\022" +
+      "\007\n\003NEQ\020\001\022\006\n\002RE\020\002\022\007\n\003NRE\020\003\"|\n\tReadHints\022\017" +
+      "\n\007step_ms\030\001 \001(\003\022\014\n\004func\030\002 \001(\t\022\020\n\010start_m" +
+      "s\030\003 \001(\003\022\016\n\006end_ms\030\004 \001(\003\022\020\n\010grouping\030\005 \003(" +
+      "\t\022\n\n\002by\030\006 \001(\010\022\020\n\010range_ms\030\007 \001(\003\"\257\001\n\005Chun" +
+      "k\022\023\n\013min_time_ms\030\001 \001(\003\022\023\n\013max_time_ms\030\002 " +
+      "\001(\003\022(\n\004type\030\003 \001(\0162\032.prometheus.Chunk.Enc" +
+      "oding\022\014\n\004data\030\004 \001(\014\"D\n\010Encoding\022\013\n\007UNKNO" +
+      "WN\020\000\022\007\n\003XOR\020\001\022\r\n\tHISTOGRAM\020\002\022\023\n\017FLOAT_HI" +
+      "STOGRAM\020\003\"U\n\rChunkedSeries\022!\n\006labels\030\001 \003" +
+      "(\0132\021.prometheus.Label\022!\n\006chunks\030\002 \003(\0132\021." +
+      "prometheus.ChunkB=Z;github.com/GreptimeT" +
+      "eam/greptime-proto/go/prometheus/remoteb" +
+      "\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -10749,44 +15702,56 @@ public prometheus.Types.ChunkedSeries getDefaultInstanceForType() {
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_Exemplar_descriptor,
         new java.lang.String[] { "Labels", "Value", "Timestamp", });
-    internal_static_prometheus_TimeSeries_descriptor =
+    internal_static_prometheus_Histogram_descriptor =
       getDescriptor().getMessageTypes().get(3);
+    internal_static_prometheus_Histogram_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_prometheus_Histogram_descriptor,
+        new java.lang.String[] { "CountInt", "CountFloat", "Sum", "Schema", "ZeroThreshold", "ZeroCountInt", "ZeroCountFloat", "NegativeSpans", "NegativeDeltas", "NegativeCounts", "PositiveSpans", "PositiveDeltas", "PositiveCounts", "ResetHint", "Timestamp", "CustomValues", "Count", "ZeroCount", });
+    internal_static_prometheus_BucketSpan_descriptor =
+      getDescriptor().getMessageTypes().get(4);
+    internal_static_prometheus_BucketSpan_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_prometheus_BucketSpan_descriptor,
+        new java.lang.String[] { "Offset", "Length", });
+    internal_static_prometheus_TimeSeries_descriptor =
+      getDescriptor().getMessageTypes().get(5);
     internal_static_prometheus_TimeSeries_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_TimeSeries_descriptor,
-        new java.lang.String[] { "Labels", "Samples", "Exemplars", });
+        new java.lang.String[] { "Labels", "Samples", "Exemplars", "Histograms", });
     internal_static_prometheus_Label_descriptor =
-      getDescriptor().getMessageTypes().get(4);
+      getDescriptor().getMessageTypes().get(6);
     internal_static_prometheus_Label_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_Label_descriptor,
         new java.lang.String[] { "Name", "Value", });
     internal_static_prometheus_Labels_descriptor =
-      getDescriptor().getMessageTypes().get(5);
+      getDescriptor().getMessageTypes().get(7);
     internal_static_prometheus_Labels_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_Labels_descriptor,
         new java.lang.String[] { "Labels", });
     internal_static_prometheus_LabelMatcher_descriptor =
-      getDescriptor().getMessageTypes().get(6);
+      getDescriptor().getMessageTypes().get(8);
     internal_static_prometheus_LabelMatcher_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_LabelMatcher_descriptor,
         new java.lang.String[] { "Type", "Name", "Value", });
     internal_static_prometheus_ReadHints_descriptor =
-      getDescriptor().getMessageTypes().get(7);
+      getDescriptor().getMessageTypes().get(9);
     internal_static_prometheus_ReadHints_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_ReadHints_descriptor,
         new java.lang.String[] { "StepMs", "Func", "StartMs", "EndMs", "Grouping", "By", "RangeMs", });
     internal_static_prometheus_Chunk_descriptor =
-      getDescriptor().getMessageTypes().get(8);
+      getDescriptor().getMessageTypes().get(10);
     internal_static_prometheus_Chunk_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_Chunk_descriptor,
         new java.lang.String[] { "MinTimeMs", "MaxTimeMs", "Type", "Data", });
     internal_static_prometheus_ChunkedSeries_descriptor =
-      getDescriptor().getMessageTypes().get(9);
+      getDescriptor().getMessageTypes().get(11);
     internal_static_prometheus_ChunkedSeries_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_prometheus_ChunkedSeries_descriptor,
diff --git a/proto/prometheus/remote/types.proto b/proto/prometheus/remote/types.proto
index d9f7aa9f..6fa45604 100644
--- a/proto/prometheus/remote/types.proto
+++ b/proto/prometheus/remote/types.proto
@@ -31,7 +31,7 @@ message MetricMetadata {
   }
 
   // Represents the metric type, these match the set from Prometheus.
-  // Refer to model/textparse/interface.go for details.
+  // Refer to github.com/prometheus/common/model/metadata.go for details.
   MetricType type = 1;
   string metric_family_name = 2;
   string help = 4;
@@ -54,6 +54,75 @@ message Exemplar {
   int64 timestamp = 3;
 }
 
+// A native histogram, also known as a sparse histogram.
+// Original design doc:
+// https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit
+// The appendix of this design doc also explains the concept of float
+// histograms. This Histogram message can represent both, the usual
+// integer histogram as well as a float histogram.
+message Histogram {
+  enum ResetHint {
+    UNKNOWN = 0; // Need to test for a counter reset explicitly.
+    YES = 1; // This is the 1st histogram after a counter reset.
+    NO = 2; // There was no counter reset between this and the previous Histogram.
+    GAUGE = 3; // This is a gauge histogram where counter resets don't happen.
+  }
+
+  oneof count { // Count of observations in the histogram.
+    uint64 count_int = 1;
+    double count_float = 2;
+  }
+  double sum = 3; // Sum of observations in the histogram.
+  // The schema defines the bucket schema. Currently, valid numbers
+  // are -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
+  // is a bucket boundary in each case, and then each power of two is
+  // divided into 2^n logarithmic buckets. Or in other words, each
+  // bucket boundary is the previous boundary times 2^(2^-n). In the
+  // future, more bucket schemas may be added using numbers < -4 or >
+  // 8.
+  sint32 schema = 4;
+  double zero_threshold = 5; // Breadth of the zero bucket.
+  oneof zero_count { // Count in zero bucket.
+    uint64 zero_count_int = 6;
+    double zero_count_float = 7;
+  }
+
+  // Negative Buckets.
+  repeated BucketSpan negative_spans = 8;
+  // Use either "negative_deltas" or "negative_counts", the former for
+  // regular histograms with integer counts, the latter for float
+  // histograms.
+  repeated sint64 negative_deltas = 9; // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
+  repeated double negative_counts = 10; // Absolute count of each bucket.
+
+  // Positive Buckets.
+  repeated BucketSpan positive_spans = 11;
+  // Use either "positive_deltas" or "positive_counts", the former for
+  // regular histograms with integer counts, the latter for float
+  // histograms.
+  repeated sint64 positive_deltas = 12; // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
+  repeated double positive_counts = 13; // Absolute count of each bucket.
+
+  ResetHint reset_hint = 14;
+  // timestamp is in ms format, see model/timestamp/timestamp.go for
+  // conversion from time.Time to Prometheus timestamp.
+  int64 timestamp = 15;
+
+  // custom_values are not part of the specification, DO NOT use in remote write clients.
+  // Used only for converting from OpenTelemetry to Prometheus internally.
+  repeated double custom_values = 16;
+}
+
+// A BucketSpan defines a number of consecutive buckets with their
+// offset. Logically, it would be more straightforward to include the
+// bucket counts in the Span. However, the protobuf representation is
+// more compact in the way the data is structured here (with all the
+// buckets in a single array separate from the Spans).
+message BucketSpan {
+  sint32 offset = 1; // Gap to previous span, or starting point for 1st span (which can be negative).
+  uint32 length = 2; // Length of consecutive buckets.
+}
+
 // TimeSeries represents samples and labels for a single time series.
 message TimeSeries {
   // For a timeseries to be valid, and for the samples and exemplars
@@ -61,6 +130,7 @@ message TimeSeries {
   repeated Label labels = 1;
   repeated Sample samples = 2;
   repeated Exemplar exemplars = 3;
+  repeated Histogram histograms = 4;
 }
 
 message Label {
@@ -105,6 +175,8 @@ message Chunk {
   enum Encoding {
     UNKNOWN = 0;
     XOR = 1;
+    HISTOGRAM = 2;
+    FLOAT_HISTOGRAM = 3;
   }
   Encoding type = 3;
   bytes data = 4;