diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/examples/sampleapp.py b/exporter/opentelemetry-exporter-prometheus-remote-write/examples/sampleapp.py index 3a764c5683..120c8eee3a 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/examples/sampleapp.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/examples/sampleapp.py @@ -7,15 +7,14 @@ import psutil from opentelemetry import metrics - +from opentelemetry.exporter.prometheus_remote_write import ( + PrometheusRemoteWriteMetricsExporter, +) from opentelemetry.metrics import ( Observation, get_meter_provider, set_meter_provider, ) -from opentelemetry.exporter.prometheus_remote_write import ( - PrometheusRemoteWriteMetricsExporter, -) from opentelemetry.sdk.metrics import MeterProvider from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader @@ -29,7 +28,7 @@ endpoint="http://cortex:9009/api/prom/push", headers={"X-Scope-Org-ID": "5"}, ) -reader = PeriodicExportingMetricReader(exporter,1000) +reader = PeriodicExportingMetricReader(exporter, 1000) provider = MeterProvider(metric_readers=[reader]) metrics.set_meter_provider(provider) meter = metrics.get_meter(__name__) @@ -98,7 +97,7 @@ def get_ram_usage_callback(observer): # updown counter requests_active.add(num % 7231 + 200, testing_labels) - request_latency.record(num % 92,testing_labels) + request_latency.record(num % 92, testing_labels) logger.log(level=INFO, msg="completed metrics collection cycle") time.sleep(1) num += 9791 diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/__init__.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/__init__.py index 006ee1f5d7..210a1866f1 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/__init__.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/__init__.py @@ -14,10 +14,10 @@ import logging import re -from typing import Dict, Sequence - from collections import defaultdict from itertools import chain +from typing import Dict, Sequence + import requests import snappy @@ -29,29 +29,30 @@ Sample, TimeSeries, ) +from opentelemetry.sdk.metrics import Counter +from opentelemetry.sdk.metrics import Histogram as ClientHistogram +from opentelemetry.sdk.metrics import ( + ObservableCounter, + ObservableGauge, + ObservableUpDownCounter, + UpDownCounter, +) from opentelemetry.sdk.metrics.export import ( AggregationTemporality, Gauge, - Sum, Histogram, + Metric, MetricExporter, MetricExportResult, MetricsData, - Metric, -) -from opentelemetry.sdk.metrics import ( - Counter, - Histogram as ClientHistogram, - ObservableCounter, - ObservableGauge, - ObservableUpDownCounter, - UpDownCounter, + Sum, ) logger = logging.getLogger(__name__) -PROMETHEUS_NAME_REGEX = re.compile(r'[^\w:]') -PROMETHEUS_LABEL_REGEX = re.compile(r'[^\w]') +PROMETHEUS_NAME_REGEX = re.compile(r"[^\w:]") +PROMETHEUS_LABEL_REGEX = re.compile(r"[^\w]") + class PrometheusRemoteWriteMetricsExporter(MetricExporter): """ @@ -74,7 +75,7 @@ def __init__( timeout: int = 30, tls_config: Dict = None, proxies: Dict = None, - resources_as_labels : bool = True, + resources_as_labels: bool = True, preferred_temporality: Dict[type, AggregationTemporality] = None, preferred_aggregation: Dict = None, ): @@ -95,9 +96,8 @@ def __init__( ObservableUpDownCounter: AggregationTemporality.CUMULATIVE, ObservableGauge: AggregationTemporality.CUMULATIVE, } - logger.error("Calling MetricExporter") - super().__init__(preferred_temporality,preferred_aggregation) + super().__init__(preferred_temporality, preferred_aggregation) @property def endpoint(self): @@ -180,9 +180,9 @@ def headers(self, headers: Dict): def export( self, - metrics_data : MetricsData, + metrics_data: MetricsData, timeout_millis: float = 10_000, - ) ->MetricExportResult: + ) -> MetricExportResult: if not metrics_data: return MetricExportResult.SUCCESS timeseries = self._translate_data(metrics_data) @@ -203,121 +203,129 @@ def _translate_data(self, data: MetricsData) -> Sequence[TimeSeries]: # OTLP Data model suggests combining some attrs into job/instance # Should we do that here? if self.resources_as_labels: - resource_labels = [ (n,str(v)) for n,v in resource.attributes.items() ] + resource_labels = [ + (n, str(v)) for n, v in resource.attributes.items() + ] else: resource_labels = [] # Scope name/version probably not too useful from a labeling perspective for scope_metrics in resource_metrics.scope_metrics: for metric in scope_metrics.metrics: - rw_timeseries.extend( self._parse_metric(metric,resource_labels) ) + rw_timeseries.extend( + self._parse_metric(metric, resource_labels) + ) return rw_timeseries - def _parse_metric(self, metric: Metric, resource_labels: Sequence) -> Sequence[TimeSeries]: + def _parse_metric( + self, metric: Metric, resource_labels: Sequence + ) -> Sequence[TimeSeries]: """ Parses the Metric & lower objects, then converts the output into OM TimeSeries. Returns a List of TimeSeries objects based on one Metric """ - # Create the metric name, will be a label later if metric.unit: - #Prom. naming guidelines add unit to the name - name =f"{metric.name}_{metric.unit}" + # Prom. naming guidelines add unit to the name + name = f"{metric.name}_{metric.unit}" else: name = metric.name # datapoints have attributes associated with them. these would be sent # to RW as different metrics: name & labels is a unique time series sample_sets = defaultdict(list) - if isinstance(metric.data,(Gauge,Sum)): + if isinstance(metric.data, (Gauge, Sum)): for dp in metric.data.data_points: - attrs,sample = self._parse_data_point(dp,name) + attrs, sample = self._parse_data_point(dp, name) sample_sets[attrs].append(sample) - elif isinstance(metric.data,Histogram): + elif isinstance(metric.data, Histogram): for dp in metric.data.data_points: - dp_result = self._parse_histogram_data_point(dp,name) - for attrs,sample in dp_result: + dp_result = self._parse_histogram_data_point(dp, name) + for attrs, sample in dp_result: sample_sets[attrs].append(sample) else: - logger.warn("Unsupported Metric Type: %s",type(metric.data)) + logger.warn("Unsupported Metric Type: %s", type(metric.data)) return [] timeseries = [] for labels, samples in sample_sets.items(): ts = TimeSeries() - for label_name,label_value in chain(resource_labels,labels): + for label_name, label_value in chain(resource_labels, labels): # Previous implementation did not str() the names... - ts.labels.append(self._label(label_name,str(label_value))) - for value,timestamp in samples: - ts.samples.append(self._sample(value,timestamp)) + ts.labels.append(self._label(label_name, str(label_value))) + for value, timestamp in samples: + ts.samples.append(self._sample(value, timestamp)) timeseries.append(ts) return timeseries - def _sample(self,value: int,timestamp :int) -> Sample: + def _sample(self, value: int, timestamp: int) -> Sample: sample = Sample() sample.value = value sample.timestamp = timestamp return sample - def _label(self,name:str,value:str) -> Label: + def _label(self, name: str, value: str) -> Label: label = Label() - label.name = PROMETHEUS_LABEL_REGEX.sub("_",name) + label.name = PROMETHEUS_LABEL_REGEX.sub("_", name) label.value = value return label - def _sanitize_name(self,name): + def _sanitize_name(self, name): # I Think Prometheus requires names to NOT start with a number this # would not catch that, but do cover the other cases. The naming rules # don't explicit say this, but the supplied regex implies it. # Got a little weird trying to do substitution with it, but can be # fixed if we allow numeric beginnings to metric names - return PROMETHEUS_NAME_REGEX.sub("_",name) + return PROMETHEUS_NAME_REGEX.sub("_", name) def _parse_histogram_data_point(self, data_point, name): - #if (len(data_point.explicit_bounds)+1) != len(data_point.bucket_counts): + # if (len(data_point.explicit_bounds)+1) != len(data_point.bucket_counts): # raise ValueError("Number of buckets must be 1 more than the explicit bounds!") sample_attr_pairs = [] - base_attrs = [(n,v) for n,v in data_point.attributes.items()] + base_attrs = [(n, v) for n, v in data_point.attributes.items()] timestamp = data_point.time_unix_nano // 1_000_000 - - def handle_bucket(value,bound=None,name_override=None): + def handle_bucket(value, bound=None, name_override=None): # Metric Level attributes + the bucket boundry attribute + name ts_attrs = base_attrs.copy() - ts_attrs.append(("__name__",self._sanitize_name(name_override or name))) + ts_attrs.append( + ("__name__", self._sanitize_name(name_override or name)) + ) if bound: - ts_attrs.append(("le",str(bound))) + ts_attrs.append(("le", str(bound))) # Value is count of values in each bucket - ts_sample = (value,timestamp) + ts_sample = (value, timestamp) return tuple(ts_attrs), ts_sample - for bound_pos,bound in enumerate(data_point.explicit_bounds): + for bound_pos, bound in enumerate(data_point.explicit_bounds): sample_attr_pairs.append( - handle_bucket(data_point.bucket_counts[bound_pos],bound) + handle_bucket(data_point.bucket_counts[bound_pos], bound) ) # Add the last label for implicit +inf bucket sample_attr_pairs.append( - handle_bucket(data_point.bucket_counts[-1],bound="+Inf") + handle_bucket(data_point.bucket_counts[-1], bound="+Inf") ) - #Lastly, add series for count & sum + # Lastly, add series for count & sum sample_attr_pairs.append( - handle_bucket(data_point.sum,name_override=f"{name}_sum") + handle_bucket(data_point.sum, name_override=f"{name}_sum") ) sample_attr_pairs.append( - handle_bucket(data_point.count,name_override=f"{name}_count") + handle_bucket(data_point.count, name_override=f"{name}_count") ) return sample_attr_pairs - def _parse_data_point(self, data_point,name=None): + def _parse_data_point(self, data_point, name=None): - attrs = tuple(data_point.attributes.items()) + (("__name__",self._sanitize_name(name)),) - sample = (data_point.value,(data_point.time_unix_nano // 1_000_000)) - return attrs,sample + attrs = tuple(data_point.attributes.items()) + ( + ("__name__", self._sanitize_name(name)), + ) + sample = (data_point.value, (data_point.time_unix_nano // 1_000_000)) + return attrs, sample # pylint: disable=no-member,no-self-use def _build_message(self, timeseries: Sequence[TimeSeries]) -> bytes: @@ -383,4 +391,3 @@ def force_flush(self, timeout_millis: float = 10_000) -> bool: def shutdown(self) -> None: pass - diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo_pb2.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo_pb2.py index 35e48b214a..d5cce2a857 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo_pb2.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo_pb2.py @@ -6,96 +6,257 @@ from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database + # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 +from google.protobuf import ( + descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2, +) -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\x12\tgogoproto\x1a google/protobuf/descriptor.proto:;\n\x13goproto_enum_prefix\x12\x1c.google.protobuf.EnumOptions\x18\xb1\xe4\x03 \x01(\x08:=\n\x15goproto_enum_stringer\x12\x1c.google.protobuf.EnumOptions\x18\xc5\xe4\x03 \x01(\x08:5\n\renum_stringer\x12\x1c.google.protobuf.EnumOptions\x18\xc6\xe4\x03 \x01(\x08:7\n\x0f\x65num_customname\x12\x1c.google.protobuf.EnumOptions\x18\xc7\xe4\x03 \x01(\t:0\n\x08\x65numdecl\x12\x1c.google.protobuf.EnumOptions\x18\xc8\xe4\x03 \x01(\x08:A\n\x14\x65numvalue_customname\x12!.google.protobuf.EnumValueOptions\x18\xd1\x83\x04 \x01(\t:;\n\x13goproto_getters_all\x12\x1c.google.protobuf.FileOptions\x18\x99\xec\x03 \x01(\x08:?\n\x17goproto_enum_prefix_all\x12\x1c.google.protobuf.FileOptions\x18\x9a\xec\x03 \x01(\x08:<\n\x14goproto_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\x9b\xec\x03 \x01(\x08:9\n\x11verbose_equal_all\x12\x1c.google.protobuf.FileOptions\x18\x9c\xec\x03 \x01(\x08:0\n\x08\x66\x61\x63\x65_all\x12\x1c.google.protobuf.FileOptions\x18\x9d\xec\x03 \x01(\x08:4\n\x0cgostring_all\x12\x1c.google.protobuf.FileOptions\x18\x9e\xec\x03 \x01(\x08:4\n\x0cpopulate_all\x12\x1c.google.protobuf.FileOptions\x18\x9f\xec\x03 \x01(\x08:4\n\x0cstringer_all\x12\x1c.google.protobuf.FileOptions\x18\xa0\xec\x03 \x01(\x08:3\n\x0bonlyone_all\x12\x1c.google.protobuf.FileOptions\x18\xa1\xec\x03 \x01(\x08:1\n\tequal_all\x12\x1c.google.protobuf.FileOptions\x18\xa5\xec\x03 \x01(\x08:7\n\x0f\x64\x65scription_all\x12\x1c.google.protobuf.FileOptions\x18\xa6\xec\x03 \x01(\x08:3\n\x0btestgen_all\x12\x1c.google.protobuf.FileOptions\x18\xa7\xec\x03 \x01(\x08:4\n\x0c\x62\x65nchgen_all\x12\x1c.google.protobuf.FileOptions\x18\xa8\xec\x03 \x01(\x08:5\n\rmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xa9\xec\x03 \x01(\x08:7\n\x0funmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xaa\xec\x03 \x01(\x08:<\n\x14stable_marshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xab\xec\x03 \x01(\x08:1\n\tsizer_all\x12\x1c.google.protobuf.FileOptions\x18\xac\xec\x03 \x01(\x08:A\n\x19goproto_enum_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\xad\xec\x03 \x01(\x08:9\n\x11\x65num_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\xae\xec\x03 \x01(\x08:<\n\x14unsafe_marshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xaf\xec\x03 \x01(\x08:>\n\x16unsafe_unmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xb0\xec\x03 \x01(\x08:B\n\x1agoproto_extensions_map_all\x12\x1c.google.protobuf.FileOptions\x18\xb1\xec\x03 \x01(\x08:@\n\x18goproto_unrecognized_all\x12\x1c.google.protobuf.FileOptions\x18\xb2\xec\x03 \x01(\x08:8\n\x10gogoproto_import\x12\x1c.google.protobuf.FileOptions\x18\xb3\xec\x03 \x01(\x08:6\n\x0eprotosizer_all\x12\x1c.google.protobuf.FileOptions\x18\xb4\xec\x03 \x01(\x08:3\n\x0b\x63ompare_all\x12\x1c.google.protobuf.FileOptions\x18\xb5\xec\x03 \x01(\x08:4\n\x0ctypedecl_all\x12\x1c.google.protobuf.FileOptions\x18\xb6\xec\x03 \x01(\x08:4\n\x0c\x65numdecl_all\x12\x1c.google.protobuf.FileOptions\x18\xb7\xec\x03 \x01(\x08:<\n\x14goproto_registration\x12\x1c.google.protobuf.FileOptions\x18\xb8\xec\x03 \x01(\x08:7\n\x0fmessagename_all\x12\x1c.google.protobuf.FileOptions\x18\xb9\xec\x03 \x01(\x08:=\n\x15goproto_sizecache_all\x12\x1c.google.protobuf.FileOptions\x18\xba\xec\x03 \x01(\x08:;\n\x13goproto_unkeyed_all\x12\x1c.google.protobuf.FileOptions\x18\xbb\xec\x03 \x01(\x08::\n\x0fgoproto_getters\x12\x1f.google.protobuf.MessageOptions\x18\x81\xf4\x03 \x01(\x08:;\n\x10goproto_stringer\x12\x1f.google.protobuf.MessageOptions\x18\x83\xf4\x03 \x01(\x08:8\n\rverbose_equal\x12\x1f.google.protobuf.MessageOptions\x18\x84\xf4\x03 \x01(\x08:/\n\x04\x66\x61\x63\x65\x12\x1f.google.protobuf.MessageOptions\x18\x85\xf4\x03 \x01(\x08:3\n\x08gostring\x12\x1f.google.protobuf.MessageOptions\x18\x86\xf4\x03 \x01(\x08:3\n\x08populate\x12\x1f.google.protobuf.MessageOptions\x18\x87\xf4\x03 \x01(\x08:3\n\x08stringer\x12\x1f.google.protobuf.MessageOptions\x18\xc0\x8b\x04 \x01(\x08:2\n\x07onlyone\x12\x1f.google.protobuf.MessageOptions\x18\x89\xf4\x03 \x01(\x08:0\n\x05\x65qual\x12\x1f.google.protobuf.MessageOptions\x18\x8d\xf4\x03 \x01(\x08:6\n\x0b\x64\x65scription\x12\x1f.google.protobuf.MessageOptions\x18\x8e\xf4\x03 \x01(\x08:2\n\x07testgen\x12\x1f.google.protobuf.MessageOptions\x18\x8f\xf4\x03 \x01(\x08:3\n\x08\x62\x65nchgen\x12\x1f.google.protobuf.MessageOptions\x18\x90\xf4\x03 \x01(\x08:4\n\tmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x91\xf4\x03 \x01(\x08:6\n\x0bunmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x92\xf4\x03 \x01(\x08:;\n\x10stable_marshaler\x12\x1f.google.protobuf.MessageOptions\x18\x93\xf4\x03 \x01(\x08:0\n\x05sizer\x12\x1f.google.protobuf.MessageOptions\x18\x94\xf4\x03 \x01(\x08:;\n\x10unsafe_marshaler\x12\x1f.google.protobuf.MessageOptions\x18\x97\xf4\x03 \x01(\x08:=\n\x12unsafe_unmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x98\xf4\x03 \x01(\x08:A\n\x16goproto_extensions_map\x12\x1f.google.protobuf.MessageOptions\x18\x99\xf4\x03 \x01(\x08:?\n\x14goproto_unrecognized\x12\x1f.google.protobuf.MessageOptions\x18\x9a\xf4\x03 \x01(\x08:5\n\nprotosizer\x12\x1f.google.protobuf.MessageOptions\x18\x9c\xf4\x03 \x01(\x08:2\n\x07\x63ompare\x12\x1f.google.protobuf.MessageOptions\x18\x9d\xf4\x03 \x01(\x08:3\n\x08typedecl\x12\x1f.google.protobuf.MessageOptions\x18\x9e\xf4\x03 \x01(\x08:6\n\x0bmessagename\x12\x1f.google.protobuf.MessageOptions\x18\xa1\xf4\x03 \x01(\x08:<\n\x11goproto_sizecache\x12\x1f.google.protobuf.MessageOptions\x18\xa2\xf4\x03 \x01(\x08::\n\x0fgoproto_unkeyed\x12\x1f.google.protobuf.MessageOptions\x18\xa3\xf4\x03 \x01(\x08:1\n\x08nullable\x12\x1d.google.protobuf.FieldOptions\x18\xe9\xfb\x03 \x01(\x08:.\n\x05\x65mbed\x12\x1d.google.protobuf.FieldOptions\x18\xea\xfb\x03 \x01(\x08:3\n\ncustomtype\x12\x1d.google.protobuf.FieldOptions\x18\xeb\xfb\x03 \x01(\t:3\n\ncustomname\x12\x1d.google.protobuf.FieldOptions\x18\xec\xfb\x03 \x01(\t:0\n\x07jsontag\x12\x1d.google.protobuf.FieldOptions\x18\xed\xfb\x03 \x01(\t:1\n\x08moretags\x12\x1d.google.protobuf.FieldOptions\x18\xee\xfb\x03 \x01(\t:1\n\x08\x63\x61sttype\x12\x1d.google.protobuf.FieldOptions\x18\xef\xfb\x03 \x01(\t:0\n\x07\x63\x61stkey\x12\x1d.google.protobuf.FieldOptions\x18\xf0\xfb\x03 \x01(\t:2\n\tcastvalue\x12\x1d.google.protobuf.FieldOptions\x18\xf1\xfb\x03 \x01(\t:0\n\x07stdtime\x12\x1d.google.protobuf.FieldOptions\x18\xf2\xfb\x03 \x01(\x08:4\n\x0bstdduration\x12\x1d.google.protobuf.FieldOptions\x18\xf3\xfb\x03 \x01(\x08:3\n\nwktpointer\x12\x1d.google.protobuf.FieldOptions\x18\xf4\xfb\x03 \x01(\x08\x42\x45\n\x13\x63om.google.protobufB\nGoGoProtosZ\"github.com/gogo/protobuf/gogoproto') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\nGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\x12\tgogoproto\x1a google/protobuf/descriptor.proto:;\n\x13goproto_enum_prefix\x12\x1c.google.protobuf.EnumOptions\x18\xb1\xe4\x03 \x01(\x08:=\n\x15goproto_enum_stringer\x12\x1c.google.protobuf.EnumOptions\x18\xc5\xe4\x03 \x01(\x08:5\n\renum_stringer\x12\x1c.google.protobuf.EnumOptions\x18\xc6\xe4\x03 \x01(\x08:7\n\x0f\x65num_customname\x12\x1c.google.protobuf.EnumOptions\x18\xc7\xe4\x03 \x01(\t:0\n\x08\x65numdecl\x12\x1c.google.protobuf.EnumOptions\x18\xc8\xe4\x03 \x01(\x08:A\n\x14\x65numvalue_customname\x12!.google.protobuf.EnumValueOptions\x18\xd1\x83\x04 \x01(\t:;\n\x13goproto_getters_all\x12\x1c.google.protobuf.FileOptions\x18\x99\xec\x03 \x01(\x08:?\n\x17goproto_enum_prefix_all\x12\x1c.google.protobuf.FileOptions\x18\x9a\xec\x03 \x01(\x08:<\n\x14goproto_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\x9b\xec\x03 \x01(\x08:9\n\x11verbose_equal_all\x12\x1c.google.protobuf.FileOptions\x18\x9c\xec\x03 \x01(\x08:0\n\x08\x66\x61\x63\x65_all\x12\x1c.google.protobuf.FileOptions\x18\x9d\xec\x03 \x01(\x08:4\n\x0cgostring_all\x12\x1c.google.protobuf.FileOptions\x18\x9e\xec\x03 \x01(\x08:4\n\x0cpopulate_all\x12\x1c.google.protobuf.FileOptions\x18\x9f\xec\x03 \x01(\x08:4\n\x0cstringer_all\x12\x1c.google.protobuf.FileOptions\x18\xa0\xec\x03 \x01(\x08:3\n\x0bonlyone_all\x12\x1c.google.protobuf.FileOptions\x18\xa1\xec\x03 \x01(\x08:1\n\tequal_all\x12\x1c.google.protobuf.FileOptions\x18\xa5\xec\x03 \x01(\x08:7\n\x0f\x64\x65scription_all\x12\x1c.google.protobuf.FileOptions\x18\xa6\xec\x03 \x01(\x08:3\n\x0btestgen_all\x12\x1c.google.protobuf.FileOptions\x18\xa7\xec\x03 \x01(\x08:4\n\x0c\x62\x65nchgen_all\x12\x1c.google.protobuf.FileOptions\x18\xa8\xec\x03 \x01(\x08:5\n\rmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xa9\xec\x03 \x01(\x08:7\n\x0funmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xaa\xec\x03 \x01(\x08:<\n\x14stable_marshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xab\xec\x03 \x01(\x08:1\n\tsizer_all\x12\x1c.google.protobuf.FileOptions\x18\xac\xec\x03 \x01(\x08:A\n\x19goproto_enum_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\xad\xec\x03 \x01(\x08:9\n\x11\x65num_stringer_all\x12\x1c.google.protobuf.FileOptions\x18\xae\xec\x03 \x01(\x08:<\n\x14unsafe_marshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xaf\xec\x03 \x01(\x08:>\n\x16unsafe_unmarshaler_all\x12\x1c.google.protobuf.FileOptions\x18\xb0\xec\x03 \x01(\x08:B\n\x1agoproto_extensions_map_all\x12\x1c.google.protobuf.FileOptions\x18\xb1\xec\x03 \x01(\x08:@\n\x18goproto_unrecognized_all\x12\x1c.google.protobuf.FileOptions\x18\xb2\xec\x03 \x01(\x08:8\n\x10gogoproto_import\x12\x1c.google.protobuf.FileOptions\x18\xb3\xec\x03 \x01(\x08:6\n\x0eprotosizer_all\x12\x1c.google.protobuf.FileOptions\x18\xb4\xec\x03 \x01(\x08:3\n\x0b\x63ompare_all\x12\x1c.google.protobuf.FileOptions\x18\xb5\xec\x03 \x01(\x08:4\n\x0ctypedecl_all\x12\x1c.google.protobuf.FileOptions\x18\xb6\xec\x03 \x01(\x08:4\n\x0c\x65numdecl_all\x12\x1c.google.protobuf.FileOptions\x18\xb7\xec\x03 \x01(\x08:<\n\x14goproto_registration\x12\x1c.google.protobuf.FileOptions\x18\xb8\xec\x03 \x01(\x08:7\n\x0fmessagename_all\x12\x1c.google.protobuf.FileOptions\x18\xb9\xec\x03 \x01(\x08:=\n\x15goproto_sizecache_all\x12\x1c.google.protobuf.FileOptions\x18\xba\xec\x03 \x01(\x08:;\n\x13goproto_unkeyed_all\x12\x1c.google.protobuf.FileOptions\x18\xbb\xec\x03 \x01(\x08::\n\x0fgoproto_getters\x12\x1f.google.protobuf.MessageOptions\x18\x81\xf4\x03 \x01(\x08:;\n\x10goproto_stringer\x12\x1f.google.protobuf.MessageOptions\x18\x83\xf4\x03 \x01(\x08:8\n\rverbose_equal\x12\x1f.google.protobuf.MessageOptions\x18\x84\xf4\x03 \x01(\x08:/\n\x04\x66\x61\x63\x65\x12\x1f.google.protobuf.MessageOptions\x18\x85\xf4\x03 \x01(\x08:3\n\x08gostring\x12\x1f.google.protobuf.MessageOptions\x18\x86\xf4\x03 \x01(\x08:3\n\x08populate\x12\x1f.google.protobuf.MessageOptions\x18\x87\xf4\x03 \x01(\x08:3\n\x08stringer\x12\x1f.google.protobuf.MessageOptions\x18\xc0\x8b\x04 \x01(\x08:2\n\x07onlyone\x12\x1f.google.protobuf.MessageOptions\x18\x89\xf4\x03 \x01(\x08:0\n\x05\x65qual\x12\x1f.google.protobuf.MessageOptions\x18\x8d\xf4\x03 \x01(\x08:6\n\x0b\x64\x65scription\x12\x1f.google.protobuf.MessageOptions\x18\x8e\xf4\x03 \x01(\x08:2\n\x07testgen\x12\x1f.google.protobuf.MessageOptions\x18\x8f\xf4\x03 \x01(\x08:3\n\x08\x62\x65nchgen\x12\x1f.google.protobuf.MessageOptions\x18\x90\xf4\x03 \x01(\x08:4\n\tmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x91\xf4\x03 \x01(\x08:6\n\x0bunmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x92\xf4\x03 \x01(\x08:;\n\x10stable_marshaler\x12\x1f.google.protobuf.MessageOptions\x18\x93\xf4\x03 \x01(\x08:0\n\x05sizer\x12\x1f.google.protobuf.MessageOptions\x18\x94\xf4\x03 \x01(\x08:;\n\x10unsafe_marshaler\x12\x1f.google.protobuf.MessageOptions\x18\x97\xf4\x03 \x01(\x08:=\n\x12unsafe_unmarshaler\x12\x1f.google.protobuf.MessageOptions\x18\x98\xf4\x03 \x01(\x08:A\n\x16goproto_extensions_map\x12\x1f.google.protobuf.MessageOptions\x18\x99\xf4\x03 \x01(\x08:?\n\x14goproto_unrecognized\x12\x1f.google.protobuf.MessageOptions\x18\x9a\xf4\x03 \x01(\x08:5\n\nprotosizer\x12\x1f.google.protobuf.MessageOptions\x18\x9c\xf4\x03 \x01(\x08:2\n\x07\x63ompare\x12\x1f.google.protobuf.MessageOptions\x18\x9d\xf4\x03 \x01(\x08:3\n\x08typedecl\x12\x1f.google.protobuf.MessageOptions\x18\x9e\xf4\x03 \x01(\x08:6\n\x0bmessagename\x12\x1f.google.protobuf.MessageOptions\x18\xa1\xf4\x03 \x01(\x08:<\n\x11goproto_sizecache\x12\x1f.google.protobuf.MessageOptions\x18\xa2\xf4\x03 \x01(\x08::\n\x0fgoproto_unkeyed\x12\x1f.google.protobuf.MessageOptions\x18\xa3\xf4\x03 \x01(\x08:1\n\x08nullable\x12\x1d.google.protobuf.FieldOptions\x18\xe9\xfb\x03 \x01(\x08:.\n\x05\x65mbed\x12\x1d.google.protobuf.FieldOptions\x18\xea\xfb\x03 \x01(\x08:3\n\ncustomtype\x12\x1d.google.protobuf.FieldOptions\x18\xeb\xfb\x03 \x01(\t:3\n\ncustomname\x12\x1d.google.protobuf.FieldOptions\x18\xec\xfb\x03 \x01(\t:0\n\x07jsontag\x12\x1d.google.protobuf.FieldOptions\x18\xed\xfb\x03 \x01(\t:1\n\x08moretags\x12\x1d.google.protobuf.FieldOptions\x18\xee\xfb\x03 \x01(\t:1\n\x08\x63\x61sttype\x12\x1d.google.protobuf.FieldOptions\x18\xef\xfb\x03 \x01(\t:0\n\x07\x63\x61stkey\x12\x1d.google.protobuf.FieldOptions\x18\xf0\xfb\x03 \x01(\t:2\n\tcastvalue\x12\x1d.google.protobuf.FieldOptions\x18\xf1\xfb\x03 \x01(\t:0\n\x07stdtime\x12\x1d.google.protobuf.FieldOptions\x18\xf2\xfb\x03 \x01(\x08:4\n\x0bstdduration\x12\x1d.google.protobuf.FieldOptions\x18\xf3\xfb\x03 \x01(\x08:3\n\nwktpointer\x12\x1d.google.protobuf.FieldOptions\x18\xf4\xfb\x03 \x01(\x08\x42\x45\n\x13\x63om.google.protobufB\nGoGoProtosZ"github.com/gogo/protobuf/gogoproto' +) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.exporter.prometheus_remote_write.gen.gogoproto.gogo_pb2', globals()) +_builder.BuildTopDescriptorsAndMessages( + DESCRIPTOR, + "opentelemetry.exporter.prometheus_remote_write.gen.gogoproto.gogo_pb2", + globals(), +) if _descriptor._USE_C_DESCRIPTORS == False: - google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(goproto_enum_prefix) - google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(goproto_enum_stringer) - google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(enum_stringer) - google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(enum_customname) - google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension(enumdecl) - google_dot_protobuf_dot_descriptor__pb2.EnumValueOptions.RegisterExtension(enumvalue_customname) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_getters_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_enum_prefix_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_stringer_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(verbose_equal_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(face_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(gostring_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(populate_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(stringer_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(onlyone_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(equal_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(description_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(testgen_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(benchgen_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(marshaler_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(unmarshaler_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(stable_marshaler_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(sizer_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_enum_stringer_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(enum_stringer_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(unsafe_marshaler_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(unsafe_unmarshaler_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_extensions_map_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_unrecognized_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(gogoproto_import) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(protosizer_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(compare_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(typedecl_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(enumdecl_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_registration) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(messagename_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_sizecache_all) - google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(goproto_unkeyed_all) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(goproto_getters) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(goproto_stringer) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(verbose_equal) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(face) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(gostring) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(populate) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(stringer) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(onlyone) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(equal) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(description) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(testgen) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(benchgen) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(marshaler) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(unmarshaler) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(stable_marshaler) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(sizer) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(unsafe_marshaler) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(unsafe_unmarshaler) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(goproto_extensions_map) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(goproto_unrecognized) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(protosizer) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(compare) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(typedecl) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(messagename) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(goproto_sizecache) - google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(goproto_unkeyed) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(nullable) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(embed) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(customtype) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(customname) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(jsontag) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(moretags) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(casttype) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(castkey) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(castvalue) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(stdtime) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(stdduration) - google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(wktpointer) + google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension( + goproto_enum_prefix + ) + google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension( + goproto_enum_stringer + ) + google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension( + enum_stringer + ) + google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension( + enum_customname + ) + google_dot_protobuf_dot_descriptor__pb2.EnumOptions.RegisterExtension( + enumdecl + ) + google_dot_protobuf_dot_descriptor__pb2.EnumValueOptions.RegisterExtension( + enumvalue_customname + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_getters_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_enum_prefix_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_stringer_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + verbose_equal_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + face_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + gostring_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + populate_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + stringer_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + onlyone_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + equal_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + description_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + testgen_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + benchgen_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + marshaler_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + unmarshaler_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + stable_marshaler_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + sizer_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_enum_stringer_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + enum_stringer_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + unsafe_marshaler_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + unsafe_unmarshaler_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_extensions_map_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_unrecognized_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + gogoproto_import + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + protosizer_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + compare_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + typedecl_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + enumdecl_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_registration + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + messagename_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_sizecache_all + ) + google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension( + goproto_unkeyed_all + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + goproto_getters + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + goproto_stringer + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + verbose_equal + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + face + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + gostring + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + populate + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + stringer + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + onlyone + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + equal + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + description + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + testgen + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + benchgen + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + marshaler + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + unmarshaler + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + stable_marshaler + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + sizer + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + unsafe_marshaler + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + unsafe_unmarshaler + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + goproto_extensions_map + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + goproto_unrecognized + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + protosizer + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + compare + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + typedecl + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + messagename + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + goproto_sizecache + ) + google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension( + goproto_unkeyed + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + nullable + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + embed + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + customtype + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + customname + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + jsontag + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + moretags + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + casttype + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + castkey + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + castvalue + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + stdtime + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + stdduration + ) + google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension( + wktpointer + ) - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\023com.google.protobufB\nGoGoProtosZ\"github.com/gogo/protobuf/gogoproto' + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\023com.google.protobufB\nGoGoProtosZ"github.com/gogo/protobuf/gogoproto' # @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/remote_pb2.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/remote_pb2.py index a274dbf204..09d13a7a09 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/remote_pb2.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/remote_pb2.py @@ -6,39 +6,54 @@ from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database + # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from opentelemetry.exporter.prometheus_remote_write.gen import types_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_types__pb2 -from opentelemetry.exporter.prometheus_remote_write.gen.gogoproto import gogo_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_gogoproto_dot_gogo__pb2 +from opentelemetry.exporter.prometheus_remote_write.gen import ( + types_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_types__pb2, +) +from opentelemetry.exporter.prometheus_remote_write.gen.gogoproto import ( + gogo_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_gogoproto_dot_gogo__pb2, +) -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n?opentelemetry/exporter/prometheus_remote_write/gen/remote.proto\x12\nprometheus\x1a>opentelemetry/exporter/prometheus_remote_write/gen/types.proto\x1aGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\"z\n\x0cWriteRequest\x12\x30\n\ntimeseries\x18\x01 \x03(\x0b\x32\x16.prometheus.TimeSeriesB\x04\xc8\xde\x1f\x00\x12\x32\n\x08metadata\x18\x03 \x03(\x0b\x32\x1a.prometheus.MetricMetadataB\x04\xc8\xde\x1f\x00J\x04\x08\x02\x10\x03\"\xae\x01\n\x0bReadRequest\x12\"\n\x07queries\x18\x01 \x03(\x0b\x32\x11.prometheus.Query\x12\x45\n\x17\x61\x63\x63\x65pted_response_types\x18\x02 \x03(\x0e\x32$.prometheus.ReadRequest.ResponseType\"4\n\x0cResponseType\x12\x0b\n\x07SAMPLES\x10\x00\x12\x17\n\x13STREAMED_XOR_CHUNKS\x10\x01\"8\n\x0cReadResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.prometheus.QueryResult\"\x8f\x01\n\x05Query\x12\x1a\n\x12start_timestamp_ms\x18\x01 \x01(\x03\x12\x18\n\x10\x65nd_timestamp_ms\x18\x02 \x01(\x03\x12*\n\x08matchers\x18\x03 \x03(\x0b\x32\x18.prometheus.LabelMatcher\x12$\n\x05hints\x18\x04 \x01(\x0b\x32\x15.prometheus.ReadHints\"9\n\x0bQueryResult\x12*\n\ntimeseries\x18\x01 \x03(\x0b\x32\x16.prometheus.TimeSeries\"]\n\x13\x43hunkedReadResponse\x12\x31\n\x0e\x63hunked_series\x18\x01 \x03(\x0b\x32\x19.prometheus.ChunkedSeries\x12\x13\n\x0bquery_index\x18\x02 \x01(\x03\x42\x08Z\x06prompbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n?opentelemetry/exporter/prometheus_remote_write/gen/remote.proto\x12\nprometheus\x1a>opentelemetry/exporter/prometheus_remote_write/gen/types.proto\x1aGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto"z\n\x0cWriteRequest\x12\x30\n\ntimeseries\x18\x01 \x03(\x0b\x32\x16.prometheus.TimeSeriesB\x04\xc8\xde\x1f\x00\x12\x32\n\x08metadata\x18\x03 \x03(\x0b\x32\x1a.prometheus.MetricMetadataB\x04\xc8\xde\x1f\x00J\x04\x08\x02\x10\x03"\xae\x01\n\x0bReadRequest\x12"\n\x07queries\x18\x01 \x03(\x0b\x32\x11.prometheus.Query\x12\x45\n\x17\x61\x63\x63\x65pted_response_types\x18\x02 \x03(\x0e\x32$.prometheus.ReadRequest.ResponseType"4\n\x0cResponseType\x12\x0b\n\x07SAMPLES\x10\x00\x12\x17\n\x13STREAMED_XOR_CHUNKS\x10\x01"8\n\x0cReadResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x17.prometheus.QueryResult"\x8f\x01\n\x05Query\x12\x1a\n\x12start_timestamp_ms\x18\x01 \x01(\x03\x12\x18\n\x10\x65nd_timestamp_ms\x18\x02 \x01(\x03\x12*\n\x08matchers\x18\x03 \x03(\x0b\x32\x18.prometheus.LabelMatcher\x12$\n\x05hints\x18\x04 \x01(\x0b\x32\x15.prometheus.ReadHints"9\n\x0bQueryResult\x12*\n\ntimeseries\x18\x01 \x03(\x0b\x32\x16.prometheus.TimeSeries"]\n\x13\x43hunkedReadResponse\x12\x31\n\x0e\x63hunked_series\x18\x01 \x03(\x0b\x32\x19.prometheus.ChunkedSeries\x12\x13\n\x0bquery_index\x18\x02 \x01(\x03\x42\x08Z\x06prompbb\x06proto3' +) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.exporter.prometheus_remote_write.gen.remote_pb2', globals()) +_builder.BuildTopDescriptorsAndMessages( + DESCRIPTOR, + "opentelemetry.exporter.prometheus_remote_write.gen.remote_pb2", + globals(), +) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z\006prompb' - _WRITEREQUEST.fields_by_name['timeseries']._options = None - _WRITEREQUEST.fields_by_name['timeseries']._serialized_options = b'\310\336\037\000' - _WRITEREQUEST.fields_by_name['metadata']._options = None - _WRITEREQUEST.fields_by_name['metadata']._serialized_options = b'\310\336\037\000' - _WRITEREQUEST._serialized_start=216 - _WRITEREQUEST._serialized_end=338 - _READREQUEST._serialized_start=341 - _READREQUEST._serialized_end=515 - _READREQUEST_RESPONSETYPE._serialized_start=463 - _READREQUEST_RESPONSETYPE._serialized_end=515 - _READRESPONSE._serialized_start=517 - _READRESPONSE._serialized_end=573 - _QUERY._serialized_start=576 - _QUERY._serialized_end=719 - _QUERYRESULT._serialized_start=721 - _QUERYRESULT._serialized_end=778 - _CHUNKEDREADRESPONSE._serialized_start=780 - _CHUNKEDREADRESPONSE._serialized_end=873 + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"Z\006prompb" + _WRITEREQUEST.fields_by_name["timeseries"]._options = None + _WRITEREQUEST.fields_by_name[ + "timeseries" + ]._serialized_options = b"\310\336\037\000" + _WRITEREQUEST.fields_by_name["metadata"]._options = None + _WRITEREQUEST.fields_by_name[ + "metadata" + ]._serialized_options = b"\310\336\037\000" + _WRITEREQUEST._serialized_start = 216 + _WRITEREQUEST._serialized_end = 338 + _READREQUEST._serialized_start = 341 + _READREQUEST._serialized_end = 515 + _READREQUEST_RESPONSETYPE._serialized_start = 463 + _READREQUEST_RESPONSETYPE._serialized_end = 515 + _READRESPONSE._serialized_start = 517 + _READRESPONSE._serialized_end = 573 + _QUERY._serialized_start = 576 + _QUERY._serialized_end = 719 + _QUERYRESULT._serialized_start = 721 + _QUERYRESULT._serialized_end = 778 + _CHUNKEDREADRESPONSE._serialized_start = 780 + _CHUNKEDREADRESPONSE._serialized_end = 873 # @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/types_pb2.py b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/types_pb2.py index d519e03423..a58e0194ee 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/types_pb2.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/types_pb2.py @@ -6,60 +6,81 @@ from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_database + # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from opentelemetry.exporter.prometheus_remote_write.gen.gogoproto import gogo_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_gogoproto_dot_gogo__pb2 +from opentelemetry.exporter.prometheus_remote_write.gen.gogoproto import ( + gogo_pb2 as opentelemetry_dot_exporter_dot_prometheus__remote__write_dot_gen_dot_gogoproto_dot_gogo__pb2, +) -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>opentelemetry/exporter/prometheus_remote_write/gen/types.proto\x12\nprometheus\x1aGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto\"\xf8\x01\n\x0eMetricMetadata\x12\x33\n\x04type\x18\x01 \x01(\x0e\x32%.prometheus.MetricMetadata.MetricType\x12\x1a\n\x12metric_family_name\x18\x02 \x01(\t\x12\x0c\n\x04help\x18\x04 \x01(\t\x12\x0c\n\x04unit\x18\x05 \x01(\t\"y\n\nMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\t\n\x05GAUGE\x10\x02\x12\r\n\tHISTOGRAM\x10\x03\x12\x12\n\x0eGAUGEHISTOGRAM\x10\x04\x12\x0b\n\x07SUMMARY\x10\x05\x12\x08\n\x04INFO\x10\x06\x12\x0c\n\x08STATESET\x10\x07\"*\n\x06Sample\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x11\n\ttimestamp\x18\x02 \x01(\x03\"U\n\x08\x45xemplar\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12\r\n\x05value\x18\x02 \x01(\x01\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\"\x8f\x01\n\nTimeSeries\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12)\n\x07samples\x18\x02 \x03(\x0b\x32\x12.prometheus.SampleB\x04\xc8\xde\x1f\x00\x12-\n\texemplars\x18\x03 \x03(\x0b\x32\x14.prometheus.ExemplarB\x04\xc8\xde\x1f\x00\"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"1\n\x06Labels\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\"\x82\x01\n\x0cLabelMatcher\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1d.prometheus.LabelMatcher.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\"(\n\x04Type\x12\x06\n\x02\x45Q\x10\x00\x12\x07\n\x03NEQ\x10\x01\x12\x06\n\x02RE\x10\x02\x12\x07\n\x03NRE\x10\x03\"|\n\tReadHints\x12\x0f\n\x07step_ms\x18\x01 \x01(\x03\x12\x0c\n\x04\x66unc\x18\x02 \x01(\t\x12\x10\n\x08start_ms\x18\x03 \x01(\x03\x12\x0e\n\x06\x65nd_ms\x18\x04 \x01(\x03\x12\x10\n\x08grouping\x18\x05 \x03(\t\x12\n\n\x02\x62y\x18\x06 \x01(\x08\x12\x10\n\x08range_ms\x18\x07 \x01(\x03\"\x8b\x01\n\x05\x43hunk\x12\x13\n\x0bmin_time_ms\x18\x01 \x01(\x03\x12\x13\n\x0bmax_time_ms\x18\x02 \x01(\x03\x12(\n\x04type\x18\x03 \x01(\x0e\x32\x1a.prometheus.Chunk.Encoding\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\" \n\x08\x45ncoding\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03XOR\x10\x01\"a\n\rChunkedSeries\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12\'\n\x06\x63hunks\x18\x02 \x03(\x0b\x32\x11.prometheus.ChunkB\x04\xc8\xde\x1f\x00\x42\x08Z\x06prompbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n>opentelemetry/exporter/prometheus_remote_write/gen/types.proto\x12\nprometheus\x1aGopentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo.proto"\xf8\x01\n\x0eMetricMetadata\x12\x33\n\x04type\x18\x01 \x01(\x0e\x32%.prometheus.MetricMetadata.MetricType\x12\x1a\n\x12metric_family_name\x18\x02 \x01(\t\x12\x0c\n\x04help\x18\x04 \x01(\t\x12\x0c\n\x04unit\x18\x05 \x01(\t"y\n\nMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\t\n\x05GAUGE\x10\x02\x12\r\n\tHISTOGRAM\x10\x03\x12\x12\n\x0eGAUGEHISTOGRAM\x10\x04\x12\x0b\n\x07SUMMARY\x10\x05\x12\x08\n\x04INFO\x10\x06\x12\x0c\n\x08STATESET\x10\x07"*\n\x06Sample\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x11\n\ttimestamp\x18\x02 \x01(\x03"U\n\x08\x45xemplar\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12\r\n\x05value\x18\x02 \x01(\x01\x12\x11\n\ttimestamp\x18\x03 \x01(\x03"\x8f\x01\n\nTimeSeries\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12)\n\x07samples\x18\x02 \x03(\x0b\x32\x12.prometheus.SampleB\x04\xc8\xde\x1f\x00\x12-\n\texemplars\x18\x03 \x03(\x0b\x32\x14.prometheus.ExemplarB\x04\xc8\xde\x1f\x00"$\n\x05Label\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t"1\n\x06Labels\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00"\x82\x01\n\x0cLabelMatcher\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1d.prometheus.LabelMatcher.Type\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t"(\n\x04Type\x12\x06\n\x02\x45Q\x10\x00\x12\x07\n\x03NEQ\x10\x01\x12\x06\n\x02RE\x10\x02\x12\x07\n\x03NRE\x10\x03"|\n\tReadHints\x12\x0f\n\x07step_ms\x18\x01 \x01(\x03\x12\x0c\n\x04\x66unc\x18\x02 \x01(\t\x12\x10\n\x08start_ms\x18\x03 \x01(\x03\x12\x0e\n\x06\x65nd_ms\x18\x04 \x01(\x03\x12\x10\n\x08grouping\x18\x05 \x03(\t\x12\n\n\x02\x62y\x18\x06 \x01(\x08\x12\x10\n\x08range_ms\x18\x07 \x01(\x03"\x8b\x01\n\x05\x43hunk\x12\x13\n\x0bmin_time_ms\x18\x01 \x01(\x03\x12\x13\n\x0bmax_time_ms\x18\x02 \x01(\x03\x12(\n\x04type\x18\x03 \x01(\x0e\x32\x1a.prometheus.Chunk.Encoding\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c" \n\x08\x45ncoding\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03XOR\x10\x01"a\n\rChunkedSeries\x12\'\n\x06labels\x18\x01 \x03(\x0b\x32\x11.prometheus.LabelB\x04\xc8\xde\x1f\x00\x12\'\n\x06\x63hunks\x18\x02 \x03(\x0b\x32\x11.prometheus.ChunkB\x04\xc8\xde\x1f\x00\x42\x08Z\x06prompbb\x06proto3' +) _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.exporter.prometheus_remote_write.gen.types_pb2', globals()) +_builder.BuildTopDescriptorsAndMessages( + DESCRIPTOR, + "opentelemetry.exporter.prometheus_remote_write.gen.types_pb2", + globals(), +) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'Z\006prompb' - _EXEMPLAR.fields_by_name['labels']._options = None - _EXEMPLAR.fields_by_name['labels']._serialized_options = b'\310\336\037\000' - _TIMESERIES.fields_by_name['labels']._options = None - _TIMESERIES.fields_by_name['labels']._serialized_options = b'\310\336\037\000' - _TIMESERIES.fields_by_name['samples']._options = None - _TIMESERIES.fields_by_name['samples']._serialized_options = b'\310\336\037\000' - _TIMESERIES.fields_by_name['exemplars']._options = None - _TIMESERIES.fields_by_name['exemplars']._serialized_options = b'\310\336\037\000' - _LABELS.fields_by_name['labels']._options = None - _LABELS.fields_by_name['labels']._serialized_options = b'\310\336\037\000' - _CHUNKEDSERIES.fields_by_name['labels']._options = None - _CHUNKEDSERIES.fields_by_name['labels']._serialized_options = b'\310\336\037\000' - _CHUNKEDSERIES.fields_by_name['chunks']._options = None - _CHUNKEDSERIES.fields_by_name['chunks']._serialized_options = b'\310\336\037\000' - _METRICMETADATA._serialized_start=152 - _METRICMETADATA._serialized_end=400 - _METRICMETADATA_METRICTYPE._serialized_start=279 - _METRICMETADATA_METRICTYPE._serialized_end=400 - _SAMPLE._serialized_start=402 - _SAMPLE._serialized_end=444 - _EXEMPLAR._serialized_start=446 - _EXEMPLAR._serialized_end=531 - _TIMESERIES._serialized_start=534 - _TIMESERIES._serialized_end=677 - _LABEL._serialized_start=679 - _LABEL._serialized_end=715 - _LABELS._serialized_start=717 - _LABELS._serialized_end=766 - _LABELMATCHER._serialized_start=769 - _LABELMATCHER._serialized_end=899 - _LABELMATCHER_TYPE._serialized_start=859 - _LABELMATCHER_TYPE._serialized_end=899 - _READHINTS._serialized_start=901 - _READHINTS._serialized_end=1025 - _CHUNK._serialized_start=1028 - _CHUNK._serialized_end=1167 - _CHUNK_ENCODING._serialized_start=1135 - _CHUNK_ENCODING._serialized_end=1167 - _CHUNKEDSERIES._serialized_start=1169 - _CHUNKEDSERIES._serialized_end=1266 + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"Z\006prompb" + _EXEMPLAR.fields_by_name["labels"]._options = None + _EXEMPLAR.fields_by_name[ + "labels" + ]._serialized_options = b"\310\336\037\000" + _TIMESERIES.fields_by_name["labels"]._options = None + _TIMESERIES.fields_by_name[ + "labels" + ]._serialized_options = b"\310\336\037\000" + _TIMESERIES.fields_by_name["samples"]._options = None + _TIMESERIES.fields_by_name[ + "samples" + ]._serialized_options = b"\310\336\037\000" + _TIMESERIES.fields_by_name["exemplars"]._options = None + _TIMESERIES.fields_by_name[ + "exemplars" + ]._serialized_options = b"\310\336\037\000" + _LABELS.fields_by_name["labels"]._options = None + _LABELS.fields_by_name["labels"]._serialized_options = b"\310\336\037\000" + _CHUNKEDSERIES.fields_by_name["labels"]._options = None + _CHUNKEDSERIES.fields_by_name[ + "labels" + ]._serialized_options = b"\310\336\037\000" + _CHUNKEDSERIES.fields_by_name["chunks"]._options = None + _CHUNKEDSERIES.fields_by_name[ + "chunks" + ]._serialized_options = b"\310\336\037\000" + _METRICMETADATA._serialized_start = 152 + _METRICMETADATA._serialized_end = 400 + _METRICMETADATA_METRICTYPE._serialized_start = 279 + _METRICMETADATA_METRICTYPE._serialized_end = 400 + _SAMPLE._serialized_start = 402 + _SAMPLE._serialized_end = 444 + _EXEMPLAR._serialized_start = 446 + _EXEMPLAR._serialized_end = 531 + _TIMESERIES._serialized_start = 534 + _TIMESERIES._serialized_end = 677 + _LABEL._serialized_start = 679 + _LABEL._serialized_end = 715 + _LABELS._serialized_start = 717 + _LABELS._serialized_end = 766 + _LABELMATCHER._serialized_start = 769 + _LABELMATCHER._serialized_end = 899 + _LABELMATCHER_TYPE._serialized_start = 859 + _LABELMATCHER_TYPE._serialized_end = 899 + _READHINTS._serialized_start = 901 + _READHINTS._serialized_end = 1025 + _CHUNK._serialized_start = 1028 + _CHUNK._serialized_end = 1167 + _CHUNK_ENCODING._serialized_start = 1135 + _CHUNK_ENCODING._serialized_end = 1167 + _CHUNKEDSERIES._serialized_start = 1169 + _CHUNKEDSERIES._serialized_end = 1266 # @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py index d9ef67fd8d..fe0a3c8af8 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/conftest.py @@ -1,44 +1,50 @@ - - import random -import pytest -import opentelemetry.test.metrictestutil as metric_util#import _generate_gauge, _generate_sum +import pytest +import opentelemetry.test.metrictestutil as metric_util # import _generate_gauge, _generate_sum +from opentelemetry.exporter.prometheus_remote_write import ( + PrometheusRemoteWriteMetricsExporter, +) from opentelemetry.sdk.metrics.export import ( AggregationTemporality, + Gauge, Histogram, HistogramDataPoint, - Sum, - Gauge, + Metric, MetricExportResult, MetricsData, ResourceMetrics, ScopeMetrics, - Metric, + Sum, ) -from opentelemetry.exporter.prometheus_remote_write import ( - PrometheusRemoteWriteMetricsExporter, -) + @pytest.fixture def prom_rw(): - return PrometheusRemoteWriteMetricsExporter("http://victoria:8428/api/v1/write") + return PrometheusRemoteWriteMetricsExporter( + "http://victoria:8428/api/v1/write" + ) @pytest.fixture def metric(request): - if hasattr(request,"param"): + if hasattr(request, "param"): type_ = request.param else: - type_ = random.choice(["gauge","sum"]) + type_ = random.choice(["gauge", "sum"]) if type_ == "gauge": - return metric_util._generate_gauge("test.gauge",random.randint(0,100)) + return metric_util._generate_gauge( + "test.gauge", random.randint(0, 100) + ) elif type_ == "sum": - return metric_util._generate_sum("test.sum",random.randint(0,9_999_999_999)) + return metric_util._generate_sum( + "test.sum", random.randint(0, 9_999_999_999) + ) elif type_ == "histogram": return _generate_histogram("test_histogram") + def _generate_histogram(name): dp = HistogramDataPoint( attributes={"foo": "bar", "baz": 42}, @@ -61,4 +67,3 @@ def _generate_histogram(name): "tu", data=data, ) - diff --git a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py index 3ebcb58708..77b742ce4b 100644 --- a/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py +++ b/exporter/opentelemetry-exporter-prometheus-remote-write/tests/test_prometheus_remote_write_exporter.py @@ -14,70 +14,69 @@ import unittest from unittest.mock import patch + +import pytest import snappy from opentelemetry.exporter.prometheus_remote_write import ( - PrometheusRemoteWriteMetricsExporter, PROMETHEUS_LABEL_REGEX, PROMETHEUS_NAME_REGEX, + PrometheusRemoteWriteMetricsExporter, ) from opentelemetry.exporter.prometheus_remote_write.gen.types_pb2 import ( Label, TimeSeries, ) from opentelemetry.sdk.metrics import Counter -#from opentelemetry.sdk.metrics.export import MetricExportResult -#from opentelemetry.sdk.metrics.export.aggregate import ( -# HistogramAggregator, -# LastValueAggregator, -# MinMaxSumCountAggregator, -# SumAggregator, -# ValueObserverAggregator, -#) - from opentelemetry.sdk.metrics.export import ( - NumberDataPoint, - HistogramDataPoint, Histogram, + HistogramDataPoint, + MetricExportResult, MetricsData, - ScopeMetrics, + NumberDataPoint, ResourceMetrics, - MetricExportResult, + ScopeMetrics, ) - -from opentelemetry.sdk.util.instrumentation import InstrumentationScope from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.util import get_dict_as_key +from opentelemetry.sdk.util.instrumentation import InstrumentationScope + +# from opentelemetry.sdk.metrics.export import MetricExportResult +# from opentelemetry.sdk.metrics.export.aggregate import ( +# HistogramAggregator, +# LastValueAggregator, +# MinMaxSumCountAggregator, +# SumAggregator, +# ValueObserverAggregator, +# ) -import pytest -@pytest.mark.parametrize("name,result",[ - ("abc.124","abc_124"), - (":abc", ":abc"), - ("abc.name.hi","abc_name_hi"), - ("service.name...","service_name___"), -]) -def test_name_regex(name,result,prom_rw): +@pytest.mark.parametrize( + "name,result", + [ + ("abc.124", "abc_124"), + (":abc", ":abc"), + ("abc.name.hi", "abc_name_hi"), + ("service.name...", "service_name___"), + ], +) +def test_name_regex(name, result, prom_rw): assert prom_rw._sanitize_name(name) == result def test_parse_data_point(prom_rw): - attrs = {"Foo" : "Bar","Baz" : 42} + attrs = {"Foo": "Bar", "Baz": 42} timestamp = 1641946016139533244 value = 242.42 - dp = NumberDataPoint( - attrs, - 0, - timestamp, - value - ) + dp = NumberDataPoint(attrs, 0, timestamp, value) name = "abc.123_42" - labels, sample = prom_rw._parse_data_point(dp,name) + labels, sample = prom_rw._parse_data_point(dp, name) name = "abc_123_42" - assert labels == (("Foo", "Bar"),("Baz", 42),("__name__",name)) - assert sample == (value,timestamp // 1_000_000) + assert labels == (("Foo", "Bar"), ("Baz", 42), ("__name__", name)) + assert sample == (value, timestamp // 1_000_000) + def test_parse_histogram_dp(prom_rw): attrs = {"foo": "bar", "baz": 42} @@ -95,40 +94,47 @@ def test_parse_histogram_dp(prom_rw): max=80, ) name = "foo_histogram" - label_sample_pairs = prom_rw._parse_histogram_data_point(dp,name) + label_sample_pairs = prom_rw._parse_histogram_data_point(dp, name) timestamp = timestamp // 1_000_000 bounds.append("+Inf") - for pos,bound in enumerate(bounds): + for pos, bound in enumerate(bounds): # We have to attributes, we kinda assume the bucket label is last... - assert ("le",str(bound)) == label_sample_pairs[pos][0][-1] + assert ("le", str(bound)) == label_sample_pairs[pos][0][-1] # Check and make sure we are putting the bucket counts in there - assert (dp.bucket_counts[pos],timestamp) == label_sample_pairs[pos][1] + assert (dp.bucket_counts[pos], timestamp) == label_sample_pairs[pos][1] # Last two are the sum & total count - pos +=1 - assert ("__name__",f"{name}_sum") in label_sample_pairs[pos][0] - assert (dp.sum,timestamp) == label_sample_pairs[pos][1] - - pos +=1 - assert ("__name__",f"{name}_count") in label_sample_pairs[pos][0] - assert (dp.count,timestamp) == label_sample_pairs[pos][1] - -@pytest.mark.parametrize("metric",[ - "gauge", - "sum", - "histogram", -],indirect=["metric"]) -def test_parse_metric(metric,prom_rw): + pos += 1 + assert ("__name__", f"{name}_sum") in label_sample_pairs[pos][0] + assert (dp.sum, timestamp) == label_sample_pairs[pos][1] + + pos += 1 + assert ("__name__", f"{name}_count") in label_sample_pairs[pos][0] + assert (dp.count, timestamp) == label_sample_pairs[pos][1] + + +@pytest.mark.parametrize( + "metric", + [ + "gauge", + "sum", + "histogram", + ], + indirect=["metric"], +) +def test_parse_metric(metric, prom_rw): """ Ensures output from parse_metrics are TimeSeries with expected data/size """ attributes = { - "service_name" : "foo", - "bool_value" : True, + "service_name": "foo", + "bool_value": True, } - assert len(metric.data.data_points) == 1, "We can only support a single datapoint in tests" - series = prom_rw._parse_metric(metric,tuple(attributes.items())) + assert ( + len(metric.data.data_points) == 1 + ), "We can only support a single datapoint in tests" + series = prom_rw._parse_metric(metric, tuple(attributes.items())) timestamp = metric.data.data_points[0].time_unix_nano // 1_000_000 for single_series in series: labels = str(single_series.labels) @@ -137,12 +143,14 @@ def test_parse_metric(metric,prom_rw): # This doesn't guarantee the labels aren't mixed up, but our other # test cases already do. assert "__name__" in labels - assert PROMETHEUS_NAME_REGEX.sub("_",metric.name) in labels - combined_attrs = list(attributes.items()) + list(metric.data.data_points[0].attributes.items()) - for name,value in combined_attrs: - assert PROMETHEUS_LABEL_REGEX.sub("_",name) in labels + assert PROMETHEUS_NAME_REGEX.sub("_", metric.name) in labels + combined_attrs = list(attributes.items()) + list( + metric.data.data_points[0].attributes.items() + ) + for name, value in combined_attrs: + assert PROMETHEUS_LABEL_REGEX.sub("_", name) in labels assert str(value) in labels - if isinstance(metric.data,Histogram): + if isinstance(metric.data, Histogram): values = [ metric.data.data_points[0].count, metric.data.data_points[0].sum, @@ -251,24 +259,19 @@ def test_invalid_tls_config_key_only_param(self): ) - # Ensures export is successful with valid export_records and config @patch("requests.post") -def test_valid_export(mock_post,prom_rw,metric): +def test_valid_export(mock_post, prom_rw, metric): metric = metric mock_post.return_value.configure_mock(**{"status_code": 200}) labels = get_dict_as_key({"environment": "testing"}) # Assumed a "None" for Scope or Resource aren't valid, so build them here scope = ScopeMetrics( - InstrumentationScope(name="prom-rw-test"), - [metric], - None + InstrumentationScope(name="prom-rw-test"), [metric], None ) resource = ResourceMetrics( - Resource({"service.name" : "foo"}), - [scope], - None + Resource({"service.name": "foo"}), [scope], None ) record = MetricsData([resource]) @@ -279,30 +282,35 @@ def test_valid_export(mock_post,prom_rw,metric): result = prom_rw.export([]) assert result == MetricExportResult.SUCCESS + def test_invalid_export(prom_rw): record = MetricsData([]) result = prom_rw.export(record) assert result == MetricExportResult.FAILURE + @patch("requests.post") -def test_valid_send_message(mock_post,prom_rw): +def test_valid_send_message(mock_post, prom_rw): mock_post.return_value.configure_mock(**{"ok": True}) result = prom_rw._send_message(bytes(), {}) assert mock_post.call_count == 1 assert result == MetricExportResult.SUCCESS + def test_invalid_send_message(prom_rw): result = prom_rw._send_message(bytes(), {}) assert result == MetricExportResult.FAILURE + # Verifies that build_message calls snappy.compress and returns SerializedString @patch("snappy.compress", return_value=bytes()) -def test_build_message(mock_compress,prom_rw): +def test_build_message(mock_compress, prom_rw): message = prom_rw._build_message([TimeSeries()]) assert mock_compress.call_count == 1 assert isinstance(message, bytes) + # Ensure correct headers are added when valid config is provided def test_build_headers(prom_rw): prom_rw.headers = {"Custom Header": "test_header"}