From 0e9976c16b3dc1223ae29342406cc3608acdcdba Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:20:33 +0530 Subject: [PATCH 01/41] Add grpc and proto dependencies --- exporter/opentelemetry-exporter-jaeger/setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exporter/opentelemetry-exporter-jaeger/setup.cfg b/exporter/opentelemetry-exporter-jaeger/setup.cfg index 37d2402d5f7..7e3d6f50a51 100644 --- a/exporter/opentelemetry-exporter-jaeger/setup.cfg +++ b/exporter/opentelemetry-exporter-jaeger/setup.cfg @@ -39,6 +39,8 @@ package_dir= =src packages=find_namespace: install_requires = + grpcio >= 1.0.0, < 2.0.0 + googleapis-common-protos ~= 1.52.0 thrift >= 0.10.0 opentelemetry-api == 0.17.dev0 opentelemetry-sdk == 0.17.dev0 From b6b25bd56ea133e946a76c67c6a34c94acd19e33 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:21:27 +0530 Subject: [PATCH 02/41] Add grpc client and move thrift convert logic to separate file --- .../opentelemetry/exporter/jaeger/__init__.py | 371 ++++-------------- 1 file changed, 75 insertions(+), 296 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index d95095bd9cc..e22d0974139 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -62,13 +62,27 @@ import base64 import logging import socket - +from typing import Optional, Union + +from grpc import ( + ChannelCredentials, + insecure_channel, + secure_channel, + ssl_channel_credentials, +) from thrift.protocol import TBinaryProtocol, TCompactProtocol from thrift.transport import THttpClient, TTransport +import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 from opentelemetry.configuration import Configuration from opentelemetry.exporter.jaeger.gen.agent import Agent as agent +from opentelemetry.exporter.jaeger.gen.collector_pb2 import PostSpansRequest +from opentelemetry.exporter.jaeger.gen.collector_pb2_grpc import ( + CollectorServiceStub, +) from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger +from opentelemetry.exporter.jaeger.send.thrift import AgentClientUDP, Collector +from opentelemetry.exporter.jaeger.translate import thrift, protobuf from opentelemetry.sdk.trace.export import Span, SpanExporter, SpanExportResult from opentelemetry.trace import SpanKind from opentelemetry.trace.status import StatusCode @@ -78,13 +92,8 @@ UDP_PACKET_MAX_LENGTH = 65000 -OTLP_JAEGER_SPAN_KIND = { - SpanKind.CLIENT: "client", - SpanKind.SERVER: "server", - SpanKind.CONSUMER: "consumer", - SpanKind.PRODUCER: "producer", - SpanKind.INTERNAL: "internal", -} +TRANSPORT_FORMAT_THRIFT = "thrift" +TRANSPORT_FORMAT_PROTOBUF = "protobuf" logger = logging.getLogger(__name__) @@ -102,16 +111,23 @@ class JaegerSpanExporter(SpanExporter): required. password: The password of the Basic Auth if authentication is required. + insecure: Connection type + credentials: Credentials for server authentication """ def __init__( self, - service_name, - agent_host_name=None, - agent_port=None, - collector_endpoint=None, - username=None, - password=None, + service_name: str, + agent_host_name: Optional[str] = None, + agent_port: Optional[int] = None, + collector_endpoint: Optional[str] = None, + username: Optional[str] = None, + password: Optional[str] = None, + insecure: Optional[bool] = None, + credentials: Optional[ChannelCredentials] = None, + transport_format: Union[ + TRANSPORT_FORMAT_THRIFT, TRANSPORT_FORMAT_PROTOBUF + ] = None, ): self.service_name = service_name self.agent_host_name = _parameter_setter( @@ -119,10 +135,12 @@ def __init__( env_variable=Configuration().EXPORTER_JAEGER_AGENT_HOST, default=DEFAULT_AGENT_HOST_NAME, ) - self.agent_port = _parameter_setter( - param=agent_port, - env_variable=Configuration().EXPORTER_JAEGER_AGENT_PORT, - default=DEFAULT_AGENT_PORT, + self.agent_port = int( + _parameter_setter( + param=agent_port, + env_variable=Configuration().EXPORTER_JAEGER_AGENT_PORT, + default=DEFAULT_AGENT_PORT, + ) ) self._agent_client = None self.collector_endpoint = _parameter_setter( @@ -141,9 +159,13 @@ def __init__( default=None, ) self._collector = None + self._grpc_client = None + self.insecure = insecure + self.credentials = credentials + self.transport_format = transport_format @property - def agent_client(self): + def agent_client(self) -> AgentClientUDP: if self._agent_client is None: self._agent_client = AgentClientUDP( host_name=self.agent_host_name, port=self.agent_port @@ -151,7 +173,26 @@ def agent_client(self): return self._agent_client @property - def collector(self): + def grpc_client(self) -> Optional[CollectorServiceStub]: + if not self.collector_endpoint: + return None + + if self._grpc_client is None: + if self.insecure: + self._grpc_client = CollectorServiceStub( + insecure_channel(self.collector_endpoint) + ) + else: + creds = self.credentials + if creds is None: + creds = ssl_channel_credentials() + self._grpc_client = CollectorServiceStub( + secure_channel(self.collector_endpoint, creds) + ) + return self._grpc_client + + @property + def collector(self) -> Optional[Collector]: if self._collector is not None: return self._collector @@ -168,17 +209,21 @@ def collector(self): return self._collector def export(self, spans): - jaeger_spans = _translate_to_jaeger(spans) - - batch = jaeger.Batch( - spans=jaeger_spans, - process=jaeger.Process(serviceName=self.service_name), - ) - - if self.collector is not None: - self.collector.submit(batch) + if self.transport_format == TRANSPORT_FORMAT_PROTOBUF: + spans = protobuf._to_jaeger(spans) + batch = model_pb2.Batch(spans) + request = PostSpansRequest(batch=batch) + self._grpc_client.PostSpans(request) else: - self.agent_client.emit(batch) + jaeger_spans = thrift._to_jaeger(spans) + batch = jaeger.Batch( + spans=jaeger_spans, + process=jaeger.Process(serviceName=self.service_name), + ) + if self.collector is not None: + self.collector.submit(batch) + else: + self.agent_client.emit(batch) return SpanExportResult.SUCCESS @@ -200,269 +245,3 @@ def _parameter_setter(param, env_variable, default): res = param return res - - -def _nsec_to_usec_round(nsec): - """Round nanoseconds to microseconds""" - return (nsec + 500) // 10 ** 3 - - -def _translate_to_jaeger(spans: Span): - """Translate the spans to Jaeger format. - - Args: - spans: Tuple of spans to convert - """ - - jaeger_spans = [] - - for span in spans: - ctx = span.get_span_context() - trace_id = ctx.trace_id - span_id = ctx.span_id - - start_time_us = _nsec_to_usec_round(span.start_time) - duration_us = _nsec_to_usec_round(span.end_time - span.start_time) - - status = span.status - - parent_id = span.parent.span_id if span.parent else 0 - - tags = _extract_tags(span.attributes) - tags.extend(_extract_tags(span.resource.attributes)) - - tags.extend( - [ - _get_long_tag("status.code", status.status_code.value), - _get_string_tag("status.message", status.description), - _get_string_tag("span.kind", OTLP_JAEGER_SPAN_KIND[span.kind]), - ] - ) - - if span.instrumentation_info is not None: - tags.extend( - [ - _get_string_tag( - "otel.instrumentation_library.name", - span.instrumentation_info.name, - ), - _get_string_tag( - "otel.instrumentation_library.version", - span.instrumentation_info.version, - ), - ] - ) - - # Ensure that if Status.Code is not OK, that we set the "error" tag on the Jaeger span. - if not status.is_ok: - tags.append(_get_bool_tag("error", True)) - - refs = _extract_refs_from_span(span) - logs = _extract_logs_from_span(span) - - flags = int(ctx.trace_flags) - - jaeger_span = jaeger.Span( - traceIdHigh=_get_trace_id_high(trace_id), - traceIdLow=_get_trace_id_low(trace_id), - # generated code expects i64 - spanId=_convert_int_to_i64(span_id), - operationName=span.name, - startTime=start_time_us, - duration=duration_us, - tags=tags, - logs=logs, - references=refs, - flags=flags, - parentSpanId=_convert_int_to_i64(parent_id), - ) - - jaeger_spans.append(jaeger_span) - - return jaeger_spans - - -def _extract_refs_from_span(span): - if not span.links: - return None - - refs = [] - for link in span.links: - trace_id = link.context.trace_id - span_id = link.context.span_id - refs.append( - jaeger.SpanRef( - refType=jaeger.SpanRefType.FOLLOWS_FROM, - traceIdHigh=_get_trace_id_high(trace_id), - traceIdLow=_get_trace_id_low(trace_id), - spanId=_convert_int_to_i64(span_id), - ) - ) - return refs - - -def _convert_int_to_i64(val): - """Convert integer to signed int64 (i64)""" - if val > 0x7FFFFFFFFFFFFFFF: - val -= 0x10000000000000000 - return val - - -def _get_trace_id_low(trace_id): - return _convert_int_to_i64(trace_id & 0xFFFFFFFFFFFFFFFF) - - -def _get_trace_id_high(trace_id): - return _convert_int_to_i64((trace_id >> 64) & 0xFFFFFFFFFFFFFFFF) - - -def _extract_logs_from_span(span): - if not span.events: - return None - - logs = [] - - for event in span.events: - fields = _extract_tags(event.attributes) - - fields.append( - jaeger.Tag( - key="message", vType=jaeger.TagType.STRING, vStr=event.name - ) - ) - - event_timestamp_us = _nsec_to_usec_round(event.timestamp) - logs.append( - jaeger.Log(timestamp=int(event_timestamp_us), fields=fields) - ) - return logs - - -def _extract_tags(attr): - if not attr: - return [] - tags = [] - for attribute_key, attribute_value in attr.items(): - tag = _convert_attribute_to_tag(attribute_key, attribute_value) - if tag is None: - continue - tags.append(tag) - return tags - - -def _convert_attribute_to_tag(key, attr): - """Convert the attributes to jaeger tags.""" - if isinstance(attr, bool): - return jaeger.Tag(key=key, vBool=attr, vType=jaeger.TagType.BOOL) - if isinstance(attr, str): - return jaeger.Tag(key=key, vStr=attr, vType=jaeger.TagType.STRING) - if isinstance(attr, int): - return jaeger.Tag(key=key, vLong=attr, vType=jaeger.TagType.LONG) - if isinstance(attr, float): - return jaeger.Tag(key=key, vDouble=attr, vType=jaeger.TagType.DOUBLE) - if isinstance(attr, tuple): - return jaeger.Tag(key=key, vStr=str(attr), vType=jaeger.TagType.STRING) - logger.warning("Could not serialize attribute %s:%r to tag", key, attr) - return None - - -def _get_long_tag(key, val): - return jaeger.Tag(key=key, vLong=val, vType=jaeger.TagType.LONG) - - -def _get_string_tag(key, val): - return jaeger.Tag(key=key, vStr=val, vType=jaeger.TagType.STRING) - - -def _get_bool_tag(key, val): - return jaeger.Tag(key=key, vBool=val, vType=jaeger.TagType.BOOL) - - -class AgentClientUDP: - """Implement a UDP client to agent. - - Args: - host_name: The host name of the Jaeger server. - port: The port of the Jaeger server. - max_packet_size: Maximum size of UDP packet. - client: Class for creating new client objects for agencies. - """ - - def __init__( - self, - host_name, - port, - max_packet_size=UDP_PACKET_MAX_LENGTH, - client=agent.Client, - ): - self.address = (host_name, port) - self.max_packet_size = max_packet_size - self.buffer = TTransport.TMemoryBuffer() - self.client = client( - iprot=TCompactProtocol.TCompactProtocol(trans=self.buffer) - ) - - def emit(self, batch: jaeger.Batch): - """ - Args: - batch: Object to emit Jaeger spans. - """ - - # pylint: disable=protected-access - self.client._seqid = 0 - # truncate and reset the position of BytesIO object - self.buffer._buffer.truncate(0) - self.buffer._buffer.seek(0) - self.client.emitBatch(batch) - buff = self.buffer.getvalue() - if len(buff) > self.max_packet_size: - logger.warning( - "Data exceeds the max UDP packet size; size %r, max %r", - len(buff), - self.max_packet_size, - ) - return - - with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_socket: - udp_socket.sendto(buff, self.address) - - -class Collector: - """Submits collected spans to Thrift HTTP server. - - Args: - thrift_url: URL of the Jaeger HTTP Thrift. - auth: Auth tuple that contains username and password for Basic Auth. - """ - - def __init__(self, thrift_url="", auth=None): - self.thrift_url = thrift_url - self.auth = auth - self.http_transport = THttpClient.THttpClient( - uri_or_host=self.thrift_url - ) - self.protocol = TBinaryProtocol.TBinaryProtocol(self.http_transport) - - # set basic auth header - if auth is not None: - auth_header = "{}:{}".format(*auth) - decoded = base64.b64encode(auth_header.encode()).decode("ascii") - basic_auth = dict(Authorization="Basic {}".format(decoded)) - self.http_transport.setCustomHeaders(basic_auth) - - def submit(self, batch: jaeger.Batch): - """Submits batches to Thrift HTTP Server through Binary Protocol. - - Args: - batch: Object to emit Jaeger spans. - """ - batch.write(self.protocol) - self.http_transport.flush() - code = self.http_transport.code - msg = self.http_transport.message - if code >= 300 or code < 200: - logger.error( - "Traces cannot be uploaded; HTTP status code: %s, message: %s", - code, - msg, - ) From f431dbe818451a2552523c4a58a743b78ff0216b Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:21:46 +0530 Subject: [PATCH 03/41] Rename test file --- .../tests/test_jaeger_exporter.py | 462 ------------------ 1 file changed, 462 deletions(-) delete mode 100644 exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py deleted file mode 100644 index 75ab622c954..00000000000 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter.py +++ /dev/null @@ -1,462 +0,0 @@ -# Copyright 2018, OpenCensus Authors -# Copyright The OpenTelemetry Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest -from unittest import mock - -# pylint:disable=no-name-in-module -# pylint:disable=import-error -import opentelemetry.exporter.jaeger as jaeger_exporter -from opentelemetry import trace as trace_api -from opentelemetry.configuration import Configuration -from opentelemetry.exporter.jaeger.gen.jaeger import ttypes as jaeger -from opentelemetry.sdk import trace -from opentelemetry.sdk.trace import Resource -from opentelemetry.sdk.util.instrumentation import InstrumentationInfo -from opentelemetry.trace import SpanKind -from opentelemetry.trace.status import Status, StatusCode - - -class TestJaegerSpanExporter(unittest.TestCase): - def setUp(self): - # create and save span to be used in tests - context = trace_api.SpanContext( - trace_id=0x000000000000000000000000DEADBEEF, - span_id=0x00000000DEADBEF0, - is_remote=False, - ) - - self._test_span = trace._Span("test_span", context=context) - self._test_span.start() - self._test_span.end() - # pylint: disable=protected-access - Configuration._reset() - - def tearDown(self): - # pylint: disable=protected-access - Configuration._reset() - - def test_constructor_default(self): - """Test the default values assigned by constructor.""" - service_name = "my-service-name" - agent_host_name = "localhost" - agent_port = 6831 - exporter = jaeger_exporter.JaegerSpanExporter(service_name) - - self.assertEqual(exporter.service_name, service_name) - self.assertEqual(exporter.agent_host_name, agent_host_name) - self.assertEqual(exporter.agent_port, agent_port) - self.assertEqual(exporter.collector_endpoint, None) - self.assertEqual(exporter.username, None) - self.assertEqual(exporter.password, None) - self.assertTrue(exporter.collector is None) - self.assertTrue(exporter.agent_client is not None) - - def test_constructor_explicit(self): - """Test the constructor passing all the options.""" - service = "my-opentelemetry-jaeger" - collector_endpoint = "https://opentelemetry.io:15875" - - agent_port = 14268 - agent_host_name = "opentelemetry.io" - - username = "username" - password = "password" - auth = (username, password) - - exporter = jaeger_exporter.JaegerSpanExporter( - service_name=service, - agent_host_name=agent_host_name, - agent_port=agent_port, - collector_endpoint=collector_endpoint, - username=username, - password=password, - ) - - self.assertEqual(exporter.service_name, service) - self.assertEqual(exporter.agent_host_name, agent_host_name) - self.assertEqual(exporter.agent_port, agent_port) - self.assertTrue(exporter.collector is not None) - self.assertEqual(exporter.collector.auth, auth) - # property should not construct new object - collector = exporter.collector - self.assertEqual(exporter.collector, collector) - # property should construct new object - # pylint: disable=protected-access - exporter._collector = None - exporter.username = None - exporter.password = None - self.assertNotEqual(exporter.collector, collector) - self.assertTrue(exporter.collector.auth is None) - - def test_constructor_by_environment_variables(self): - """Test the constructor using Environment Variables.""" - service = "my-opentelemetry-jaeger" - - agent_host_name = "opentelemetry.io" - agent_port = "6831" - - collector_endpoint = "https://opentelemetry.io:15875" - - username = "username" - password = "password" - auth = (username, password) - - environ_patcher = mock.patch.dict( - "os.environ", - { - "OTEL_EXPORTER_JAEGER_AGENT_HOST": agent_host_name, - "OTEL_EXPORTER_JAEGER_AGENT_PORT": agent_port, - "OTEL_EXPORTER_JAEGER_ENDPOINT": collector_endpoint, - "OTEL_EXPORTER_JAEGER_USER": username, - "OTEL_EXPORTER_JAEGER_PASSWORD": password, - }, - ) - - environ_patcher.start() - - exporter = jaeger_exporter.JaegerSpanExporter(service_name=service) - - self.assertEqual(exporter.service_name, service) - self.assertEqual(exporter.agent_host_name, agent_host_name) - self.assertEqual(exporter.agent_port, int(agent_port)) - self.assertTrue(exporter.collector is not None) - self.assertEqual(exporter.collector_endpoint, collector_endpoint) - self.assertEqual(exporter.collector.auth, auth) - # property should not construct new object - collector = exporter.collector - self.assertEqual(exporter.collector, collector) - # property should construct new object - # pylint: disable=protected-access - exporter._collector = None - exporter.username = None - exporter.password = None - self.assertNotEqual(exporter.collector, collector) - self.assertTrue(exporter.collector.auth is None) - - environ_patcher.stop() - - def test_nsec_to_usec_round(self): - # pylint: disable=protected-access - nsec_to_usec_round = jaeger_exporter._nsec_to_usec_round - - self.assertEqual(nsec_to_usec_round(5000), 5) - self.assertEqual(nsec_to_usec_round(5499), 5) - self.assertEqual(nsec_to_usec_round(5500), 6) - - def test_all_otlp_span_kinds_are_mapped(self): - for kind in SpanKind: - self.assertIn(kind, jaeger_exporter.OTLP_JAEGER_SPAN_KIND) - - # pylint: disable=too-many-locals - def test_translate_to_jaeger(self): - # pylint: disable=invalid-name - self.maxDiff = None - - span_names = ("test1", "test2", "test3") - trace_id = 0x6E0C63257DE34C926F9EFCD03927272E - trace_id_high = 0x6E0C63257DE34C92 - trace_id_low = 0x6F9EFCD03927272E - span_id = 0x34BF92DEEFC58C92 - parent_id = 0x1111111111111111 - other_id = 0x2222222222222222 - - base_time = 683647322 * 10 ** 9 # in ns - start_times = ( - base_time, - base_time + 150 * 10 ** 6, - base_time + 300 * 10 ** 6, - ) - durations = (50 * 10 ** 6, 100 * 10 ** 6, 200 * 10 ** 6) - end_times = ( - start_times[0] + durations[0], - start_times[1] + durations[1], - start_times[2] + durations[2], - ) - - span_context = trace_api.SpanContext( - trace_id, span_id, is_remote=False - ) - parent_span_context = trace_api.SpanContext( - trace_id, parent_id, is_remote=False - ) - other_context = trace_api.SpanContext( - trace_id, other_id, is_remote=False - ) - - event_attributes = { - "annotation_bool": True, - "annotation_string": "annotation_test", - "key_float": 0.3, - } - - event_timestamp = base_time + 50 * 10 ** 6 - event = trace.Event( - name="event0", - timestamp=event_timestamp, - attributes=event_attributes, - ) - - link_attributes = {"key_bool": True} - - link = trace_api.Link( - context=other_context, attributes=link_attributes - ) - - default_tags = [ - jaeger.Tag( - key="status.code", - vType=jaeger.TagType.LONG, - vLong=StatusCode.UNSET.value, - ), - jaeger.Tag( - key="status.message", vType=jaeger.TagType.STRING, vStr=None - ), - jaeger.Tag( - key="span.kind", vType=jaeger.TagType.STRING, vStr="internal", - ), - ] - - otel_spans = [ - trace._Span( - name=span_names[0], - context=span_context, - parent=parent_span_context, - events=(event,), - links=(link,), - kind=trace_api.SpanKind.CLIENT, - ), - trace._Span( - name=span_names[1], context=parent_span_context, parent=None - ), - trace._Span( - name=span_names[2], context=other_context, parent=None - ), - ] - - otel_spans[0].start(start_time=start_times[0]) - # added here to preserve order - otel_spans[0].set_attribute("key_bool", False) - otel_spans[0].set_attribute("key_string", "hello_world") - otel_spans[0].set_attribute("key_float", 111.22) - otel_spans[0].set_attribute("key_tuple", ("tuple_element",)) - otel_spans[0].resource = Resource( - attributes={"key_resource": "some_resource"} - ) - otel_spans[0].set_status( - Status(StatusCode.ERROR, "Example description") - ) - otel_spans[0].end(end_time=end_times[0]) - - otel_spans[1].start(start_time=start_times[1]) - otel_spans[1].resource = Resource({}) - otel_spans[1].end(end_time=end_times[1]) - - otel_spans[2].start(start_time=start_times[2]) - otel_spans[2].resource = Resource({}) - otel_spans[2].set_status(Status(StatusCode.OK, "Example description")) - otel_spans[2].end(end_time=end_times[2]) - otel_spans[2].instrumentation_info = InstrumentationInfo( - name="name", version="version" - ) - - # pylint: disable=protected-access - spans = jaeger_exporter._translate_to_jaeger(otel_spans) - - expected_spans = [ - jaeger.Span( - operationName=span_names[0], - traceIdHigh=trace_id_high, - traceIdLow=trace_id_low, - spanId=span_id, - parentSpanId=parent_id, - startTime=start_times[0] // 10 ** 3, - duration=durations[0] // 10 ** 3, - flags=0, - tags=[ - jaeger.Tag( - key="key_bool", vType=jaeger.TagType.BOOL, vBool=False - ), - jaeger.Tag( - key="key_string", - vType=jaeger.TagType.STRING, - vStr="hello_world", - ), - jaeger.Tag( - key="key_float", - vType=jaeger.TagType.DOUBLE, - vDouble=111.22, - ), - jaeger.Tag( - key="key_tuple", - vType=jaeger.TagType.STRING, - vStr="('tuple_element',)", - ), - jaeger.Tag( - key="key_resource", - vType=jaeger.TagType.STRING, - vStr="some_resource", - ), - jaeger.Tag( - key="status.code", - vType=jaeger.TagType.LONG, - vLong=StatusCode.ERROR.value, - ), - jaeger.Tag( - key="status.message", - vType=jaeger.TagType.STRING, - vStr="Example description", - ), - jaeger.Tag( - key="span.kind", - vType=jaeger.TagType.STRING, - vStr="client", - ), - jaeger.Tag( - key="error", vType=jaeger.TagType.BOOL, vBool=True - ), - ], - references=[ - jaeger.SpanRef( - refType=jaeger.SpanRefType.FOLLOWS_FROM, - traceIdHigh=trace_id_high, - traceIdLow=trace_id_low, - spanId=other_id, - ) - ], - logs=[ - jaeger.Log( - timestamp=event_timestamp // 10 ** 3, - fields=[ - jaeger.Tag( - key="annotation_bool", - vType=jaeger.TagType.BOOL, - vBool=True, - ), - jaeger.Tag( - key="annotation_string", - vType=jaeger.TagType.STRING, - vStr="annotation_test", - ), - jaeger.Tag( - key="key_float", - vType=jaeger.TagType.DOUBLE, - vDouble=0.3, - ), - jaeger.Tag( - key="message", - vType=jaeger.TagType.STRING, - vStr="event0", - ), - ], - ) - ], - ), - jaeger.Span( - operationName=span_names[1], - traceIdHigh=trace_id_high, - traceIdLow=trace_id_low, - spanId=parent_id, - parentSpanId=0, - startTime=start_times[1] // 10 ** 3, - duration=durations[1] // 10 ** 3, - flags=0, - tags=default_tags, - ), - jaeger.Span( - operationName=span_names[2], - traceIdHigh=trace_id_high, - traceIdLow=trace_id_low, - spanId=other_id, - parentSpanId=0, - startTime=start_times[2] // 10 ** 3, - duration=durations[2] // 10 ** 3, - flags=0, - tags=[ - jaeger.Tag( - key="status.code", - vType=jaeger.TagType.LONG, - vLong=StatusCode.OK.value, - ), - jaeger.Tag( - key="status.message", - vType=jaeger.TagType.STRING, - vStr="Example description", - ), - jaeger.Tag( - key="span.kind", - vType=jaeger.TagType.STRING, - vStr="internal", - ), - jaeger.Tag( - key="otel.instrumentation_library.name", - vType=jaeger.TagType.STRING, - vStr="name", - ), - jaeger.Tag( - key="otel.instrumentation_library.version", - vType=jaeger.TagType.STRING, - vStr="version", - ), - ], - ), - ] - - # events are complicated to compare because order of fields - # (attributes) in otel is not important but in jeager it is - self.assertCountEqual( - spans[0].logs[0].fields, expected_spans[0].logs[0].fields - ) - # get rid of fields to be able to compare the whole spans - spans[0].logs[0].fields = None - expected_spans[0].logs[0].fields = None - - self.assertEqual(spans, expected_spans) - - def test_export(self): - """Test that agent and/or collector are invoked""" - exporter = jaeger_exporter.JaegerSpanExporter( - "test_export", agent_host_name="localhost", agent_port=6318 - ) - - # just agent is configured now - agent_client_mock = mock.Mock(spec=jaeger_exporter.AgentClientUDP) - # pylint: disable=protected-access - exporter._agent_client = agent_client_mock - - exporter.export((self._test_span,)) - self.assertEqual(agent_client_mock.emit.call_count, 1) - - # add also a collector and test that both are called - collector_mock = mock.Mock(spec=jaeger_exporter.Collector) - # pylint: disable=protected-access - exporter._collector = collector_mock - - exporter.export((self._test_span,)) - self.assertEqual(agent_client_mock.emit.call_count, 1) - self.assertEqual(collector_mock.submit.call_count, 1) - - def test_agent_client(self): - agent_client = jaeger_exporter.AgentClientUDP( - host_name="localhost", port=6354 - ) - - batch = jaeger.Batch( - # pylint: disable=protected-access - spans=jaeger_exporter._translate_to_jaeger((self._test_span,)), - process=jaeger.Process(serviceName="xxx"), - ) - - agent_client.emit(batch) From dc9b59a6e15e048de3b22a253983dc3b3f32308a Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:22:48 +0530 Subject: [PATCH 04/41] Add jaeger proto files --- .../proto/api_v2/collector.proto | 66 +++++++ .../proto/api_v2/model.proto | 166 ++++++++++++++++++ 2 files changed, 232 insertions(+) create mode 100644 exporter/opentelemetry-exporter-jaeger/proto/api_v2/collector.proto create mode 100644 exporter/opentelemetry-exporter-jaeger/proto/api_v2/model.proto diff --git a/exporter/opentelemetry-exporter-jaeger/proto/api_v2/collector.proto b/exporter/opentelemetry-exporter-jaeger/proto/api_v2/collector.proto new file mode 100644 index 00000000000..e897a043cd6 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/proto/api_v2/collector.proto @@ -0,0 +1,66 @@ +// Copyright (c) 2019 The Jaeger Authors. +// Copyright (c) 2018 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax="proto3"; + +package jaeger.api_v2; + +import "model.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "protoc-gen-swagger/options/annotations.proto"; + +option go_package = "api_v2"; +option java_package = "io.jaegertracing.api_v2"; + +// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; + +option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { + info: { + version: "1.0"; + }; + external_docs: { + url: "https://github.com/jaegertracing/jaeger"; + description: "Jaeger API"; + } + schemes: HTTP; + schemes: HTTPS; +}; + +message PostSpansRequest { + Batch batch = 1 [ + (gogoproto.nullable) = false + ]; +} + +message PostSpansResponse { +} + +service CollectorService { + rpc PostSpans(PostSpansRequest) returns (PostSpansResponse) { + option (google.api.http) = { + post: "/api/v2/spans" + body: "*" + }; + } +} diff --git a/exporter/opentelemetry-exporter-jaeger/proto/api_v2/model.proto b/exporter/opentelemetry-exporter-jaeger/proto/api_v2/model.proto new file mode 100644 index 00000000000..3cc15df3b88 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/proto/api_v2/model.proto @@ -0,0 +1,166 @@ +// Copyright (c) 2018 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax="proto3"; + +package jaeger.api_v2; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; + +// TODO: document all types and fields + +// TODO: once this moves to jaeger-idl repo, we may want to change Go pkg to api_v2 +// and rewrite it to model only in this repo. That should make it easier to generate +// classes in other languages. +option go_package = "model"; +option java_package = "io.jaegertracing.api_v2"; + +// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; + +enum ValueType { + STRING = 0; + BOOL = 1; + INT64 = 2; + FLOAT64 = 3; + BINARY = 4; +}; + +message KeyValue { + option (gogoproto.equal) = true; + option (gogoproto.compare) = true; + + string key = 1; + ValueType v_type = 2; + string v_str = 3; + bool v_bool = 4; + int64 v_int64 = 5; + double v_float64 = 6; + bytes v_binary = 7; +} + +message Log { + google.protobuf.Timestamp timestamp = 1 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + repeated KeyValue fields = 2 [ + (gogoproto.nullable) = false + ]; +} + +enum SpanRefType { + CHILD_OF = 0; + FOLLOWS_FROM = 1; +}; + +message SpanRef { + bytes trace_id = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "TraceID", + (gogoproto.customname) = "TraceID" + ]; + bytes span_id = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "SpanID", + (gogoproto.customname) = "SpanID" + ]; + SpanRefType ref_type = 3; +} + +message Process { + string service_name = 1; + repeated KeyValue tags = 2 [ + (gogoproto.nullable) = false + ]; +} + +message Span { + bytes trace_id = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "TraceID", + (gogoproto.customname) = "TraceID" + ]; + bytes span_id = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "SpanID", + (gogoproto.customname) = "SpanID" + ]; + string operation_name = 3; + repeated SpanRef references = 4 [ + (gogoproto.nullable) = false + ]; + uint32 flags = 5 [ + (gogoproto.nullable) = false, + (gogoproto.customtype) = "Flags" + ]; + google.protobuf.Timestamp start_time = 6 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false + ]; + google.protobuf.Duration duration = 7 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false + ]; + repeated KeyValue tags = 8 [ + (gogoproto.nullable) = false + ]; + repeated Log logs = 9 [ + (gogoproto.nullable) = false + ]; + Process process = 10; + string process_id = 11 [ + (gogoproto.customname) = "ProcessID" + ]; + repeated string warnings = 12; +} + +message Trace { + message ProcessMapping { + string process_id = 1 [ + (gogoproto.customname) = "ProcessID" + ]; + Process process = 2 [ + (gogoproto.nullable) = false + ]; + } + repeated Span spans = 1; + repeated ProcessMapping process_map = 2 [ + (gogoproto.nullable) = false + ]; + repeated string warnings = 3; +} + +message Batch { + repeated Span spans = 1; + Process process = 2 [ + (gogoproto.nullable) = true + ]; +} + +message DependencyLink { + string parent = 1; + string child = 2; + uint64 call_count = 3; + string source = 4; +} From 4da0209c63b85f2387ceaf54df7e08fbb694fff6 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:23:11 +0530 Subject: [PATCH 05/41] Add generated files --- .../exporter/jaeger/gen/collector_pb2.py | 134 ++ .../exporter/jaeger/gen/collector_pb2_grpc.py | 46 + .../exporter/jaeger/gen/gogoproto/gogo_pb2.py | 794 ++++++++ .../jaeger/gen/google/api/annotations_pb2.py | 46 + .../jaeger/gen/google/api/http_pb2.py | 250 +++ .../exporter/jaeger/gen/model_pb2.py | 686 +++++++ .../options/annotations_pb2.py | 90 + .../options/openapiv2_pb2.py | 1777 +++++++++++++++++ 8 files changed, 3823 insertions(+) create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2_grpc.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/gogoproto/gogo_pb2.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/annotations_pb2.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/http_pb2.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/model_pb2.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/annotations_pb2.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/openapiv2_pb2.py diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2.py new file mode 100644 index 00000000000..87dffbbc6d8 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: collector.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import model_pb2 as model__pb2 +from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from protoc_gen_swagger.options import annotations_pb2 as protoc__gen__swagger_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='collector.proto', + package='jaeger.api_v2', + syntax='proto3', + serialized_options=_b('\n\027io.jaegertracing.api_v2Z\006api_v2\310\342\036\001\320\342\036\001\340\342\036\001\300\343\036\001\222AB\022\0052\0031.0*\002\001\002r5\n\nJaeger API\022\'https://github.com/jaegertracing/jaeger'), + serialized_pb=_b('\n\x0f\x63ollector.proto\x12\rjaeger.api_v2\x1a\x0bmodel.proto\x1a\x14gogoproto/gogo.proto\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\"=\n\x10PostSpansRequest\x12)\n\x05\x62\x61tch\x18\x01 \x01(\x0b\x32\x14.jaeger.api_v2.BatchB\x04\xc8\xde\x1f\x00\"\x13\n\x11PostSpansResponse2|\n\x10\x43ollectorService\x12h\n\tPostSpans\x12\x1f.jaeger.api_v2.PostSpansRequest\x1a .jaeger.api_v2.PostSpansResponse\"\x18\x82\xd3\xe4\x93\x02\x12\"\r/api/v2/spans:\x01*Bv\n\x17io.jaegertracing.api_v2Z\x06\x61pi_v2\xc8\xe2\x1e\x01\xd0\xe2\x1e\x01\xe0\xe2\x1e\x01\xc0\xe3\x1e\x01\x92\x41\x42\x12\x05\x32\x03\x31.0*\x02\x01\x02r5\n\nJaeger API\x12\'https://github.com/jaegertracing/jaegerb\x06proto3') + , + dependencies=[model__pb2.DESCRIPTOR,gogoproto_dot_gogo__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,protoc__gen__swagger_dot_options_dot_annotations__pb2.DESCRIPTOR,]) + + + + +_POSTSPANSREQUEST = _descriptor.Descriptor( + name='PostSpansRequest', + full_name='jaeger.api_v2.PostSpansRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='batch', full_name='jaeger.api_v2.PostSpansRequest.batch', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=145, + serialized_end=206, +) + + +_POSTSPANSRESPONSE = _descriptor.Descriptor( + name='PostSpansResponse', + full_name='jaeger.api_v2.PostSpansResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=208, + serialized_end=227, +) + +_POSTSPANSREQUEST.fields_by_name['batch'].message_type = model__pb2._BATCH +DESCRIPTOR.message_types_by_name['PostSpansRequest'] = _POSTSPANSREQUEST +DESCRIPTOR.message_types_by_name['PostSpansResponse'] = _POSTSPANSRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +PostSpansRequest = _reflection.GeneratedProtocolMessageType('PostSpansRequest', (_message.Message,), { + 'DESCRIPTOR' : _POSTSPANSREQUEST, + '__module__' : 'collector_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.PostSpansRequest) + }) +_sym_db.RegisterMessage(PostSpansRequest) + +PostSpansResponse = _reflection.GeneratedProtocolMessageType('PostSpansResponse', (_message.Message,), { + 'DESCRIPTOR' : _POSTSPANSRESPONSE, + '__module__' : 'collector_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.PostSpansResponse) + }) +_sym_db.RegisterMessage(PostSpansResponse) + + +DESCRIPTOR._options = None +_POSTSPANSREQUEST.fields_by_name['batch']._options = None + +_COLLECTORSERVICE = _descriptor.ServiceDescriptor( + name='CollectorService', + full_name='jaeger.api_v2.CollectorService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=229, + serialized_end=353, + methods=[ + _descriptor.MethodDescriptor( + name='PostSpans', + full_name='jaeger.api_v2.CollectorService.PostSpans', + index=0, + containing_service=None, + input_type=_POSTSPANSREQUEST, + output_type=_POSTSPANSRESPONSE, + serialized_options=_b('\202\323\344\223\002\022\"\r/api/v2/spans:\001*'), + ), +]) +_sym_db.RegisterServiceDescriptor(_COLLECTORSERVICE) + +DESCRIPTOR.services_by_name['CollectorService'] = _COLLECTORSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2_grpc.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2_grpc.py new file mode 100644 index 00000000000..b6fcc3592a9 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/collector_pb2_grpc.py @@ -0,0 +1,46 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import collector_pb2 as collector__pb2 + + +class CollectorServiceStub(object): + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.PostSpans = channel.unary_unary( + '/jaeger.api_v2.CollectorService/PostSpans', + request_serializer=collector__pb2.PostSpansRequest.SerializeToString, + response_deserializer=collector__pb2.PostSpansResponse.FromString, + ) + + +class CollectorServiceServicer(object): + # missing associated documentation comment in .proto file + pass + + def PostSpans(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_CollectorServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'PostSpans': grpc.unary_unary_rpc_method_handler( + servicer.PostSpans, + request_deserializer=collector__pb2.PostSpansRequest.FromString, + response_serializer=collector__pb2.PostSpansResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'jaeger.api_v2.CollectorService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/gogoproto/gogo_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/gogoproto/gogo_pb2.py new file mode 100644 index 00000000000..7268c1b693b --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/gogoproto/gogo_pb2.py @@ -0,0 +1,794 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: gogoproto/gogo.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +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 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='gogoproto/gogo.proto', + package='gogoproto', + syntax='proto2', + serialized_options=_b('\n\023com.google.protobufB\nGoGoProtosZ\"github.com/gogo/protobuf/gogoproto'), + serialized_pb=_b('\n\x14gogoproto/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') + , + dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) + + +GOPROTO_ENUM_PREFIX_FIELD_NUMBER = 62001 +goproto_enum_prefix = _descriptor.FieldDescriptor( + name='goproto_enum_prefix', full_name='gogoproto.goproto_enum_prefix', index=0, + number=62001, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_ENUM_STRINGER_FIELD_NUMBER = 62021 +goproto_enum_stringer = _descriptor.FieldDescriptor( + name='goproto_enum_stringer', full_name='gogoproto.goproto_enum_stringer', index=1, + number=62021, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ENUM_STRINGER_FIELD_NUMBER = 62022 +enum_stringer = _descriptor.FieldDescriptor( + name='enum_stringer', full_name='gogoproto.enum_stringer', index=2, + number=62022, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ENUM_CUSTOMNAME_FIELD_NUMBER = 62023 +enum_customname = _descriptor.FieldDescriptor( + name='enum_customname', full_name='gogoproto.enum_customname', index=3, + number=62023, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ENUMDECL_FIELD_NUMBER = 62024 +enumdecl = _descriptor.FieldDescriptor( + name='enumdecl', full_name='gogoproto.enumdecl', index=4, + number=62024, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ENUMVALUE_CUSTOMNAME_FIELD_NUMBER = 66001 +enumvalue_customname = _descriptor.FieldDescriptor( + name='enumvalue_customname', full_name='gogoproto.enumvalue_customname', index=5, + number=66001, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_GETTERS_ALL_FIELD_NUMBER = 63001 +goproto_getters_all = _descriptor.FieldDescriptor( + name='goproto_getters_all', full_name='gogoproto.goproto_getters_all', index=6, + number=63001, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_ENUM_PREFIX_ALL_FIELD_NUMBER = 63002 +goproto_enum_prefix_all = _descriptor.FieldDescriptor( + name='goproto_enum_prefix_all', full_name='gogoproto.goproto_enum_prefix_all', index=7, + number=63002, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_STRINGER_ALL_FIELD_NUMBER = 63003 +goproto_stringer_all = _descriptor.FieldDescriptor( + name='goproto_stringer_all', full_name='gogoproto.goproto_stringer_all', index=8, + number=63003, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +VERBOSE_EQUAL_ALL_FIELD_NUMBER = 63004 +verbose_equal_all = _descriptor.FieldDescriptor( + name='verbose_equal_all', full_name='gogoproto.verbose_equal_all', index=9, + number=63004, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +FACE_ALL_FIELD_NUMBER = 63005 +face_all = _descriptor.FieldDescriptor( + name='face_all', full_name='gogoproto.face_all', index=10, + number=63005, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOSTRING_ALL_FIELD_NUMBER = 63006 +gostring_all = _descriptor.FieldDescriptor( + name='gostring_all', full_name='gogoproto.gostring_all', index=11, + number=63006, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +POPULATE_ALL_FIELD_NUMBER = 63007 +populate_all = _descriptor.FieldDescriptor( + name='populate_all', full_name='gogoproto.populate_all', index=12, + number=63007, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +STRINGER_ALL_FIELD_NUMBER = 63008 +stringer_all = _descriptor.FieldDescriptor( + name='stringer_all', full_name='gogoproto.stringer_all', index=13, + number=63008, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ONLYONE_ALL_FIELD_NUMBER = 63009 +onlyone_all = _descriptor.FieldDescriptor( + name='onlyone_all', full_name='gogoproto.onlyone_all', index=14, + number=63009, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +EQUAL_ALL_FIELD_NUMBER = 63013 +equal_all = _descriptor.FieldDescriptor( + name='equal_all', full_name='gogoproto.equal_all', index=15, + number=63013, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +DESCRIPTION_ALL_FIELD_NUMBER = 63014 +description_all = _descriptor.FieldDescriptor( + name='description_all', full_name='gogoproto.description_all', index=16, + number=63014, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +TESTGEN_ALL_FIELD_NUMBER = 63015 +testgen_all = _descriptor.FieldDescriptor( + name='testgen_all', full_name='gogoproto.testgen_all', index=17, + number=63015, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +BENCHGEN_ALL_FIELD_NUMBER = 63016 +benchgen_all = _descriptor.FieldDescriptor( + name='benchgen_all', full_name='gogoproto.benchgen_all', index=18, + number=63016, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +MARSHALER_ALL_FIELD_NUMBER = 63017 +marshaler_all = _descriptor.FieldDescriptor( + name='marshaler_all', full_name='gogoproto.marshaler_all', index=19, + number=63017, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +UNMARSHALER_ALL_FIELD_NUMBER = 63018 +unmarshaler_all = _descriptor.FieldDescriptor( + name='unmarshaler_all', full_name='gogoproto.unmarshaler_all', index=20, + number=63018, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +STABLE_MARSHALER_ALL_FIELD_NUMBER = 63019 +stable_marshaler_all = _descriptor.FieldDescriptor( + name='stable_marshaler_all', full_name='gogoproto.stable_marshaler_all', index=21, + number=63019, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +SIZER_ALL_FIELD_NUMBER = 63020 +sizer_all = _descriptor.FieldDescriptor( + name='sizer_all', full_name='gogoproto.sizer_all', index=22, + number=63020, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_ENUM_STRINGER_ALL_FIELD_NUMBER = 63021 +goproto_enum_stringer_all = _descriptor.FieldDescriptor( + name='goproto_enum_stringer_all', full_name='gogoproto.goproto_enum_stringer_all', index=23, + number=63021, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ENUM_STRINGER_ALL_FIELD_NUMBER = 63022 +enum_stringer_all = _descriptor.FieldDescriptor( + name='enum_stringer_all', full_name='gogoproto.enum_stringer_all', index=24, + number=63022, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +UNSAFE_MARSHALER_ALL_FIELD_NUMBER = 63023 +unsafe_marshaler_all = _descriptor.FieldDescriptor( + name='unsafe_marshaler_all', full_name='gogoproto.unsafe_marshaler_all', index=25, + number=63023, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +UNSAFE_UNMARSHALER_ALL_FIELD_NUMBER = 63024 +unsafe_unmarshaler_all = _descriptor.FieldDescriptor( + name='unsafe_unmarshaler_all', full_name='gogoproto.unsafe_unmarshaler_all', index=26, + number=63024, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_EXTENSIONS_MAP_ALL_FIELD_NUMBER = 63025 +goproto_extensions_map_all = _descriptor.FieldDescriptor( + name='goproto_extensions_map_all', full_name='gogoproto.goproto_extensions_map_all', index=27, + number=63025, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_UNRECOGNIZED_ALL_FIELD_NUMBER = 63026 +goproto_unrecognized_all = _descriptor.FieldDescriptor( + name='goproto_unrecognized_all', full_name='gogoproto.goproto_unrecognized_all', index=28, + number=63026, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOGOPROTO_IMPORT_FIELD_NUMBER = 63027 +gogoproto_import = _descriptor.FieldDescriptor( + name='gogoproto_import', full_name='gogoproto.gogoproto_import', index=29, + number=63027, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +PROTOSIZER_ALL_FIELD_NUMBER = 63028 +protosizer_all = _descriptor.FieldDescriptor( + name='protosizer_all', full_name='gogoproto.protosizer_all', index=30, + number=63028, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +COMPARE_ALL_FIELD_NUMBER = 63029 +compare_all = _descriptor.FieldDescriptor( + name='compare_all', full_name='gogoproto.compare_all', index=31, + number=63029, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +TYPEDECL_ALL_FIELD_NUMBER = 63030 +typedecl_all = _descriptor.FieldDescriptor( + name='typedecl_all', full_name='gogoproto.typedecl_all', index=32, + number=63030, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ENUMDECL_ALL_FIELD_NUMBER = 63031 +enumdecl_all = _descriptor.FieldDescriptor( + name='enumdecl_all', full_name='gogoproto.enumdecl_all', index=33, + number=63031, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_REGISTRATION_FIELD_NUMBER = 63032 +goproto_registration = _descriptor.FieldDescriptor( + name='goproto_registration', full_name='gogoproto.goproto_registration', index=34, + number=63032, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +MESSAGENAME_ALL_FIELD_NUMBER = 63033 +messagename_all = _descriptor.FieldDescriptor( + name='messagename_all', full_name='gogoproto.messagename_all', index=35, + number=63033, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_SIZECACHE_ALL_FIELD_NUMBER = 63034 +goproto_sizecache_all = _descriptor.FieldDescriptor( + name='goproto_sizecache_all', full_name='gogoproto.goproto_sizecache_all', index=36, + number=63034, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_UNKEYED_ALL_FIELD_NUMBER = 63035 +goproto_unkeyed_all = _descriptor.FieldDescriptor( + name='goproto_unkeyed_all', full_name='gogoproto.goproto_unkeyed_all', index=37, + number=63035, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_GETTERS_FIELD_NUMBER = 64001 +goproto_getters = _descriptor.FieldDescriptor( + name='goproto_getters', full_name='gogoproto.goproto_getters', index=38, + number=64001, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_STRINGER_FIELD_NUMBER = 64003 +goproto_stringer = _descriptor.FieldDescriptor( + name='goproto_stringer', full_name='gogoproto.goproto_stringer', index=39, + number=64003, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +VERBOSE_EQUAL_FIELD_NUMBER = 64004 +verbose_equal = _descriptor.FieldDescriptor( + name='verbose_equal', full_name='gogoproto.verbose_equal', index=40, + number=64004, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +FACE_FIELD_NUMBER = 64005 +face = _descriptor.FieldDescriptor( + name='face', full_name='gogoproto.face', index=41, + number=64005, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOSTRING_FIELD_NUMBER = 64006 +gostring = _descriptor.FieldDescriptor( + name='gostring', full_name='gogoproto.gostring', index=42, + number=64006, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +POPULATE_FIELD_NUMBER = 64007 +populate = _descriptor.FieldDescriptor( + name='populate', full_name='gogoproto.populate', index=43, + number=64007, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +STRINGER_FIELD_NUMBER = 67008 +stringer = _descriptor.FieldDescriptor( + name='stringer', full_name='gogoproto.stringer', index=44, + number=67008, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +ONLYONE_FIELD_NUMBER = 64009 +onlyone = _descriptor.FieldDescriptor( + name='onlyone', full_name='gogoproto.onlyone', index=45, + number=64009, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +EQUAL_FIELD_NUMBER = 64013 +equal = _descriptor.FieldDescriptor( + name='equal', full_name='gogoproto.equal', index=46, + number=64013, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +DESCRIPTION_FIELD_NUMBER = 64014 +description = _descriptor.FieldDescriptor( + name='description', full_name='gogoproto.description', index=47, + number=64014, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +TESTGEN_FIELD_NUMBER = 64015 +testgen = _descriptor.FieldDescriptor( + name='testgen', full_name='gogoproto.testgen', index=48, + number=64015, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +BENCHGEN_FIELD_NUMBER = 64016 +benchgen = _descriptor.FieldDescriptor( + name='benchgen', full_name='gogoproto.benchgen', index=49, + number=64016, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +MARSHALER_FIELD_NUMBER = 64017 +marshaler = _descriptor.FieldDescriptor( + name='marshaler', full_name='gogoproto.marshaler', index=50, + number=64017, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +UNMARSHALER_FIELD_NUMBER = 64018 +unmarshaler = _descriptor.FieldDescriptor( + name='unmarshaler', full_name='gogoproto.unmarshaler', index=51, + number=64018, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +STABLE_MARSHALER_FIELD_NUMBER = 64019 +stable_marshaler = _descriptor.FieldDescriptor( + name='stable_marshaler', full_name='gogoproto.stable_marshaler', index=52, + number=64019, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +SIZER_FIELD_NUMBER = 64020 +sizer = _descriptor.FieldDescriptor( + name='sizer', full_name='gogoproto.sizer', index=53, + number=64020, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +UNSAFE_MARSHALER_FIELD_NUMBER = 64023 +unsafe_marshaler = _descriptor.FieldDescriptor( + name='unsafe_marshaler', full_name='gogoproto.unsafe_marshaler', index=54, + number=64023, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +UNSAFE_UNMARSHALER_FIELD_NUMBER = 64024 +unsafe_unmarshaler = _descriptor.FieldDescriptor( + name='unsafe_unmarshaler', full_name='gogoproto.unsafe_unmarshaler', index=55, + number=64024, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_EXTENSIONS_MAP_FIELD_NUMBER = 64025 +goproto_extensions_map = _descriptor.FieldDescriptor( + name='goproto_extensions_map', full_name='gogoproto.goproto_extensions_map', index=56, + number=64025, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_UNRECOGNIZED_FIELD_NUMBER = 64026 +goproto_unrecognized = _descriptor.FieldDescriptor( + name='goproto_unrecognized', full_name='gogoproto.goproto_unrecognized', index=57, + number=64026, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +PROTOSIZER_FIELD_NUMBER = 64028 +protosizer = _descriptor.FieldDescriptor( + name='protosizer', full_name='gogoproto.protosizer', index=58, + number=64028, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +COMPARE_FIELD_NUMBER = 64029 +compare = _descriptor.FieldDescriptor( + name='compare', full_name='gogoproto.compare', index=59, + number=64029, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +TYPEDECL_FIELD_NUMBER = 64030 +typedecl = _descriptor.FieldDescriptor( + name='typedecl', full_name='gogoproto.typedecl', index=60, + number=64030, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +MESSAGENAME_FIELD_NUMBER = 64033 +messagename = _descriptor.FieldDescriptor( + name='messagename', full_name='gogoproto.messagename', index=61, + number=64033, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_SIZECACHE_FIELD_NUMBER = 64034 +goproto_sizecache = _descriptor.FieldDescriptor( + name='goproto_sizecache', full_name='gogoproto.goproto_sizecache', index=62, + number=64034, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +GOPROTO_UNKEYED_FIELD_NUMBER = 64035 +goproto_unkeyed = _descriptor.FieldDescriptor( + name='goproto_unkeyed', full_name='gogoproto.goproto_unkeyed', index=63, + number=64035, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +NULLABLE_FIELD_NUMBER = 65001 +nullable = _descriptor.FieldDescriptor( + name='nullable', full_name='gogoproto.nullable', index=64, + number=65001, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +EMBED_FIELD_NUMBER = 65002 +embed = _descriptor.FieldDescriptor( + name='embed', full_name='gogoproto.embed', index=65, + number=65002, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +CUSTOMTYPE_FIELD_NUMBER = 65003 +customtype = _descriptor.FieldDescriptor( + name='customtype', full_name='gogoproto.customtype', index=66, + number=65003, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +CUSTOMNAME_FIELD_NUMBER = 65004 +customname = _descriptor.FieldDescriptor( + name='customname', full_name='gogoproto.customname', index=67, + number=65004, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +JSONTAG_FIELD_NUMBER = 65005 +jsontag = _descriptor.FieldDescriptor( + name='jsontag', full_name='gogoproto.jsontag', index=68, + number=65005, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +MORETAGS_FIELD_NUMBER = 65006 +moretags = _descriptor.FieldDescriptor( + name='moretags', full_name='gogoproto.moretags', index=69, + number=65006, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +CASTTYPE_FIELD_NUMBER = 65007 +casttype = _descriptor.FieldDescriptor( + name='casttype', full_name='gogoproto.casttype', index=70, + number=65007, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +CASTKEY_FIELD_NUMBER = 65008 +castkey = _descriptor.FieldDescriptor( + name='castkey', full_name='gogoproto.castkey', index=71, + number=65008, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +CASTVALUE_FIELD_NUMBER = 65009 +castvalue = _descriptor.FieldDescriptor( + name='castvalue', full_name='gogoproto.castvalue', index=72, + number=65009, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +STDTIME_FIELD_NUMBER = 65010 +stdtime = _descriptor.FieldDescriptor( + name='stdtime', full_name='gogoproto.stdtime', index=73, + number=65010, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +STDDURATION_FIELD_NUMBER = 65011 +stdduration = _descriptor.FieldDescriptor( + name='stdduration', full_name='gogoproto.stdduration', index=74, + number=65011, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +WKTPOINTER_FIELD_NUMBER = 65012 +wktpointer = _descriptor.FieldDescriptor( + name='wktpointer', full_name='gogoproto.wktpointer', index=75, + number=65012, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) + +DESCRIPTOR.extensions_by_name['goproto_enum_prefix'] = goproto_enum_prefix +DESCRIPTOR.extensions_by_name['goproto_enum_stringer'] = goproto_enum_stringer +DESCRIPTOR.extensions_by_name['enum_stringer'] = enum_stringer +DESCRIPTOR.extensions_by_name['enum_customname'] = enum_customname +DESCRIPTOR.extensions_by_name['enumdecl'] = enumdecl +DESCRIPTOR.extensions_by_name['enumvalue_customname'] = enumvalue_customname +DESCRIPTOR.extensions_by_name['goproto_getters_all'] = goproto_getters_all +DESCRIPTOR.extensions_by_name['goproto_enum_prefix_all'] = goproto_enum_prefix_all +DESCRIPTOR.extensions_by_name['goproto_stringer_all'] = goproto_stringer_all +DESCRIPTOR.extensions_by_name['verbose_equal_all'] = verbose_equal_all +DESCRIPTOR.extensions_by_name['face_all'] = face_all +DESCRIPTOR.extensions_by_name['gostring_all'] = gostring_all +DESCRIPTOR.extensions_by_name['populate_all'] = populate_all +DESCRIPTOR.extensions_by_name['stringer_all'] = stringer_all +DESCRIPTOR.extensions_by_name['onlyone_all'] = onlyone_all +DESCRIPTOR.extensions_by_name['equal_all'] = equal_all +DESCRIPTOR.extensions_by_name['description_all'] = description_all +DESCRIPTOR.extensions_by_name['testgen_all'] = testgen_all +DESCRIPTOR.extensions_by_name['benchgen_all'] = benchgen_all +DESCRIPTOR.extensions_by_name['marshaler_all'] = marshaler_all +DESCRIPTOR.extensions_by_name['unmarshaler_all'] = unmarshaler_all +DESCRIPTOR.extensions_by_name['stable_marshaler_all'] = stable_marshaler_all +DESCRIPTOR.extensions_by_name['sizer_all'] = sizer_all +DESCRIPTOR.extensions_by_name['goproto_enum_stringer_all'] = goproto_enum_stringer_all +DESCRIPTOR.extensions_by_name['enum_stringer_all'] = enum_stringer_all +DESCRIPTOR.extensions_by_name['unsafe_marshaler_all'] = unsafe_marshaler_all +DESCRIPTOR.extensions_by_name['unsafe_unmarshaler_all'] = unsafe_unmarshaler_all +DESCRIPTOR.extensions_by_name['goproto_extensions_map_all'] = goproto_extensions_map_all +DESCRIPTOR.extensions_by_name['goproto_unrecognized_all'] = goproto_unrecognized_all +DESCRIPTOR.extensions_by_name['gogoproto_import'] = gogoproto_import +DESCRIPTOR.extensions_by_name['protosizer_all'] = protosizer_all +DESCRIPTOR.extensions_by_name['compare_all'] = compare_all +DESCRIPTOR.extensions_by_name['typedecl_all'] = typedecl_all +DESCRIPTOR.extensions_by_name['enumdecl_all'] = enumdecl_all +DESCRIPTOR.extensions_by_name['goproto_registration'] = goproto_registration +DESCRIPTOR.extensions_by_name['messagename_all'] = messagename_all +DESCRIPTOR.extensions_by_name['goproto_sizecache_all'] = goproto_sizecache_all +DESCRIPTOR.extensions_by_name['goproto_unkeyed_all'] = goproto_unkeyed_all +DESCRIPTOR.extensions_by_name['goproto_getters'] = goproto_getters +DESCRIPTOR.extensions_by_name['goproto_stringer'] = goproto_stringer +DESCRIPTOR.extensions_by_name['verbose_equal'] = verbose_equal +DESCRIPTOR.extensions_by_name['face'] = face +DESCRIPTOR.extensions_by_name['gostring'] = gostring +DESCRIPTOR.extensions_by_name['populate'] = populate +DESCRIPTOR.extensions_by_name['stringer'] = stringer +DESCRIPTOR.extensions_by_name['onlyone'] = onlyone +DESCRIPTOR.extensions_by_name['equal'] = equal +DESCRIPTOR.extensions_by_name['description'] = description +DESCRIPTOR.extensions_by_name['testgen'] = testgen +DESCRIPTOR.extensions_by_name['benchgen'] = benchgen +DESCRIPTOR.extensions_by_name['marshaler'] = marshaler +DESCRIPTOR.extensions_by_name['unmarshaler'] = unmarshaler +DESCRIPTOR.extensions_by_name['stable_marshaler'] = stable_marshaler +DESCRIPTOR.extensions_by_name['sizer'] = sizer +DESCRIPTOR.extensions_by_name['unsafe_marshaler'] = unsafe_marshaler +DESCRIPTOR.extensions_by_name['unsafe_unmarshaler'] = unsafe_unmarshaler +DESCRIPTOR.extensions_by_name['goproto_extensions_map'] = goproto_extensions_map +DESCRIPTOR.extensions_by_name['goproto_unrecognized'] = goproto_unrecognized +DESCRIPTOR.extensions_by_name['protosizer'] = protosizer +DESCRIPTOR.extensions_by_name['compare'] = compare +DESCRIPTOR.extensions_by_name['typedecl'] = typedecl +DESCRIPTOR.extensions_by_name['messagename'] = messagename +DESCRIPTOR.extensions_by_name['goproto_sizecache'] = goproto_sizecache +DESCRIPTOR.extensions_by_name['goproto_unkeyed'] = goproto_unkeyed +DESCRIPTOR.extensions_by_name['nullable'] = nullable +DESCRIPTOR.extensions_by_name['embed'] = embed +DESCRIPTOR.extensions_by_name['customtype'] = customtype +DESCRIPTOR.extensions_by_name['customname'] = customname +DESCRIPTOR.extensions_by_name['jsontag'] = jsontag +DESCRIPTOR.extensions_by_name['moretags'] = moretags +DESCRIPTOR.extensions_by_name['casttype'] = casttype +DESCRIPTOR.extensions_by_name['castkey'] = castkey +DESCRIPTOR.extensions_by_name['castvalue'] = castvalue +DESCRIPTOR.extensions_by_name['stdtime'] = stdtime +DESCRIPTOR.extensions_by_name['stdduration'] = stdduration +DESCRIPTOR.extensions_by_name['wktpointer'] = wktpointer +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +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 +# @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/annotations_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/annotations_pb2.py new file mode 100644 index 00000000000..e72a7f8b743 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/annotations_pb2.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/annotations.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import http_pb2 as google_dot_api_dot_http__pb2 +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/api/annotations.proto', + package='google.api', + syntax='proto3', + serialized_options=_b('\n\016com.google.apiB\020AnnotationsProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI'), + serialized_pb=_b('\n\x1cgoogle/api/annotations.proto\x12\ngoogle.api\x1a\x15google/api/http.proto\x1a google/protobuf/descriptor.proto:E\n\x04http\x12\x1e.google.protobuf.MethodOptions\x18\xb0\xca\xbc\" \x01(\x0b\x32\x14.google.api.HttpRuleBn\n\x0e\x63om.google.apiB\x10\x41nnotationsProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3') + , + dependencies=[google_dot_api_dot_http__pb2.DESCRIPTOR,google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) + + +HTTP_FIELD_NUMBER = 72295728 +http = _descriptor.FieldDescriptor( + name='http', full_name='google.api.http', index=0, + number=72295728, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) + +DESCRIPTOR.extensions_by_name['http'] = http +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +http.message_type = google_dot_api_dot_http__pb2._HTTPRULE +google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(http) + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/http_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/http_pb2.py new file mode 100644 index 00000000000..01352aca81b --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/google/api/http_pb2.py @@ -0,0 +1,250 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/api/http.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/api/http.proto', + package='google.api', + syntax='proto3', + serialized_options=_b('\n\016com.google.apiB\tHttpProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\370\001\001\242\002\004GAPI'), + serialized_pb=_b('\n\x15google/api/http.proto\x12\ngoogle.api\"T\n\x04Http\x12#\n\x05rules\x18\x01 \x03(\x0b\x32\x14.google.api.HttpRule\x12\'\n\x1f\x66ully_decode_reserved_expansion\x18\x02 \x01(\x08\"\x81\x02\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x15\n\rresponse_body\x18\x0c \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3') +) + + + + +_HTTP = _descriptor.Descriptor( + name='Http', + full_name='google.api.Http', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='rules', full_name='google.api.Http.rules', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fully_decode_reserved_expansion', full_name='google.api.Http.fully_decode_reserved_expansion', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=37, + serialized_end=121, +) + + +_HTTPRULE = _descriptor.Descriptor( + name='HttpRule', + full_name='google.api.HttpRule', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='selector', full_name='google.api.HttpRule.selector', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='get', full_name='google.api.HttpRule.get', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='put', full_name='google.api.HttpRule.put', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='post', full_name='google.api.HttpRule.post', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='delete', full_name='google.api.HttpRule.delete', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='patch', full_name='google.api.HttpRule.patch', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='custom', full_name='google.api.HttpRule.custom', index=6, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='body', full_name='google.api.HttpRule.body', index=7, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='response_body', full_name='google.api.HttpRule.response_body', index=8, + number=12, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='additional_bindings', full_name='google.api.HttpRule.additional_bindings', index=9, + number=11, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='pattern', full_name='google.api.HttpRule.pattern', + index=0, containing_type=None, fields=[]), + ], + serialized_start=124, + serialized_end=381, +) + + +_CUSTOMHTTPPATTERN = _descriptor.Descriptor( + name='CustomHttpPattern', + full_name='google.api.CustomHttpPattern', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='kind', full_name='google.api.CustomHttpPattern.kind', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='path', full_name='google.api.CustomHttpPattern.path', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=383, + serialized_end=430, +) + +_HTTP.fields_by_name['rules'].message_type = _HTTPRULE +_HTTPRULE.fields_by_name['custom'].message_type = _CUSTOMHTTPPATTERN +_HTTPRULE.fields_by_name['additional_bindings'].message_type = _HTTPRULE +_HTTPRULE.oneofs_by_name['pattern'].fields.append( + _HTTPRULE.fields_by_name['get']) +_HTTPRULE.fields_by_name['get'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] +_HTTPRULE.oneofs_by_name['pattern'].fields.append( + _HTTPRULE.fields_by_name['put']) +_HTTPRULE.fields_by_name['put'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] +_HTTPRULE.oneofs_by_name['pattern'].fields.append( + _HTTPRULE.fields_by_name['post']) +_HTTPRULE.fields_by_name['post'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] +_HTTPRULE.oneofs_by_name['pattern'].fields.append( + _HTTPRULE.fields_by_name['delete']) +_HTTPRULE.fields_by_name['delete'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] +_HTTPRULE.oneofs_by_name['pattern'].fields.append( + _HTTPRULE.fields_by_name['patch']) +_HTTPRULE.fields_by_name['patch'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] +_HTTPRULE.oneofs_by_name['pattern'].fields.append( + _HTTPRULE.fields_by_name['custom']) +_HTTPRULE.fields_by_name['custom'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] +DESCRIPTOR.message_types_by_name['Http'] = _HTTP +DESCRIPTOR.message_types_by_name['HttpRule'] = _HTTPRULE +DESCRIPTOR.message_types_by_name['CustomHttpPattern'] = _CUSTOMHTTPPATTERN +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Http = _reflection.GeneratedProtocolMessageType('Http', (_message.Message,), { + 'DESCRIPTOR' : _HTTP, + '__module__' : 'google.api.http_pb2' + # @@protoc_insertion_point(class_scope:google.api.Http) + }) +_sym_db.RegisterMessage(Http) + +HttpRule = _reflection.GeneratedProtocolMessageType('HttpRule', (_message.Message,), { + 'DESCRIPTOR' : _HTTPRULE, + '__module__' : 'google.api.http_pb2' + # @@protoc_insertion_point(class_scope:google.api.HttpRule) + }) +_sym_db.RegisterMessage(HttpRule) + +CustomHttpPattern = _reflection.GeneratedProtocolMessageType('CustomHttpPattern', (_message.Message,), { + 'DESCRIPTOR' : _CUSTOMHTTPPATTERN, + '__module__' : 'google.api.http_pb2' + # @@protoc_insertion_point(class_scope:google.api.CustomHttpPattern) + }) +_sym_db.RegisterMessage(CustomHttpPattern) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/model_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/model_pb2.py new file mode 100644 index 00000000000..8abc302a626 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/model_pb2.py @@ -0,0 +1,686 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: model.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='model.proto', + package='jaeger.api_v2', + syntax='proto3', + serialized_options=_b('\n\027io.jaegertracing.api_v2Z\005model\310\342\036\001\320\342\036\001\340\342\036\001\300\343\036\001'), + serialized_pb=_b('\n\x0bmodel.proto\x12\rjaeger.api_v2\x1a\x14gogoproto/gogo.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\"\xa0\x01\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x06v_type\x18\x02 \x01(\x0e\x32\x18.jaeger.api_v2.ValueType\x12\r\n\x05v_str\x18\x03 \x01(\t\x12\x0e\n\x06v_bool\x18\x04 \x01(\x08\x12\x0f\n\x07v_int64\x18\x05 \x01(\x03\x12\x11\n\tv_float64\x18\x06 \x01(\x01\x12\x10\n\x08v_binary\x18\x07 \x01(\x0c:\x08\xe8\xa0\x1f\x01\xe8\xa1\x1f\x01\"m\n\x03Log\x12\x37\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\x12-\n\x06\x66ields\x18\x02 \x03(\x0b\x32\x17.jaeger.api_v2.KeyValueB\x04\xc8\xde\x1f\x00\"\x90\x01\n\x07SpanRef\x12,\n\x08trace_id\x18\x01 \x01(\x0c\x42\x1a\xc8\xde\x1f\x00\xda\xde\x1f\x07TraceID\xe2\xde\x1f\x07TraceID\x12)\n\x07span_id\x18\x02 \x01(\x0c\x42\x18\xc8\xde\x1f\x00\xda\xde\x1f\x06SpanID\xe2\xde\x1f\x06SpanID\x12,\n\x08ref_type\x18\x03 \x01(\x0e\x32\x1a.jaeger.api_v2.SpanRefType\"L\n\x07Process\x12\x14\n\x0cservice_name\x18\x01 \x01(\t\x12+\n\x04tags\x18\x02 \x03(\x0b\x32\x17.jaeger.api_v2.KeyValueB\x04\xc8\xde\x1f\x00\"\xeb\x03\n\x04Span\x12,\n\x08trace_id\x18\x01 \x01(\x0c\x42\x1a\xc8\xde\x1f\x00\xda\xde\x1f\x07TraceID\xe2\xde\x1f\x07TraceID\x12)\n\x07span_id\x18\x02 \x01(\x0c\x42\x18\xc8\xde\x1f\x00\xda\xde\x1f\x06SpanID\xe2\xde\x1f\x06SpanID\x12\x16\n\x0eoperation_name\x18\x03 \x01(\t\x12\x30\n\nreferences\x18\x04 \x03(\x0b\x32\x16.jaeger.api_v2.SpanRefB\x04\xc8\xde\x1f\x00\x12\x1c\n\x05\x66lags\x18\x05 \x01(\rB\r\xc8\xde\x1f\x00\xda\xde\x1f\x05\x46lags\x12\x38\n\nstart_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\x90\xdf\x1f\x01\xc8\xde\x1f\x00\x12\x35\n\x08\x64uration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x08\x98\xdf\x1f\x01\xc8\xde\x1f\x00\x12+\n\x04tags\x18\x08 \x03(\x0b\x32\x17.jaeger.api_v2.KeyValueB\x04\xc8\xde\x1f\x00\x12&\n\x04logs\x18\t \x03(\x0b\x32\x12.jaeger.api_v2.LogB\x04\xc8\xde\x1f\x00\x12\'\n\x07process\x18\n \x01(\x0b\x32\x16.jaeger.api_v2.Process\x12!\n\nprocess_id\x18\x0b \x01(\tB\r\xe2\xde\x1f\tProcessID\x12\x10\n\x08warnings\x18\x0c \x03(\t\"\xe1\x01\n\x05Trace\x12\"\n\x05spans\x18\x01 \x03(\x0b\x32\x13.jaeger.api_v2.Span\x12>\n\x0bprocess_map\x18\x02 \x03(\x0b\x32#.jaeger.api_v2.Trace.ProcessMappingB\x04\xc8\xde\x1f\x00\x12\x10\n\x08warnings\x18\x03 \x03(\t\x1a\x62\n\x0eProcessMapping\x12!\n\nprocess_id\x18\x01 \x01(\tB\r\xe2\xde\x1f\tProcessID\x12-\n\x07process\x18\x02 \x01(\x0b\x32\x16.jaeger.api_v2.ProcessB\x04\xc8\xde\x1f\x00\"Z\n\x05\x42\x61tch\x12\"\n\x05spans\x18\x01 \x03(\x0b\x32\x13.jaeger.api_v2.Span\x12-\n\x07process\x18\x02 \x01(\x0b\x32\x16.jaeger.api_v2.ProcessB\x04\xc8\xde\x1f\x01\"S\n\x0e\x44\x65pendencyLink\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\r\n\x05\x63hild\x18\x02 \x01(\t\x12\x12\n\ncall_count\x18\x03 \x01(\x04\x12\x0e\n\x06source\x18\x04 \x01(\t*E\n\tValueType\x12\n\n\x06STRING\x10\x00\x12\x08\n\x04\x42OOL\x10\x01\x12\t\n\x05INT64\x10\x02\x12\x0b\n\x07\x46LOAT64\x10\x03\x12\n\n\x06\x42INARY\x10\x04*-\n\x0bSpanRefType\x12\x0c\n\x08\x43HILD_OF\x10\x00\x12\x10\n\x0c\x46OLLOWS_FROM\x10\x01\x42\x30\n\x17io.jaegertracing.api_v2Z\x05model\xc8\xe2\x1e\x01\xd0\xe2\x1e\x01\xe0\xe2\x1e\x01\xc0\xe3\x1e\x01\x62\x06proto3') + , + dependencies=[gogoproto_dot_gogo__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,google_dot_protobuf_dot_duration__pb2.DESCRIPTOR,]) + +_VALUETYPE = _descriptor.EnumDescriptor( + name='ValueType', + full_name='jaeger.api_v2.ValueType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='STRING', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BOOL', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INT64', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FLOAT64', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BINARY', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1515, + serialized_end=1584, +) +_sym_db.RegisterEnumDescriptor(_VALUETYPE) + +ValueType = enum_type_wrapper.EnumTypeWrapper(_VALUETYPE) +_SPANREFTYPE = _descriptor.EnumDescriptor( + name='SpanRefType', + full_name='jaeger.api_v2.SpanRefType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='CHILD_OF', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FOLLOWS_FROM', index=1, number=1, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=1586, + serialized_end=1631, +) +_sym_db.RegisterEnumDescriptor(_SPANREFTYPE) + +SpanRefType = enum_type_wrapper.EnumTypeWrapper(_SPANREFTYPE) +STRING = 0 +BOOL = 1 +INT64 = 2 +FLOAT64 = 3 +BINARY = 4 +CHILD_OF = 0 +FOLLOWS_FROM = 1 + + + +_KEYVALUE = _descriptor.Descriptor( + name='KeyValue', + full_name='jaeger.api_v2.KeyValue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='jaeger.api_v2.KeyValue.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='v_type', full_name='jaeger.api_v2.KeyValue.v_type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='v_str', full_name='jaeger.api_v2.KeyValue.v_str', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='v_bool', full_name='jaeger.api_v2.KeyValue.v_bool', index=3, + number=4, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='v_int64', full_name='jaeger.api_v2.KeyValue.v_int64', index=4, + number=5, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='v_float64', full_name='jaeger.api_v2.KeyValue.v_float64', index=5, + number=6, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='v_binary', full_name='jaeger.api_v2.KeyValue.v_binary', index=6, + number=7, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('\350\240\037\001\350\241\037\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=118, + serialized_end=278, +) + + +_LOG = _descriptor.Descriptor( + name='Log', + full_name='jaeger.api_v2.Log', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='timestamp', full_name='jaeger.api_v2.Log.timestamp', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\220\337\037\001\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fields', full_name='jaeger.api_v2.Log.fields', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=280, + serialized_end=389, +) + + +_SPANREF = _descriptor.Descriptor( + name='SpanRef', + full_name='jaeger.api_v2.SpanRef', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='trace_id', full_name='jaeger.api_v2.SpanRef.trace_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000\332\336\037\007TraceID\342\336\037\007TraceID'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='span_id', full_name='jaeger.api_v2.SpanRef.span_id', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000\332\336\037\006SpanID\342\336\037\006SpanID'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='ref_type', full_name='jaeger.api_v2.SpanRef.ref_type', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=392, + serialized_end=536, +) + + +_PROCESS = _descriptor.Descriptor( + name='Process', + full_name='jaeger.api_v2.Process', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='service_name', full_name='jaeger.api_v2.Process.service_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tags', full_name='jaeger.api_v2.Process.tags', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=538, + serialized_end=614, +) + + +_SPAN = _descriptor.Descriptor( + name='Span', + full_name='jaeger.api_v2.Span', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='trace_id', full_name='jaeger.api_v2.Span.trace_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000\332\336\037\007TraceID\342\336\037\007TraceID'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='span_id', full_name='jaeger.api_v2.Span.span_id', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000\332\336\037\006SpanID\342\336\037\006SpanID'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='operation_name', full_name='jaeger.api_v2.Span.operation_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='references', full_name='jaeger.api_v2.Span.references', index=3, + number=4, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='flags', full_name='jaeger.api_v2.Span.flags', index=4, + number=5, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000\332\336\037\005Flags'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='start_time', full_name='jaeger.api_v2.Span.start_time', index=5, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\220\337\037\001\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='duration', full_name='jaeger.api_v2.Span.duration', index=6, + number=7, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\230\337\037\001\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tags', full_name='jaeger.api_v2.Span.tags', index=7, + number=8, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='logs', full_name='jaeger.api_v2.Span.logs', index=8, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='process', full_name='jaeger.api_v2.Span.process', index=9, + number=10, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='process_id', full_name='jaeger.api_v2.Span.process_id', index=10, + number=11, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\342\336\037\tProcessID'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='warnings', full_name='jaeger.api_v2.Span.warnings', index=11, + number=12, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=617, + serialized_end=1108, +) + + +_TRACE_PROCESSMAPPING = _descriptor.Descriptor( + name='ProcessMapping', + full_name='jaeger.api_v2.Trace.ProcessMapping', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='process_id', full_name='jaeger.api_v2.Trace.ProcessMapping.process_id', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\342\336\037\tProcessID'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='process', full_name='jaeger.api_v2.Trace.ProcessMapping.process', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1238, + serialized_end=1336, +) + +_TRACE = _descriptor.Descriptor( + name='Trace', + full_name='jaeger.api_v2.Trace', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='spans', full_name='jaeger.api_v2.Trace.spans', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='process_map', full_name='jaeger.api_v2.Trace.process_map', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\000'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='warnings', full_name='jaeger.api_v2.Trace.warnings', index=2, + number=3, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TRACE_PROCESSMAPPING, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1111, + serialized_end=1336, +) + + +_BATCH = _descriptor.Descriptor( + name='Batch', + full_name='jaeger.api_v2.Batch', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='spans', full_name='jaeger.api_v2.Batch.spans', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='process', full_name='jaeger.api_v2.Batch.process', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\310\336\037\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1338, + serialized_end=1428, +) + + +_DEPENDENCYLINK = _descriptor.Descriptor( + name='DependencyLink', + full_name='jaeger.api_v2.DependencyLink', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='jaeger.api_v2.DependencyLink.parent', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='child', full_name='jaeger.api_v2.DependencyLink.child', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='call_count', full_name='jaeger.api_v2.DependencyLink.call_count', index=2, + number=3, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='source', full_name='jaeger.api_v2.DependencyLink.source', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1430, + serialized_end=1513, +) + +_KEYVALUE.fields_by_name['v_type'].enum_type = _VALUETYPE +_LOG.fields_by_name['timestamp'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_LOG.fields_by_name['fields'].message_type = _KEYVALUE +_SPANREF.fields_by_name['ref_type'].enum_type = _SPANREFTYPE +_PROCESS.fields_by_name['tags'].message_type = _KEYVALUE +_SPAN.fields_by_name['references'].message_type = _SPANREF +_SPAN.fields_by_name['start_time'].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP +_SPAN.fields_by_name['duration'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_SPAN.fields_by_name['tags'].message_type = _KEYVALUE +_SPAN.fields_by_name['logs'].message_type = _LOG +_SPAN.fields_by_name['process'].message_type = _PROCESS +_TRACE_PROCESSMAPPING.fields_by_name['process'].message_type = _PROCESS +_TRACE_PROCESSMAPPING.containing_type = _TRACE +_TRACE.fields_by_name['spans'].message_type = _SPAN +_TRACE.fields_by_name['process_map'].message_type = _TRACE_PROCESSMAPPING +_BATCH.fields_by_name['spans'].message_type = _SPAN +_BATCH.fields_by_name['process'].message_type = _PROCESS +DESCRIPTOR.message_types_by_name['KeyValue'] = _KEYVALUE +DESCRIPTOR.message_types_by_name['Log'] = _LOG +DESCRIPTOR.message_types_by_name['SpanRef'] = _SPANREF +DESCRIPTOR.message_types_by_name['Process'] = _PROCESS +DESCRIPTOR.message_types_by_name['Span'] = _SPAN +DESCRIPTOR.message_types_by_name['Trace'] = _TRACE +DESCRIPTOR.message_types_by_name['Batch'] = _BATCH +DESCRIPTOR.message_types_by_name['DependencyLink'] = _DEPENDENCYLINK +DESCRIPTOR.enum_types_by_name['ValueType'] = _VALUETYPE +DESCRIPTOR.enum_types_by_name['SpanRefType'] = _SPANREFTYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +KeyValue = _reflection.GeneratedProtocolMessageType('KeyValue', (_message.Message,), { + 'DESCRIPTOR' : _KEYVALUE, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.KeyValue) + }) +_sym_db.RegisterMessage(KeyValue) + +Log = _reflection.GeneratedProtocolMessageType('Log', (_message.Message,), { + 'DESCRIPTOR' : _LOG, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.Log) + }) +_sym_db.RegisterMessage(Log) + +SpanRef = _reflection.GeneratedProtocolMessageType('SpanRef', (_message.Message,), { + 'DESCRIPTOR' : _SPANREF, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.SpanRef) + }) +_sym_db.RegisterMessage(SpanRef) + +Process = _reflection.GeneratedProtocolMessageType('Process', (_message.Message,), { + 'DESCRIPTOR' : _PROCESS, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.Process) + }) +_sym_db.RegisterMessage(Process) + +Span = _reflection.GeneratedProtocolMessageType('Span', (_message.Message,), { + 'DESCRIPTOR' : _SPAN, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.Span) + }) +_sym_db.RegisterMessage(Span) + +Trace = _reflection.GeneratedProtocolMessageType('Trace', (_message.Message,), { + + 'ProcessMapping' : _reflection.GeneratedProtocolMessageType('ProcessMapping', (_message.Message,), { + 'DESCRIPTOR' : _TRACE_PROCESSMAPPING, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.Trace.ProcessMapping) + }) + , + 'DESCRIPTOR' : _TRACE, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.Trace) + }) +_sym_db.RegisterMessage(Trace) +_sym_db.RegisterMessage(Trace.ProcessMapping) + +Batch = _reflection.GeneratedProtocolMessageType('Batch', (_message.Message,), { + 'DESCRIPTOR' : _BATCH, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.Batch) + }) +_sym_db.RegisterMessage(Batch) + +DependencyLink = _reflection.GeneratedProtocolMessageType('DependencyLink', (_message.Message,), { + 'DESCRIPTOR' : _DEPENDENCYLINK, + '__module__' : 'model_pb2' + # @@protoc_insertion_point(class_scope:jaeger.api_v2.DependencyLink) + }) +_sym_db.RegisterMessage(DependencyLink) + + +DESCRIPTOR._options = None +_KEYVALUE._options = None +_LOG.fields_by_name['timestamp']._options = None +_LOG.fields_by_name['fields']._options = None +_SPANREF.fields_by_name['trace_id']._options = None +_SPANREF.fields_by_name['span_id']._options = None +_PROCESS.fields_by_name['tags']._options = None +_SPAN.fields_by_name['trace_id']._options = None +_SPAN.fields_by_name['span_id']._options = None +_SPAN.fields_by_name['references']._options = None +_SPAN.fields_by_name['flags']._options = None +_SPAN.fields_by_name['start_time']._options = None +_SPAN.fields_by_name['duration']._options = None +_SPAN.fields_by_name['tags']._options = None +_SPAN.fields_by_name['logs']._options = None +_SPAN.fields_by_name['process_id']._options = None +_TRACE_PROCESSMAPPING.fields_by_name['process_id']._options = None +_TRACE_PROCESSMAPPING.fields_by_name['process']._options = None +_TRACE.fields_by_name['process_map']._options = None +_BATCH.fields_by_name['process']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/annotations_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/annotations_pb2.py new file mode 100644 index 00000000000..42bc642368f --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/annotations_pb2.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: protoc-gen-swagger/options/annotations.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +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 protoc_gen_swagger.options import openapiv2_pb2 as protoc__gen__swagger_dot_options_dot_openapiv2__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='protoc-gen-swagger/options/annotations.proto', + package='grpc.gateway.protoc_gen_swagger.options', + syntax='proto3', + serialized_options=_b('ZAgithub.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options'), + serialized_pb=_b('\n,protoc-gen-swagger/options/annotations.proto\x12\'grpc.gateway.protoc_gen_swagger.options\x1a google/protobuf/descriptor.proto\x1a*protoc-gen-swagger/options/openapiv2.proto:j\n\x11openapiv2_swagger\x12\x1c.google.protobuf.FileOptions\x18\x92\x08 \x01(\x0b\x32\x30.grpc.gateway.protoc_gen_swagger.options.Swagger:p\n\x13openapiv2_operation\x12\x1e.google.protobuf.MethodOptions\x18\x92\x08 \x01(\x0b\x32\x32.grpc.gateway.protoc_gen_swagger.options.Operation:k\n\x10openapiv2_schema\x12\x1f.google.protobuf.MessageOptions\x18\x92\x08 \x01(\x0b\x32/.grpc.gateway.protoc_gen_swagger.options.Schema:e\n\ropenapiv2_tag\x12\x1f.google.protobuf.ServiceOptions\x18\x92\x08 \x01(\x0b\x32,.grpc.gateway.protoc_gen_swagger.options.Tag:l\n\x0fopenapiv2_field\x12\x1d.google.protobuf.FieldOptions\x18\x92\x08 \x01(\x0b\x32\x33.grpc.gateway.protoc_gen_swagger.options.JSONSchemaBCZAgithub.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/optionsb\x06proto3') + , + dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,protoc__gen__swagger_dot_options_dot_openapiv2__pb2.DESCRIPTOR,]) + + +OPENAPIV2_SWAGGER_FIELD_NUMBER = 1042 +openapiv2_swagger = _descriptor.FieldDescriptor( + name='openapiv2_swagger', full_name='grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger', index=0, + number=1042, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +OPENAPIV2_OPERATION_FIELD_NUMBER = 1042 +openapiv2_operation = _descriptor.FieldDescriptor( + name='openapiv2_operation', full_name='grpc.gateway.protoc_gen_swagger.options.openapiv2_operation', index=1, + number=1042, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +OPENAPIV2_SCHEMA_FIELD_NUMBER = 1042 +openapiv2_schema = _descriptor.FieldDescriptor( + name='openapiv2_schema', full_name='grpc.gateway.protoc_gen_swagger.options.openapiv2_schema', index=2, + number=1042, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +OPENAPIV2_TAG_FIELD_NUMBER = 1042 +openapiv2_tag = _descriptor.FieldDescriptor( + name='openapiv2_tag', full_name='grpc.gateway.protoc_gen_swagger.options.openapiv2_tag', index=3, + number=1042, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) +OPENAPIV2_FIELD_FIELD_NUMBER = 1042 +openapiv2_field = _descriptor.FieldDescriptor( + name='openapiv2_field', full_name='grpc.gateway.protoc_gen_swagger.options.openapiv2_field', index=4, + number=1042, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=True, extension_scope=None, + serialized_options=None, file=DESCRIPTOR) + +DESCRIPTOR.extensions_by_name['openapiv2_swagger'] = openapiv2_swagger +DESCRIPTOR.extensions_by_name['openapiv2_operation'] = openapiv2_operation +DESCRIPTOR.extensions_by_name['openapiv2_schema'] = openapiv2_schema +DESCRIPTOR.extensions_by_name['openapiv2_tag'] = openapiv2_tag +DESCRIPTOR.extensions_by_name['openapiv2_field'] = openapiv2_field +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +openapiv2_swagger.message_type = protoc__gen__swagger_dot_options_dot_openapiv2__pb2._SWAGGER +google_dot_protobuf_dot_descriptor__pb2.FileOptions.RegisterExtension(openapiv2_swagger) +openapiv2_operation.message_type = protoc__gen__swagger_dot_options_dot_openapiv2__pb2._OPERATION +google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(openapiv2_operation) +openapiv2_schema.message_type = protoc__gen__swagger_dot_options_dot_openapiv2__pb2._SCHEMA +google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(openapiv2_schema) +openapiv2_tag.message_type = protoc__gen__swagger_dot_options_dot_openapiv2__pb2._TAG +google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(openapiv2_tag) +openapiv2_field.message_type = protoc__gen__swagger_dot_options_dot_openapiv2__pb2._JSONSCHEMA +google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(openapiv2_field) + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/openapiv2_pb2.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/openapiv2_pb2.py new file mode 100644 index 00000000000..c2e7aa0ba10 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/protoc_gen_swagger/options/openapiv2_pb2.py @@ -0,0 +1,1777 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: protoc-gen-swagger/options/openapiv2.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='protoc-gen-swagger/options/openapiv2.proto', + package='grpc.gateway.protoc_gen_swagger.options', + syntax='proto3', + serialized_options=_b('ZAgithub.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options'), + serialized_pb=_b('\n*protoc-gen-swagger/options/openapiv2.proto\x12\'grpc.gateway.protoc_gen_swagger.options\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xa0\x07\n\x07Swagger\x12\x0f\n\x07swagger\x18\x01 \x01(\t\x12;\n\x04info\x18\x02 \x01(\x0b\x32-.grpc.gateway.protoc_gen_swagger.options.Info\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x11\n\tbase_path\x18\x04 \x01(\t\x12O\n\x07schemes\x18\x05 \x03(\x0e\x32>.grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme\x12\x10\n\x08\x63onsumes\x18\x06 \x03(\t\x12\x10\n\x08produces\x18\x07 \x03(\t\x12R\n\tresponses\x18\n \x03(\x0b\x32?.grpc.gateway.protoc_gen_swagger.options.Swagger.ResponsesEntry\x12Z\n\x14security_definitions\x18\x0b \x01(\x0b\x32<.grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions\x12N\n\x08security\x18\x0c \x03(\x0b\x32<.grpc.gateway.protoc_gen_swagger.options.SecurityRequirement\x12U\n\rexternal_docs\x18\x0e \x01(\x0b\x32>.grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation\x12T\n\nextensions\x18\x0f \x03(\x0b\x32@.grpc.gateway.protoc_gen_swagger.options.Swagger.ExtensionsEntry\x1a\x63\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_swagger.options.Response:\x02\x38\x01\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"B\n\rSwaggerScheme\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\x12\x06\n\x02WS\x10\x03\x12\x07\n\x03WSS\x10\x04J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\r\x10\x0e\"\xa9\x05\n\tOperation\x12\x0c\n\x04tags\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12U\n\rexternal_docs\x18\x04 \x01(\x0b\x32>.grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation\x12\x14\n\x0coperation_id\x18\x05 \x01(\t\x12\x10\n\x08\x63onsumes\x18\x06 \x03(\t\x12\x10\n\x08produces\x18\x07 \x03(\t\x12T\n\tresponses\x18\t \x03(\x0b\x32\x41.grpc.gateway.protoc_gen_swagger.options.Operation.ResponsesEntry\x12\x0f\n\x07schemes\x18\n \x03(\t\x12\x12\n\ndeprecated\x18\x0b \x01(\x08\x12N\n\x08security\x18\x0c \x03(\x0b\x32<.grpc.gateway.protoc_gen_swagger.options.SecurityRequirement\x12V\n\nextensions\x18\r \x03(\x0b\x32\x42.grpc.gateway.protoc_gen_swagger.options.Operation.ExtensionsEntry\x1a\x63\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_swagger.options.Response:\x02\x38\x01\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01J\x04\x08\x08\x10\t\"\x8e\x02\n\x08Response\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12?\n\x06schema\x18\x02 \x01(\x0b\x32/.grpc.gateway.protoc_gen_swagger.options.Schema\x12U\n\nextensions\x18\x05 \x03(\x0b\x32\x41.grpc.gateway.protoc_gen_swagger.options.Response.ExtensionsEntry\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01J\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05\"\xf9\x02\n\x04Info\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x18\n\x10terms_of_service\x18\x03 \x01(\t\x12\x41\n\x07\x63ontact\x18\x04 \x01(\x0b\x32\x30.grpc.gateway.protoc_gen_swagger.options.Contact\x12\x41\n\x07license\x18\x05 \x01(\x0b\x32\x30.grpc.gateway.protoc_gen_swagger.options.License\x12\x0f\n\x07version\x18\x06 \x01(\t\x12Q\n\nextensions\x18\x07 \x03(\x0b\x32=.grpc.gateway.protoc_gen_swagger.options.Info.ExtensionsEntry\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"3\n\x07\x43ontact\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\r\n\x05\x65mail\x18\x03 \x01(\t\"$\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"9\n\x15\x45xternalDocumentation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"\x80\x02\n\x06Schema\x12H\n\x0bjson_schema\x18\x01 \x01(\x0b\x32\x33.grpc.gateway.protoc_gen_swagger.options.JSONSchema\x12\x15\n\rdiscriminator\x18\x02 \x01(\t\x12\x11\n\tread_only\x18\x03 \x01(\x08\x12U\n\rexternal_docs\x18\x05 \x01(\x0b\x32>.grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation\x12%\n\x07\x65xample\x18\x06 \x01(\x0b\x32\x14.google.protobuf.AnyJ\x04\x08\x04\x10\x05\"\xba\x05\n\nJSONSchema\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\r\n\x05title\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x07 \x01(\t\x12\x11\n\tread_only\x18\x08 \x01(\x08\x12\x13\n\x0bmultiple_of\x18\n \x01(\x01\x12\x0f\n\x07maximum\x18\x0b \x01(\x01\x12\x19\n\x11\x65xclusive_maximum\x18\x0c \x01(\x08\x12\x0f\n\x07minimum\x18\r \x01(\x01\x12\x19\n\x11\x65xclusive_minimum\x18\x0e \x01(\x08\x12\x12\n\nmax_length\x18\x0f \x01(\x04\x12\x12\n\nmin_length\x18\x10 \x01(\x04\x12\x0f\n\x07pattern\x18\x11 \x01(\t\x12\x11\n\tmax_items\x18\x14 \x01(\x04\x12\x11\n\tmin_items\x18\x15 \x01(\x04\x12\x14\n\x0cunique_items\x18\x16 \x01(\x08\x12\x16\n\x0emax_properties\x18\x18 \x01(\x04\x12\x16\n\x0emin_properties\x18\x19 \x01(\x04\x12\x10\n\x08required\x18\x1a \x03(\t\x12\r\n\x05\x61rray\x18\" \x03(\t\x12W\n\x04type\x18# \x03(\x0e\x32I.grpc.gateway.protoc_gen_swagger.options.JSONSchema.JSONSchemaSimpleTypes\"w\n\x15JSONSchemaSimpleTypes\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05\x41RRAY\x10\x01\x12\x0b\n\x07\x42OOLEAN\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x08\n\x04NULL\x10\x04\x12\n\n\x06NUMBER\x10\x05\x12\n\n\x06OBJECT\x10\x06\x12\n\n\x06STRING\x10\x07J\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03J\x04\x08\x04\x10\x05J\x04\x08\t\x10\nJ\x04\x08\x12\x10\x13J\x04\x08\x13\x10\x14J\x04\x08\x17\x10\x18J\x04\x08\x1b\x10\x1cJ\x04\x08\x1c\x10\x1dJ\x04\x08\x1d\x10\x1eJ\x04\x08\x1e\x10\"J\x04\x08$\x10*J\x04\x08*\x10+J\x04\x08+\x10.\"w\n\x03Tag\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12U\n\rexternal_docs\x18\x03 \x01(\x0b\x32>.grpc.gateway.protoc_gen_swagger.options.ExternalDocumentationJ\x04\x08\x01\x10\x02\"\xdd\x01\n\x13SecurityDefinitions\x12\\\n\x08security\x18\x01 \x03(\x0b\x32J.grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry\x1ah\n\rSecurityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x46\n\x05value\x18\x02 \x01(\x0b\x32\x37.grpc.gateway.protoc_gen_swagger.options.SecurityScheme:\x02\x38\x01\"\x96\x06\n\x0eSecurityScheme\x12J\n\x04type\x18\x01 \x01(\x0e\x32<.grpc.gateway.protoc_gen_swagger.options.SecurityScheme.Type\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x46\n\x02in\x18\x04 \x01(\x0e\x32:.grpc.gateway.protoc_gen_swagger.options.SecurityScheme.In\x12J\n\x04\x66low\x18\x05 \x01(\x0e\x32<.grpc.gateway.protoc_gen_swagger.options.SecurityScheme.Flow\x12\x19\n\x11\x61uthorization_url\x18\x06 \x01(\t\x12\x11\n\ttoken_url\x18\x07 \x01(\t\x12?\n\x06scopes\x18\x08 \x01(\x0b\x32/.grpc.gateway.protoc_gen_swagger.options.Scopes\x12[\n\nextensions\x18\t \x03(\x0b\x32G.grpc.gateway.protoc_gen_swagger.options.SecurityScheme.ExtensionsEntry\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"K\n\x04Type\x12\x10\n\x0cTYPE_INVALID\x10\x00\x12\x0e\n\nTYPE_BASIC\x10\x01\x12\x10\n\x0cTYPE_API_KEY\x10\x02\x12\x0f\n\x0bTYPE_OAUTH2\x10\x03\"1\n\x02In\x12\x0e\n\nIN_INVALID\x10\x00\x12\x0c\n\x08IN_QUERY\x10\x01\x12\r\n\tIN_HEADER\x10\x02\"j\n\x04\x46low\x12\x10\n\x0c\x46LOW_INVALID\x10\x00\x12\x11\n\rFLOW_IMPLICIT\x10\x01\x12\x11\n\rFLOW_PASSWORD\x10\x02\x12\x14\n\x10\x46LOW_APPLICATION\x10\x03\x12\x14\n\x10\x46LOW_ACCESS_CODE\x10\x04\"\xc9\x02\n\x13SecurityRequirement\x12s\n\x14security_requirement\x18\x01 \x03(\x0b\x32U.grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry\x1a)\n\x18SecurityRequirementValue\x12\r\n\x05scope\x18\x01 \x03(\t\x1a\x91\x01\n\x18SecurityRequirementEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x64\n\x05value\x18\x02 \x01(\x0b\x32U.grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementValue:\x02\x38\x01\"\x81\x01\n\x06Scopes\x12I\n\x05scope\x18\x01 \x03(\x0b\x32:.grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry\x1a,\n\nScopeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x43ZAgithub.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/optionsb\x06proto3') + , + dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) + + + +_SWAGGER_SWAGGERSCHEME = _descriptor.EnumDescriptor( + name='SwaggerScheme', + full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.SwaggerScheme', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HTTP', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='HTTPS', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='WS', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='WSS', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=989, + serialized_end=1055, +) +_sym_db.RegisterEnumDescriptor(_SWAGGER_SWAGGERSCHEME) + +_JSONSCHEMA_JSONSCHEMASIMPLETYPES = _descriptor.EnumDescriptor( + name='JSONSchemaSimpleTypes', + full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.JSONSchemaSimpleTypes', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='UNKNOWN', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ARRAY', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='BOOLEAN', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INTEGER', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NULL', index=4, number=4, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='NUMBER', index=5, number=5, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='OBJECT', index=6, number=6, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='STRING', index=7, number=7, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=3317, + serialized_end=3436, +) +_sym_db.RegisterEnumDescriptor(_JSONSCHEMA_JSONSCHEMASIMPLETYPES) + +_SECURITYSCHEME_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='TYPE_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TYPE_BASIC', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TYPE_API_KEY', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TYPE_OAUTH2', index=3, number=3, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=4424, + serialized_end=4499, +) +_sym_db.RegisterEnumDescriptor(_SECURITYSCHEME_TYPE) + +_SECURITYSCHEME_IN = _descriptor.EnumDescriptor( + name='In', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.In', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='IN_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='IN_QUERY', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='IN_HEADER', index=2, number=2, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=4501, + serialized_end=4550, +) +_sym_db.RegisterEnumDescriptor(_SECURITYSCHEME_IN) + +_SECURITYSCHEME_FLOW = _descriptor.EnumDescriptor( + name='Flow', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.Flow', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='FLOW_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FLOW_IMPLICIT', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FLOW_PASSWORD', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FLOW_APPLICATION', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FLOW_ACCESS_CODE', index=4, number=4, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=4552, + serialized_end=4658, +) +_sym_db.RegisterEnumDescriptor(_SECURITYSCHEME_FLOW) + + +_SWAGGER_RESPONSESENTRY = _descriptor.Descriptor( + name='ResponsesEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.ResponsesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.ResponsesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.ResponsesEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=813, + serialized_end=912, +) + +_SWAGGER_EXTENSIONSENTRY = _descriptor.Descriptor( + name='ExtensionsEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.ExtensionsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.ExtensionsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.ExtensionsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=914, + serialized_end=987, +) + +_SWAGGER = _descriptor.Descriptor( + name='Swagger', + full_name='grpc.gateway.protoc_gen_swagger.options.Swagger', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='swagger', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.swagger', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='info', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.info', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='host', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.host', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='base_path', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.base_path', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='schemes', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.schemes', index=4, + number=5, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='consumes', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.consumes', index=5, + number=6, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='produces', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.produces', index=6, + number=7, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='responses', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.responses', index=7, + number=10, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='security_definitions', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.security_definitions', index=8, + number=11, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='security', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.security', index=9, + number=12, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='external_docs', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.external_docs', index=10, + number=14, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='extensions', full_name='grpc.gateway.protoc_gen_swagger.options.Swagger.extensions', index=11, + number=15, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SWAGGER_RESPONSESENTRY, _SWAGGER_EXTENSIONSENTRY, ], + enum_types=[ + _SWAGGER_SWAGGERSCHEME, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=145, + serialized_end=1073, +) + + +_OPERATION_RESPONSESENTRY = _descriptor.Descriptor( + name='ResponsesEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Operation.ResponsesEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.ResponsesEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.ResponsesEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=813, + serialized_end=912, +) + +_OPERATION_EXTENSIONSENTRY = _descriptor.Descriptor( + name='ExtensionsEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Operation.ExtensionsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.ExtensionsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.ExtensionsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=914, + serialized_end=987, +) + +_OPERATION = _descriptor.Descriptor( + name='Operation', + full_name='grpc.gateway.protoc_gen_swagger.options.Operation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='tags', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.tags', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='summary', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.summary', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.description', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='external_docs', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.external_docs', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='operation_id', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.operation_id', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='consumes', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.consumes', index=5, + number=6, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='produces', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.produces', index=6, + number=7, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='responses', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.responses', index=7, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='schemes', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.schemes', index=8, + number=10, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='deprecated', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.deprecated', index=9, + number=11, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='security', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.security', index=10, + number=12, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='extensions', full_name='grpc.gateway.protoc_gen_swagger.options.Operation.extensions', index=11, + number=13, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_OPERATION_RESPONSESENTRY, _OPERATION_EXTENSIONSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1076, + serialized_end=1757, +) + + +_RESPONSE_EXTENSIONSENTRY = _descriptor.Descriptor( + name='ExtensionsEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Response.ExtensionsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Response.ExtensionsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Response.ExtensionsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=914, + serialized_end=987, +) + +_RESPONSE = _descriptor.Descriptor( + name='Response', + full_name='grpc.gateway.protoc_gen_swagger.options.Response', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.Response.description', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='schema', full_name='grpc.gateway.protoc_gen_swagger.options.Response.schema', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='extensions', full_name='grpc.gateway.protoc_gen_swagger.options.Response.extensions', index=2, + number=5, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RESPONSE_EXTENSIONSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1760, + serialized_end=2030, +) + + +_INFO_EXTENSIONSENTRY = _descriptor.Descriptor( + name='ExtensionsEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Info.ExtensionsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Info.ExtensionsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Info.ExtensionsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=914, + serialized_end=987, +) + +_INFO = _descriptor.Descriptor( + name='Info', + full_name='grpc.gateway.protoc_gen_swagger.options.Info', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='grpc.gateway.protoc_gen_swagger.options.Info.title', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.Info.description', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='terms_of_service', full_name='grpc.gateway.protoc_gen_swagger.options.Info.terms_of_service', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='contact', full_name='grpc.gateway.protoc_gen_swagger.options.Info.contact', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='license', full_name='grpc.gateway.protoc_gen_swagger.options.Info.license', index=4, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='version', full_name='grpc.gateway.protoc_gen_swagger.options.Info.version', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='extensions', full_name='grpc.gateway.protoc_gen_swagger.options.Info.extensions', index=6, + number=7, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_INFO_EXTENSIONSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2033, + serialized_end=2410, +) + + +_CONTACT = _descriptor.Descriptor( + name='Contact', + full_name='grpc.gateway.protoc_gen_swagger.options.Contact', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='grpc.gateway.protoc_gen_swagger.options.Contact.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='url', full_name='grpc.gateway.protoc_gen_swagger.options.Contact.url', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='email', full_name='grpc.gateway.protoc_gen_swagger.options.Contact.email', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2412, + serialized_end=2463, +) + + +_LICENSE = _descriptor.Descriptor( + name='License', + full_name='grpc.gateway.protoc_gen_swagger.options.License', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='grpc.gateway.protoc_gen_swagger.options.License.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='url', full_name='grpc.gateway.protoc_gen_swagger.options.License.url', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2465, + serialized_end=2501, +) + + +_EXTERNALDOCUMENTATION = _descriptor.Descriptor( + name='ExternalDocumentation', + full_name='grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation.description', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='url', full_name='grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation.url', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2503, + serialized_end=2560, +) + + +_SCHEMA = _descriptor.Descriptor( + name='Schema', + full_name='grpc.gateway.protoc_gen_swagger.options.Schema', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='json_schema', full_name='grpc.gateway.protoc_gen_swagger.options.Schema.json_schema', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='discriminator', full_name='grpc.gateway.protoc_gen_swagger.options.Schema.discriminator', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='read_only', full_name='grpc.gateway.protoc_gen_swagger.options.Schema.read_only', index=2, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='external_docs', full_name='grpc.gateway.protoc_gen_swagger.options.Schema.external_docs', index=3, + number=5, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='example', full_name='grpc.gateway.protoc_gen_swagger.options.Schema.example', index=4, + number=6, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2563, + serialized_end=2819, +) + + +_JSONSCHEMA = _descriptor.Descriptor( + name='JSONSchema', + full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='ref', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.ref', index=0, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='title', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.title', index=1, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.description', index=2, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='default', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.default', index=3, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='read_only', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.read_only', index=4, + number=8, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='multiple_of', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.multiple_of', index=5, + number=10, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='maximum', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.maximum', index=6, + number=11, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='exclusive_maximum', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.exclusive_maximum', index=7, + number=12, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='minimum', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.minimum', index=8, + number=13, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='exclusive_minimum', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.exclusive_minimum', index=9, + number=14, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_length', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.max_length', index=10, + number=15, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_length', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.min_length', index=11, + number=16, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='pattern', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.pattern', index=12, + number=17, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_items', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.max_items', index=13, + number=20, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_items', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.min_items', index=14, + number=21, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='unique_items', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.unique_items', index=15, + number=22, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='max_properties', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.max_properties', index=16, + number=24, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='min_properties', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.min_properties', index=17, + number=25, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='required', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.required', index=18, + number=26, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='array', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.array', index=19, + number=34, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='type', full_name='grpc.gateway.protoc_gen_swagger.options.JSONSchema.type', index=20, + number=35, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _JSONSCHEMA_JSONSCHEMASIMPLETYPES, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2822, + serialized_end=3520, +) + + +_TAG = _descriptor.Descriptor( + name='Tag', + full_name='grpc.gateway.protoc_gen_swagger.options.Tag', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.Tag.description', index=0, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='external_docs', full_name='grpc.gateway.protoc_gen_swagger.options.Tag.external_docs', index=1, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3522, + serialized_end=3641, +) + + +_SECURITYDEFINITIONS_SECURITYENTRY = _descriptor.Descriptor( + name='SecurityEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3761, + serialized_end=3865, +) + +_SECURITYDEFINITIONS = _descriptor.Descriptor( + name='SecurityDefinitions', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='security', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.security', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SECURITYDEFINITIONS_SECURITYENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3644, + serialized_end=3865, +) + + +_SECURITYSCHEME_EXTENSIONSENTRY = _descriptor.Descriptor( + name='ExtensionsEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.ExtensionsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.ExtensionsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.ExtensionsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=914, + serialized_end=987, +) + +_SECURITYSCHEME = _descriptor.Descriptor( + name='SecurityScheme', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='description', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.description', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='in', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.in', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='flow', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.flow', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='authorization_url', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.authorization_url', index=5, + number=6, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='token_url', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.token_url', index=6, + number=7, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scopes', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.scopes', index=7, + number=8, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='extensions', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityScheme.extensions', index=8, + number=9, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SECURITYSCHEME_EXTENSIONSENTRY, ], + enum_types=[ + _SECURITYSCHEME_TYPE, + _SECURITYSCHEME_IN, + _SECURITYSCHEME_FLOW, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3868, + serialized_end=4658, +) + + +_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE = _descriptor.Descriptor( + name='SecurityRequirementValue', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementValue', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='scope', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementValue.scope', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4801, + serialized_end=4842, +) + +_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY = _descriptor.Descriptor( + name='SecurityRequirementEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4845, + serialized_end=4990, +) + +_SECURITYREQUIREMENT = _descriptor.Descriptor( + name='SecurityRequirement', + full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='security_requirement', full_name='grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.security_requirement', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE, _SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4661, + serialized_end=4990, +) + + +_SCOPES_SCOPEENTRY = _descriptor.Descriptor( + name='ScopeEntry', + full_name='grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5078, + serialized_end=5122, +) + +_SCOPES = _descriptor.Descriptor( + name='Scopes', + full_name='grpc.gateway.protoc_gen_swagger.options.Scopes', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='scope', full_name='grpc.gateway.protoc_gen_swagger.options.Scopes.scope', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_SCOPES_SCOPEENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4993, + serialized_end=5122, +) + +_SWAGGER_RESPONSESENTRY.fields_by_name['value'].message_type = _RESPONSE +_SWAGGER_RESPONSESENTRY.containing_type = _SWAGGER +_SWAGGER_EXTENSIONSENTRY.fields_by_name['value'].message_type = google_dot_protobuf_dot_struct__pb2._VALUE +_SWAGGER_EXTENSIONSENTRY.containing_type = _SWAGGER +_SWAGGER.fields_by_name['info'].message_type = _INFO +_SWAGGER.fields_by_name['schemes'].enum_type = _SWAGGER_SWAGGERSCHEME +_SWAGGER.fields_by_name['responses'].message_type = _SWAGGER_RESPONSESENTRY +_SWAGGER.fields_by_name['security_definitions'].message_type = _SECURITYDEFINITIONS +_SWAGGER.fields_by_name['security'].message_type = _SECURITYREQUIREMENT +_SWAGGER.fields_by_name['external_docs'].message_type = _EXTERNALDOCUMENTATION +_SWAGGER.fields_by_name['extensions'].message_type = _SWAGGER_EXTENSIONSENTRY +_SWAGGER_SWAGGERSCHEME.containing_type = _SWAGGER +_OPERATION_RESPONSESENTRY.fields_by_name['value'].message_type = _RESPONSE +_OPERATION_RESPONSESENTRY.containing_type = _OPERATION +_OPERATION_EXTENSIONSENTRY.fields_by_name['value'].message_type = google_dot_protobuf_dot_struct__pb2._VALUE +_OPERATION_EXTENSIONSENTRY.containing_type = _OPERATION +_OPERATION.fields_by_name['external_docs'].message_type = _EXTERNALDOCUMENTATION +_OPERATION.fields_by_name['responses'].message_type = _OPERATION_RESPONSESENTRY +_OPERATION.fields_by_name['security'].message_type = _SECURITYREQUIREMENT +_OPERATION.fields_by_name['extensions'].message_type = _OPERATION_EXTENSIONSENTRY +_RESPONSE_EXTENSIONSENTRY.fields_by_name['value'].message_type = google_dot_protobuf_dot_struct__pb2._VALUE +_RESPONSE_EXTENSIONSENTRY.containing_type = _RESPONSE +_RESPONSE.fields_by_name['schema'].message_type = _SCHEMA +_RESPONSE.fields_by_name['extensions'].message_type = _RESPONSE_EXTENSIONSENTRY +_INFO_EXTENSIONSENTRY.fields_by_name['value'].message_type = google_dot_protobuf_dot_struct__pb2._VALUE +_INFO_EXTENSIONSENTRY.containing_type = _INFO +_INFO.fields_by_name['contact'].message_type = _CONTACT +_INFO.fields_by_name['license'].message_type = _LICENSE +_INFO.fields_by_name['extensions'].message_type = _INFO_EXTENSIONSENTRY +_SCHEMA.fields_by_name['json_schema'].message_type = _JSONSCHEMA +_SCHEMA.fields_by_name['external_docs'].message_type = _EXTERNALDOCUMENTATION +_SCHEMA.fields_by_name['example'].message_type = google_dot_protobuf_dot_any__pb2._ANY +_JSONSCHEMA.fields_by_name['type'].enum_type = _JSONSCHEMA_JSONSCHEMASIMPLETYPES +_JSONSCHEMA_JSONSCHEMASIMPLETYPES.containing_type = _JSONSCHEMA +_TAG.fields_by_name['external_docs'].message_type = _EXTERNALDOCUMENTATION +_SECURITYDEFINITIONS_SECURITYENTRY.fields_by_name['value'].message_type = _SECURITYSCHEME +_SECURITYDEFINITIONS_SECURITYENTRY.containing_type = _SECURITYDEFINITIONS +_SECURITYDEFINITIONS.fields_by_name['security'].message_type = _SECURITYDEFINITIONS_SECURITYENTRY +_SECURITYSCHEME_EXTENSIONSENTRY.fields_by_name['value'].message_type = google_dot_protobuf_dot_struct__pb2._VALUE +_SECURITYSCHEME_EXTENSIONSENTRY.containing_type = _SECURITYSCHEME +_SECURITYSCHEME.fields_by_name['type'].enum_type = _SECURITYSCHEME_TYPE +_SECURITYSCHEME.fields_by_name['in'].enum_type = _SECURITYSCHEME_IN +_SECURITYSCHEME.fields_by_name['flow'].enum_type = _SECURITYSCHEME_FLOW +_SECURITYSCHEME.fields_by_name['scopes'].message_type = _SCOPES +_SECURITYSCHEME.fields_by_name['extensions'].message_type = _SECURITYSCHEME_EXTENSIONSENTRY +_SECURITYSCHEME_TYPE.containing_type = _SECURITYSCHEME +_SECURITYSCHEME_IN.containing_type = _SECURITYSCHEME +_SECURITYSCHEME_FLOW.containing_type = _SECURITYSCHEME +_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE.containing_type = _SECURITYREQUIREMENT +_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY.fields_by_name['value'].message_type = _SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE +_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY.containing_type = _SECURITYREQUIREMENT +_SECURITYREQUIREMENT.fields_by_name['security_requirement'].message_type = _SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY +_SCOPES_SCOPEENTRY.containing_type = _SCOPES +_SCOPES.fields_by_name['scope'].message_type = _SCOPES_SCOPEENTRY +DESCRIPTOR.message_types_by_name['Swagger'] = _SWAGGER +DESCRIPTOR.message_types_by_name['Operation'] = _OPERATION +DESCRIPTOR.message_types_by_name['Response'] = _RESPONSE +DESCRIPTOR.message_types_by_name['Info'] = _INFO +DESCRIPTOR.message_types_by_name['Contact'] = _CONTACT +DESCRIPTOR.message_types_by_name['License'] = _LICENSE +DESCRIPTOR.message_types_by_name['ExternalDocumentation'] = _EXTERNALDOCUMENTATION +DESCRIPTOR.message_types_by_name['Schema'] = _SCHEMA +DESCRIPTOR.message_types_by_name['JSONSchema'] = _JSONSCHEMA +DESCRIPTOR.message_types_by_name['Tag'] = _TAG +DESCRIPTOR.message_types_by_name['SecurityDefinitions'] = _SECURITYDEFINITIONS +DESCRIPTOR.message_types_by_name['SecurityScheme'] = _SECURITYSCHEME +DESCRIPTOR.message_types_by_name['SecurityRequirement'] = _SECURITYREQUIREMENT +DESCRIPTOR.message_types_by_name['Scopes'] = _SCOPES +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +Swagger = _reflection.GeneratedProtocolMessageType('Swagger', (_message.Message,), { + + 'ResponsesEntry' : _reflection.GeneratedProtocolMessageType('ResponsesEntry', (_message.Message,), { + 'DESCRIPTOR' : _SWAGGER_RESPONSESENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Swagger.ResponsesEntry) + }) + , + + 'ExtensionsEntry' : _reflection.GeneratedProtocolMessageType('ExtensionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _SWAGGER_EXTENSIONSENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Swagger.ExtensionsEntry) + }) + , + 'DESCRIPTOR' : _SWAGGER, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Swagger) + }) +_sym_db.RegisterMessage(Swagger) +_sym_db.RegisterMessage(Swagger.ResponsesEntry) +_sym_db.RegisterMessage(Swagger.ExtensionsEntry) + +Operation = _reflection.GeneratedProtocolMessageType('Operation', (_message.Message,), { + + 'ResponsesEntry' : _reflection.GeneratedProtocolMessageType('ResponsesEntry', (_message.Message,), { + 'DESCRIPTOR' : _OPERATION_RESPONSESENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Operation.ResponsesEntry) + }) + , + + 'ExtensionsEntry' : _reflection.GeneratedProtocolMessageType('ExtensionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _OPERATION_EXTENSIONSENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Operation.ExtensionsEntry) + }) + , + 'DESCRIPTOR' : _OPERATION, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Operation) + }) +_sym_db.RegisterMessage(Operation) +_sym_db.RegisterMessage(Operation.ResponsesEntry) +_sym_db.RegisterMessage(Operation.ExtensionsEntry) + +Response = _reflection.GeneratedProtocolMessageType('Response', (_message.Message,), { + + 'ExtensionsEntry' : _reflection.GeneratedProtocolMessageType('ExtensionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _RESPONSE_EXTENSIONSENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Response.ExtensionsEntry) + }) + , + 'DESCRIPTOR' : _RESPONSE, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Response) + }) +_sym_db.RegisterMessage(Response) +_sym_db.RegisterMessage(Response.ExtensionsEntry) + +Info = _reflection.GeneratedProtocolMessageType('Info', (_message.Message,), { + + 'ExtensionsEntry' : _reflection.GeneratedProtocolMessageType('ExtensionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _INFO_EXTENSIONSENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Info.ExtensionsEntry) + }) + , + 'DESCRIPTOR' : _INFO, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Info) + }) +_sym_db.RegisterMessage(Info) +_sym_db.RegisterMessage(Info.ExtensionsEntry) + +Contact = _reflection.GeneratedProtocolMessageType('Contact', (_message.Message,), { + 'DESCRIPTOR' : _CONTACT, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Contact) + }) +_sym_db.RegisterMessage(Contact) + +License = _reflection.GeneratedProtocolMessageType('License', (_message.Message,), { + 'DESCRIPTOR' : _LICENSE, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.License) + }) +_sym_db.RegisterMessage(License) + +ExternalDocumentation = _reflection.GeneratedProtocolMessageType('ExternalDocumentation', (_message.Message,), { + 'DESCRIPTOR' : _EXTERNALDOCUMENTATION, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.ExternalDocumentation) + }) +_sym_db.RegisterMessage(ExternalDocumentation) + +Schema = _reflection.GeneratedProtocolMessageType('Schema', (_message.Message,), { + 'DESCRIPTOR' : _SCHEMA, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Schema) + }) +_sym_db.RegisterMessage(Schema) + +JSONSchema = _reflection.GeneratedProtocolMessageType('JSONSchema', (_message.Message,), { + 'DESCRIPTOR' : _JSONSCHEMA, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.JSONSchema) + }) +_sym_db.RegisterMessage(JSONSchema) + +Tag = _reflection.GeneratedProtocolMessageType('Tag', (_message.Message,), { + 'DESCRIPTOR' : _TAG, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Tag) + }) +_sym_db.RegisterMessage(Tag) + +SecurityDefinitions = _reflection.GeneratedProtocolMessageType('SecurityDefinitions', (_message.Message,), { + + 'SecurityEntry' : _reflection.GeneratedProtocolMessageType('SecurityEntry', (_message.Message,), { + 'DESCRIPTOR' : _SECURITYDEFINITIONS_SECURITYENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions.SecurityEntry) + }) + , + 'DESCRIPTOR' : _SECURITYDEFINITIONS, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityDefinitions) + }) +_sym_db.RegisterMessage(SecurityDefinitions) +_sym_db.RegisterMessage(SecurityDefinitions.SecurityEntry) + +SecurityScheme = _reflection.GeneratedProtocolMessageType('SecurityScheme', (_message.Message,), { + + 'ExtensionsEntry' : _reflection.GeneratedProtocolMessageType('ExtensionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _SECURITYSCHEME_EXTENSIONSENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityScheme.ExtensionsEntry) + }) + , + 'DESCRIPTOR' : _SECURITYSCHEME, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityScheme) + }) +_sym_db.RegisterMessage(SecurityScheme) +_sym_db.RegisterMessage(SecurityScheme.ExtensionsEntry) + +SecurityRequirement = _reflection.GeneratedProtocolMessageType('SecurityRequirement', (_message.Message,), { + + 'SecurityRequirementValue' : _reflection.GeneratedProtocolMessageType('SecurityRequirementValue', (_message.Message,), { + 'DESCRIPTOR' : _SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementValue) + }) + , + + 'SecurityRequirementEntry' : _reflection.GeneratedProtocolMessageType('SecurityRequirementEntry', (_message.Message,), { + 'DESCRIPTOR' : _SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityRequirement.SecurityRequirementEntry) + }) + , + 'DESCRIPTOR' : _SECURITYREQUIREMENT, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.SecurityRequirement) + }) +_sym_db.RegisterMessage(SecurityRequirement) +_sym_db.RegisterMessage(SecurityRequirement.SecurityRequirementValue) +_sym_db.RegisterMessage(SecurityRequirement.SecurityRequirementEntry) + +Scopes = _reflection.GeneratedProtocolMessageType('Scopes', (_message.Message,), { + + 'ScopeEntry' : _reflection.GeneratedProtocolMessageType('ScopeEntry', (_message.Message,), { + 'DESCRIPTOR' : _SCOPES_SCOPEENTRY, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Scopes.ScopeEntry) + }) + , + 'DESCRIPTOR' : _SCOPES, + '__module__' : 'protoc_gen_swagger.options.openapiv2_pb2' + # @@protoc_insertion_point(class_scope:grpc.gateway.protoc_gen_swagger.options.Scopes) + }) +_sym_db.RegisterMessage(Scopes) +_sym_db.RegisterMessage(Scopes.ScopeEntry) + + +DESCRIPTOR._options = None +_SWAGGER_RESPONSESENTRY._options = None +_SWAGGER_EXTENSIONSENTRY._options = None +_OPERATION_RESPONSESENTRY._options = None +_OPERATION_EXTENSIONSENTRY._options = None +_RESPONSE_EXTENSIONSENTRY._options = None +_INFO_EXTENSIONSENTRY._options = None +_SECURITYDEFINITIONS_SECURITYENTRY._options = None +_SECURITYSCHEME_EXTENSIONSENTRY._options = None +_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY._options = None +_SCOPES_SCOPEENTRY._options = None +# @@protoc_insertion_point(module_scope) From e8673fa8307c68b67ff95a33128b7a295c426851 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:23:47 +0530 Subject: [PATCH 06/41] Create separate package for thrift and protobuf translation --- .../exporter/jaeger/translate/__init__.py | 39 +++ .../exporter/jaeger/translate/protobuf.py | 231 ++++++++++++++++++ .../exporter/jaeger/translate/thrift.py | 197 +++++++++++++++ 3 files changed, 467 insertions(+) create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py new file mode 100644 index 00000000000..f0f42094da7 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py @@ -0,0 +1,39 @@ +from abc import ABC, abstractmethod +from typing import Any, Sequence, Union, Optional + +from opentelemetry.exporter.jaeger.gen.jaeger import Collector as TCollector +from opentelemetry.sdk.trace import Span +from opentelemetry.trace import SpanKind +from opentelemetry.util import types + +OTLP_JAEGER_SPAN_KIND = { + SpanKind.CLIENT: "client", + SpanKind.SERVER: "server", + SpanKind.CONSUMER: "consumer", + SpanKind.PRODUCER: "producer", + SpanKind.INTERNAL: "internal", +} + +NAME_KEY = "otel.instrumentation_library.name" +VERSION_KEY = "otel.instrumentation_library.version" + + +def _nsec_to_usec_round(nsec: int) -> int: + """Round nanoseconds to microseconds""" + return (nsec + 500) // 10 ** 3 + + +def _nsec_to_sec_round(nsec: int) -> int: + """Round nanoseconds to seconds""" + return (nsec + 500) // 10 ** 9 + + +def _convert_int_to_i64(val): + """Convert integer to signed int64 (i64)""" + if val > 0x7FFFFFFFFFFFFFFF: + val -= 0x10000000000000000 + return val + + +def _int_to_bytes(val: int) -> bytes: + return val.to_bytes((val.bit_length() + 7) // 8, "big") diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py new file mode 100644 index 00000000000..4f6803447a1 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -0,0 +1,231 @@ +from typing import Optional, Sequence + +import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 +from google.protobuf.timestamp_pb2 import Timestamp +from google.protobuf.duration_pb2 import Duration +from opentelemetry.exporter.jaeger.translate import ( + NAME_KEY, + OTLP_JAEGER_SPAN_KIND, + VERSION_KEY, + _nsec_to_sec_round, + _int_to_bytes, +) +from opentelemetry.sdk.trace import Span +from opentelemetry.util import types + +# pylint: disable=no-member + + +def _get_string_key_value( + key, value: types.AttributeValue +) -> model_pb2.KeyValue: + """Returns jaeger string KeyValue.""" + return model_pb2.KeyValue( + key=key, v_str=value, v_type=model_pb2.ValueType.STRING + ) + + +def _get_bool_key_value( + key: str, value: types.AttributeValue +) -> model_pb2.KeyValue: + """Returns jaeger boolean KeyValue.""" + return model_pb2.KeyValue( + key=key, v_bool=value, v_type=model_pb2.ValueType.BOOL + ) + + +def _get_long_key_value( + key: str, value: types.AttributeValue +) -> model_pb2.KeyValue: + """Returns jaeger long KeyValue.""" + return model_pb2.KeyValue( + key=key, v_int64=value, v_type=model_pb2.ValueType.INT64 + ) + + +def _get_double_key_value( + key: str, value: types.AttributeValue +) -> model_pb2.KeyValue: + """Returns jaeger double KeyValue.""" + return model_pb2.KeyValue( + key=key, v_float64=value, v_type=model_pb2.ValueType.FLOAT64 + ) + + +def _get_binary_key_value( + key: str, value: types.AttributeValue +) -> model_pb2.KeyValue: + """Returns jaeger double KeyValue.""" + return model_pb2.KeyValue( + key=key, v_binary=value, v_type=model_pb2.ValueType.BINARY + ) + + +def _translate_attribute( + key: str, value: types.AttributeValue +) -> Optional[model_pb2.KeyValue]: + """Convert the attributes to jaeger keyvalues.""" + if isinstance(value, bool): + return _get_bool_key_value(key, value) + if isinstance(value, str): + return _get_string_key_value(key, value) + if isinstance(value, int): + return _get_long_key_value(key, value) + if isinstance(value, float): + return _get_double_key_value(key, value) + if isinstance(value, tuple): + return _get_string_key_value(key, str(value)) + return None + + +def _extract_key_values(span: Span) -> Sequence[model_pb2.KeyValue]: + """Extracts keyvalues from span and returns list of jaeger keyvalues. + + Args: + span: span to extract keyvalues + """ + translated = [] + if span.attributes: + for key, value in span.attributes.items(): + key_value = _translate_attribute(key, value) + if key_value: + translated.append(key_value) + if span.resource.attributes: + for key, value in span.resource.attributes.items(): + key_value = _translate_attribute(key, value) + if key_value: + translated.append(key_value) + + code = _get_long_key_value("status.code", span.status.status_code.value) + message = _get_string_key_value("status.message", span.status.description) + kind = _get_string_key_value("span.kind", OTLP_JAEGER_SPAN_KIND[span.kind]) + translated.extend([code, message, kind]) + + # Instrumentation info KeyValues + if span.instrumentation_info: + name = _get_string_key_value(NAME_KEY, span.instrumentation_info.name) + version = _get_string_key_value( + VERSION_KEY, span.instrumentation_info.version + ) + translated.extend([name, version]) + + # Make sure to add "error" tag if span status is not OK + if not span.status.is_ok: + translated.append(_get_bool_key_value("error", True)) + + return translated + + +def _extract_refs(span: Span) -> Optional[Sequence[model_pb2.SpanRef]]: + """Returns jaeger span references if links exists, otherwise None. + + Args: + span: span to extract refs + """ + if not span.links: + return None + + refs = [] + for link in span.links: + trace_id = link.context.trace_id + span_id = link.context.span_id + refs.append( + model_pb2.SpanRef( + ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, + trace_id=_int_to_bytes(trace_id), + span_id=_int_to_bytes(span_id), + ) + ) + return refs + + +def _extract_logs(span: Span) -> Optional[Sequence[model_pb2.Log]]: + """Returns jaeger logs if events exists, otherwise None. + + Args: + span: span to extract logs + """ + if not span.events: + return None + + logs = [] + for event in span.events: + fields = [] + for key, value in event.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + fields.append(tag) + + fields.append( + model_pb2.KeyValue( + key="message", + v_type=model_pb2.ValueType.STRING, + v_str=event.name, + ) + ) + event_ts = Timestamp( + seconds=_nsec_to_sec_round(event.timestamp), nanos=event.timestamp + ) + + logs.append(model_pb2.Log(timestamp=event_ts, fields=fields)) + + return logs + + +def _duration_from_two_time_stamps( + start: Timestamp, end: Timestamp +) -> Duration: + """Compute Duration from two Timestamps.""" + duration = Duration( + seconds=end.seconds - start.seconds, nanos=end.nanos - start.nanos, + ) + if duration.seconds < 0 and duration.nanos > 0: + duration.seconds += 1 + duration.nanos -= 1000000000 + elif duration.seconds > 0 and duration.nanos < 0: + duration.seconds -= 1 + duration.nanos += 1000000000 + return duration + + +def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: + """Translate the spans to Jaeger format. + + Args: + spans: Tuple of spans to convert + """ + jaeger_spans = [] + + for span in spans: + ctx = span.get_span_context() + trace_id = ctx.trace_id + span_id = ctx.span_id + + start_time = Timestamp( + seconds=_nsec_to_sec_round(span.start_time), nanos=span.start_time + ) + end_time = Timestamp( + seconds=_nsec_to_sec_round(span.end_time), nanos=span.end_time + ) + duration = _duration_from_two_time_stamps(start_time, end_time) + + tags = _extract_key_values(span) + refs = _extract_refs(span) + logs = _extract_logs(span) + + flags = int(ctx.trace_flags) + + jaeger_span = model_pb2.Span( + trace_id=_int_to_bytes(trace_id), + span_id=_int_to_bytes(span_id), + operation_name=span.name, + references=refs, + flags=flags, + start_time=start_time, + duration=duration, + tags=tags, + logs=logs, + ) + jaeger_spans.append(jaeger_span) + + return jaeger_spans diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py new file mode 100644 index 00000000000..c9378a8217b --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py @@ -0,0 +1,197 @@ +from typing import Optional, Sequence + +from opentelemetry.exporter.jaeger.gen.jaeger import Collector as TCollector +from opentelemetry.exporter.jaeger.translate import ( + NAME_KEY, + OTLP_JAEGER_SPAN_KIND, + VERSION_KEY, + _convert_int_to_i64, + _nsec_to_usec_round, +) +from opentelemetry.sdk.trace import Span +from opentelemetry.util import types + + +def _get_string_tag(key, value: types.AttributeValue) -> TCollector.Tag: + """Returns jaeger string tag.""" + return TCollector.Tag(key=key, vStr=value, vType=TCollector.TagType.STRING) + + +def _get_bool_tag(key: str, value: types.AttributeValue) -> TCollector.Tag: + """Returns jaeger boolean tag.""" + return TCollector.Tag(key=key, vBool=value, vType=TCollector.TagType.BOOL) + + +def _get_long_tag(key: str, value: types.AttributeValue) -> TCollector.Tag: + """Returns jaeger long tag.""" + return TCollector.Tag(key=key, vLong=value, vType=TCollector.TagType.LONG) + + +def _get_double_tag(key: str, value: types.AttributeValue) -> TCollector.Tag: + """Returns jaeger double tag.""" + return TCollector.Tag( + key=key, vDouble=value, vType=TCollector.TagType.DOUBLE + ) + + +def _get_trace_id_low(trace_id): + return _convert_int_to_i64(trace_id & 0xFFFFFFFFFFFFFFFF) + + +def _get_trace_id_high(trace_id): + return _convert_int_to_i64((trace_id >> 64) & 0xFFFFFFFFFFFFFFFF) + + +def _translate_attribute( + key: str, value: types.AttributeValue +) -> Optional[TCollector.Tag]: + """Convert the attributes to jaeger tags.""" + if isinstance(value, bool): + return _get_bool_tag(key, value) + if isinstance(value, str): + return _get_string_tag(key, value) + if isinstance(value, int): + return _get_long_tag(key, value) + if isinstance(value, float): + return _get_double_tag(key, value) + if isinstance(value, tuple): + return _get_string_tag(key, str(value)) + return None + + +def _extract_tags(span: Span) -> Sequence[TCollector.Tag]: + """Extracts tags from span and returns list of jaeger tags. + + Args: + span: span to extract tags + """ + translated = [] + if span.attributes: + for key, value in span.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + translated.append(tag) + if span.resource.attributes: + for key, value in span.resource.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + translated.append(tag) + + code = _get_long_tag("status.code", span.status.status_code.value) + message = _get_string_tag("status.message", span.status.description) + kind = _get_string_tag("span.kind", OTLP_JAEGER_SPAN_KIND[span.kind]) + translated.extend([code, message, kind]) + + # Instrumentation info tags + if span.instrumentation_info: + name = _get_string_tag(NAME_KEY, span.instrumentation_info.name) + version = _get_string_tag( + VERSION_KEY, span.instrumentation_info.version + ) + translated.extend([name, version]) + + # Make sure to add "error" tag if span status is not OK + if not span.status.is_ok: + translated.append(_get_bool_tag("error", True)) + + return translated + + +def _extract_refs(span: Span) -> Optional[Sequence[TCollector.SpanRef]]: + """Returns jaeger span references if links exists, otherwise None. + + Args: + span: span to extract refs + """ + if not span.links: + return None + + refs = [] + for link in span.links: + trace_id = link.context.trace_id + span_id = link.context.span_id + refs.append( + TCollector.SpanRef( + refType=TCollector.SpanRefType.FOLLOWS_FROM, + traceIdHigh=_get_trace_id_high(trace_id), + traceIdLow=_get_trace_id_low(trace_id), + spanId=_convert_int_to_i64(span_id), + ) + ) + return refs + + +def _extract_logs(span: Span) -> Optional[Sequence[TCollector.Log]]: + """Returns jaeger logs if events exists, otherwise None. + + Args: + span: span to extract logs + """ + if not span.events: + return None + + logs = [] + for event in span.events: + fields = [] + for key, value in event.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + fields.append(tag) + + fields.append( + TCollector.Tag( + key="message", + vType=TCollector.TagType.STRING, + vStr=event.name, + ) + ) + + event_timestamp_us = _nsec_to_usec_round(event.timestamp) + logs.append( + TCollector.Log(timestamp=int(event_timestamp_us), fields=fields) + ) + + return logs + + +def _to_jaeger(spans: Sequence[Span]) -> Sequence[TCollector.Span]: + """Translate the spans to Jaeger format. + + Args: + spans: Tuple of spans to convert + """ + jaeger_spans = [] + + for span in spans: + ctx = span.get_span_context() + trace_id = ctx.trace_id + span_id = ctx.span_id + + start_time_us = _nsec_to_usec_round(span.start_time) + duration_us = _nsec_to_usec_round(span.end_time - span.start_time) + + parent_id = span.parent.span_id if span.parent else 0 + + tags = _extract_tags(span) + refs = _extract_refs(span) + logs = _extract_logs(span) + + flags = int(ctx.trace_flags) + + jaeger_span = TCollector.Span( + traceIdHigh=_get_trace_id_high(trace_id), + traceIdLow=_get_trace_id_low(trace_id), + # generated code expects i64 + spanId=_convert_int_to_i64(span_id), + operationName=span.name, + startTime=start_time_us, + duration=duration_us, + tags=tags, + logs=logs, + references=refs, + flags=flags, + parentSpanId=_convert_int_to_i64(parent_id), + ) + jaeger_spans.append(jaeger_span) + + return jaeger_spans From c1a5e61b5d5d167e625abbb909c4474f79f7fee3 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:24:12 +0530 Subject: [PATCH 07/41] Move AgentClient and Collector to package --- .../exporter/jaeger/send/__init__.py | 0 .../exporter/jaeger/send/protobuf.py | 0 .../exporter/jaeger/send/thrift.py | 103 ++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/__init__.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/protobuf.py create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/protobuf.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py new file mode 100644 index 00000000000..45b139b37d3 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py @@ -0,0 +1,103 @@ +import base64 +import logging +import socket + +from opentelemetry.exporter.jaeger.gen.agent import Agent as agent +from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger +from thrift.protocol import TBinaryProtocol, TCompactProtocol +from thrift.transport import THttpClient, TTransport + +UDP_PACKET_MAX_LENGTH = 65000 + + +logger = logging.getLogger(__name__) + + +class AgentClientUDP: + """Implement a UDP client to agent. + + Args: + host_name: The host name of the Jaeger server. + port: The port of the Jaeger server. + max_packet_size: Maximum size of UDP packet. + client: Class for creating new client objects for agencies. + """ + + def __init__( + self, + host_name, + port, + max_packet_size=UDP_PACKET_MAX_LENGTH, + client=agent.Client, + ): + self.address = (host_name, port) + self.max_packet_size = max_packet_size + self.buffer = TTransport.TMemoryBuffer() + self.client = client( + iprot=TCompactProtocol.TCompactProtocol(trans=self.buffer) + ) + + def emit(self, batch: jaeger.Batch): + """ + Args: + batch: Object to emit Jaeger spans. + """ + + # pylint: disable=protected-access + self.client._seqid = 0 + # truncate and reset the position of BytesIO object + self.buffer._buffer.truncate(0) + self.buffer._buffer.seek(0) + self.client.emitBatch(batch) + buff = self.buffer.getvalue() + if len(buff) > self.max_packet_size: + logger.warning( + "Data exceeds the max UDP packet size; size %r, max %r", + len(buff), + self.max_packet_size, + ) + return + + with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_socket: + udp_socket.sendto(buff, self.address) + + +class Collector: + """Submits collected spans to Thrift HTTP server. + + Args: + thrift_url: URL of the Jaeger HTTP Thrift. + auth: Auth tuple that contains username and password for Basic Auth. + """ + + def __init__(self, thrift_url="", auth=None): + self.thrift_url = thrift_url + self.auth = auth + self.http_transport = THttpClient.THttpClient( + uri_or_host=self.thrift_url + ) + self.protocol = TBinaryProtocol.TBinaryProtocol(self.http_transport) + + # set basic auth header + if auth is not None: + auth_header = "{}:{}".format(*auth) + decoded = base64.b64encode(auth_header.encode()).decode("ascii") + basic_auth = dict(Authorization="Basic {}".format(decoded)) + self.http_transport.setCustomHeaders(basic_auth) + + def submit(self, batch: jaeger.Batch): + """Submits batches to Thrift HTTP Server through Binary Protocol. + + Args: + batch: Object to emit Jaeger spans. + """ + batch.write(self.protocol) + self.http_transport.flush() + code = self.http_transport.code + msg = self.http_transport.message + if code >= 300 or code < 200: + logger.error( + "Traces cannot be uploaded; HTTP status code: %s, message: %s", + code, + msg, + ) From e34f5d9ea14eb2f95ed7efb3890dbf3aa997ae84 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 11 Dec 2020 20:24:38 +0530 Subject: [PATCH 08/41] Add tests for jaeger and protobuf --- .../tests/test_jaeger_exporter_thrift.py | 466 ++++++++++++++++++ .../tests/test_jarget_exporter_protobuf.py | 366 ++++++++++++++ 2 files changed, 832 insertions(+) create mode 100644 exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py create mode 100644 exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py new file mode 100644 index 00000000000..7ce6fea1383 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py @@ -0,0 +1,466 @@ +# Copyright 2018, OpenCensus Authors +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest +from unittest import mock + +# pylint:disable=no-name-in-module +# pylint:disable=import-error +import opentelemetry.exporter.jaeger as jaeger_exporter +from opentelemetry import trace as trace_api +from opentelemetry.configuration import Configuration +from opentelemetry.exporter.jaeger.gen.jaeger import ttypes as jaeger +from opentelemetry.sdk import trace +from opentelemetry.sdk.trace import Resource +from opentelemetry.sdk.util.instrumentation import InstrumentationInfo +from opentelemetry.trace import SpanKind +from opentelemetry.trace.status import Status, StatusCode + + +class TestJaegerSpanExporter(unittest.TestCase): + def setUp(self): + # create and save span to be used in tests + context = trace_api.SpanContext( + trace_id=0x000000000000000000000000DEADBEEF, + span_id=0x00000000DEADBEF0, + is_remote=False, + ) + + self._test_span = trace._Span("test_span", context=context) + self._test_span.start() + self._test_span.end() + # pylint: disable=protected-access + Configuration._reset() + + def tearDown(self): + # pylint: disable=protected-access + Configuration._reset() + + def test_constructor_default(self): + """Test the default values assigned by constructor.""" + service_name = "my-service-name" + agent_host_name = "localhost" + agent_port = 6831 + exporter = jaeger_exporter.JaegerSpanExporter(service_name) + + self.assertEqual(exporter.service_name, service_name) + self.assertEqual(exporter.agent_host_name, agent_host_name) + self.assertEqual(exporter.agent_port, agent_port) + self.assertEqual(exporter.collector_endpoint, None) + self.assertEqual(exporter.username, None) + self.assertEqual(exporter.password, None) + self.assertTrue(exporter.collector is None) + self.assertTrue(exporter.agent_client is not None) + + def test_constructor_explicit(self): + """Test the constructor passing all the options.""" + service = "my-opentelemetry-jaeger" + collector_endpoint = "https://opentelemetry.io:15875" + + agent_port = 14268 + agent_host_name = "opentelemetry.io" + + username = "username" + password = "password" + auth = (username, password) + + exporter = jaeger_exporter.JaegerSpanExporter( + service_name=service, + agent_host_name=agent_host_name, + agent_port=agent_port, + collector_endpoint=collector_endpoint, + username=username, + password=password, + ) + + self.assertEqual(exporter.service_name, service) + self.assertEqual(exporter.agent_host_name, agent_host_name) + self.assertEqual(exporter.agent_port, agent_port) + self.assertTrue(exporter.collector is not None) + self.assertEqual(exporter.collector.auth, auth) + # property should not construct new object + collector = exporter.collector + self.assertEqual(exporter.collector, collector) + # property should construct new object + # pylint: disable=protected-access + exporter._collector = None + exporter.username = None + exporter.password = None + self.assertNotEqual(exporter.collector, collector) + self.assertTrue(exporter.collector.auth is None) + + def test_constructor_by_environment_variables(self): + """Test the constructor using Environment Variables.""" + service = "my-opentelemetry-jaeger" + + agent_host_name = "opentelemetry.io" + agent_port = "6831" + + collector_endpoint = "https://opentelemetry.io:15875" + + username = "username" + password = "password" + auth = (username, password) + + environ_patcher = mock.patch.dict( + "os.environ", + { + "OTEL_EXPORTER_JAEGER_AGENT_HOST": agent_host_name, + "OTEL_EXPORTER_JAEGER_AGENT_PORT": agent_port, + "OTEL_EXPORTER_JAEGER_ENDPOINT": collector_endpoint, + "OTEL_EXPORTER_JAEGER_USER": username, + "OTEL_EXPORTER_JAEGER_PASSWORD": password, + }, + ) + + environ_patcher.start() + + exporter = jaeger_exporter.JaegerSpanExporter(service_name=service) + + self.assertEqual(exporter.service_name, service) + self.assertEqual(exporter.agent_host_name, agent_host_name) + self.assertEqual(exporter.agent_port, int(agent_port)) + self.assertTrue(exporter.collector is not None) + self.assertEqual(exporter.collector_endpoint, collector_endpoint) + self.assertEqual(exporter.collector.auth, auth) + # property should not construct new object + collector = exporter.collector + self.assertEqual(exporter.collector, collector) + # property should construct new object + # pylint: disable=protected-access + exporter._collector = None + exporter.username = None + exporter.password = None + self.assertNotEqual(exporter.collector, collector) + self.assertTrue(exporter.collector.auth is None) + + environ_patcher.stop() + + def test_nsec_to_usec_round(self): + # pylint: disable=protected-access + nsec_to_usec_round = jaeger_exporter.translate._nsec_to_usec_round + + self.assertEqual(nsec_to_usec_round(5000), 5) + self.assertEqual(nsec_to_usec_round(5499), 5) + self.assertEqual(nsec_to_usec_round(5500), 6) + + def test_all_otlp_span_kinds_are_mapped(self): + for kind in SpanKind: + self.assertIn( + kind, jaeger_exporter.translate.OTLP_JAEGER_SPAN_KIND + ) + + # pylint: disable=too-many-locals + def test_translate_to_jaeger(self): + # pylint: disable=invalid-name + self.maxDiff = None + + span_names = ("test1", "test2", "test3") + trace_id = 0x6E0C63257DE34C926F9EFCD03927272E + trace_id_high = 0x6E0C63257DE34C92 + trace_id_low = 0x6F9EFCD03927272E + span_id = 0x34BF92DEEFC58C92 + parent_id = 0x1111111111111111 + other_id = 0x2222222222222222 + + base_time = 683647322 * 10 ** 9 # in ns + start_times = ( + base_time, + base_time + 150 * 10 ** 6, + base_time + 300 * 10 ** 6, + ) + durations = (50 * 10 ** 6, 100 * 10 ** 6, 200 * 10 ** 6) + end_times = ( + start_times[0] + durations[0], + start_times[1] + durations[1], + start_times[2] + durations[2], + ) + + span_context = trace_api.SpanContext( + trace_id, span_id, is_remote=False + ) + parent_span_context = trace_api.SpanContext( + trace_id, parent_id, is_remote=False + ) + other_context = trace_api.SpanContext( + trace_id, other_id, is_remote=False + ) + + event_attributes = { + "annotation_bool": True, + "annotation_string": "annotation_test", + "key_float": 0.3, + } + + event_timestamp = base_time + 50 * 10 ** 6 + event = trace.Event( + name="event0", + timestamp=event_timestamp, + attributes=event_attributes, + ) + + link_attributes = {"key_bool": True} + + link = trace_api.Link( + context=other_context, attributes=link_attributes + ) + + default_tags = [ + jaeger.Tag( + key="status.code", + vType=jaeger.TagType.LONG, + vLong=StatusCode.UNSET.value, + ), + jaeger.Tag( + key="status.message", vType=jaeger.TagType.STRING, vStr=None + ), + jaeger.Tag( + key="span.kind", vType=jaeger.TagType.STRING, vStr="internal", + ), + ] + + otel_spans = [ + trace._Span( + name=span_names[0], + context=span_context, + parent=parent_span_context, + events=(event,), + links=(link,), + kind=trace_api.SpanKind.CLIENT, + ), + trace._Span( + name=span_names[1], context=parent_span_context, parent=None + ), + trace._Span( + name=span_names[2], context=other_context, parent=None + ), + ] + + otel_spans[0].start(start_time=start_times[0]) + # added here to preserve order + otel_spans[0].set_attribute("key_bool", False) + otel_spans[0].set_attribute("key_string", "hello_world") + otel_spans[0].set_attribute("key_float", 111.22) + otel_spans[0].set_attribute("key_tuple", ("tuple_element",)) + otel_spans[0].resource = Resource( + attributes={"key_resource": "some_resource"} + ) + otel_spans[0].set_status( + Status(StatusCode.ERROR, "Example description") + ) + otel_spans[0].end(end_time=end_times[0]) + + otel_spans[1].start(start_time=start_times[1]) + otel_spans[1].resource = Resource({}) + otel_spans[1].end(end_time=end_times[1]) + + otel_spans[2].start(start_time=start_times[2]) + otel_spans[2].resource = Resource({}) + otel_spans[2].set_status(Status(StatusCode.OK, "Example description")) + otel_spans[2].end(end_time=end_times[2]) + otel_spans[2].instrumentation_info = InstrumentationInfo( + name="name", version="version" + ) + + # pylint: disable=protected-access + spans = jaeger_exporter.translate.thrift._to_jaeger(otel_spans) + + expected_spans = [ + jaeger.Span( + operationName=span_names[0], + traceIdHigh=trace_id_high, + traceIdLow=trace_id_low, + spanId=span_id, + parentSpanId=parent_id, + startTime=start_times[0] // 10 ** 3, + duration=durations[0] // 10 ** 3, + flags=0, + tags=[ + jaeger.Tag( + key="key_bool", vType=jaeger.TagType.BOOL, vBool=False + ), + jaeger.Tag( + key="key_string", + vType=jaeger.TagType.STRING, + vStr="hello_world", + ), + jaeger.Tag( + key="key_float", + vType=jaeger.TagType.DOUBLE, + vDouble=111.22, + ), + jaeger.Tag( + key="key_tuple", + vType=jaeger.TagType.STRING, + vStr="('tuple_element',)", + ), + jaeger.Tag( + key="key_resource", + vType=jaeger.TagType.STRING, + vStr="some_resource", + ), + jaeger.Tag( + key="status.code", + vType=jaeger.TagType.LONG, + vLong=StatusCode.ERROR.value, + ), + jaeger.Tag( + key="status.message", + vType=jaeger.TagType.STRING, + vStr="Example description", + ), + jaeger.Tag( + key="span.kind", + vType=jaeger.TagType.STRING, + vStr="client", + ), + jaeger.Tag( + key="error", vType=jaeger.TagType.BOOL, vBool=True + ), + ], + references=[ + jaeger.SpanRef( + refType=jaeger.SpanRefType.FOLLOWS_FROM, + traceIdHigh=trace_id_high, + traceIdLow=trace_id_low, + spanId=other_id, + ) + ], + logs=[ + jaeger.Log( + timestamp=event_timestamp // 10 ** 3, + fields=[ + jaeger.Tag( + key="annotation_bool", + vType=jaeger.TagType.BOOL, + vBool=True, + ), + jaeger.Tag( + key="annotation_string", + vType=jaeger.TagType.STRING, + vStr="annotation_test", + ), + jaeger.Tag( + key="key_float", + vType=jaeger.TagType.DOUBLE, + vDouble=0.3, + ), + jaeger.Tag( + key="message", + vType=jaeger.TagType.STRING, + vStr="event0", + ), + ], + ) + ], + ), + jaeger.Span( + operationName=span_names[1], + traceIdHigh=trace_id_high, + traceIdLow=trace_id_low, + spanId=parent_id, + parentSpanId=0, + startTime=start_times[1] // 10 ** 3, + duration=durations[1] // 10 ** 3, + flags=0, + tags=default_tags, + ), + jaeger.Span( + operationName=span_names[2], + traceIdHigh=trace_id_high, + traceIdLow=trace_id_low, + spanId=other_id, + parentSpanId=0, + startTime=start_times[2] // 10 ** 3, + duration=durations[2] // 10 ** 3, + flags=0, + tags=[ + jaeger.Tag( + key="status.code", + vType=jaeger.TagType.LONG, + vLong=StatusCode.OK.value, + ), + jaeger.Tag( + key="status.message", + vType=jaeger.TagType.STRING, + vStr="Example description", + ), + jaeger.Tag( + key="span.kind", + vType=jaeger.TagType.STRING, + vStr="internal", + ), + jaeger.Tag( + key="otel.instrumentation_library.name", + vType=jaeger.TagType.STRING, + vStr="name", + ), + jaeger.Tag( + key="otel.instrumentation_library.version", + vType=jaeger.TagType.STRING, + vStr="version", + ), + ], + ), + ] + + # events are complicated to compare because order of fields + # (attributes) in otel is not important but in jeager it is + self.assertCountEqual( + spans[0].logs[0].fields, expected_spans[0].logs[0].fields + ) + # get rid of fields to be able to compare the whole spans + spans[0].logs[0].fields = None + expected_spans[0].logs[0].fields = None + + self.assertEqual(spans, expected_spans) + + def test_export(self): + """Test that agent and/or collector are invoked""" + exporter = jaeger_exporter.JaegerSpanExporter( + "test_export", agent_host_name="localhost", agent_port=6318 + ) + + # just agent is configured now + agent_client_mock = mock.Mock(spec=jaeger_exporter.AgentClientUDP) + # pylint: disable=protected-access + exporter._agent_client = agent_client_mock + + exporter.export((self._test_span,)) + self.assertEqual(agent_client_mock.emit.call_count, 1) + + # add also a collector and test that both are called + collector_mock = mock.Mock(spec=jaeger_exporter.Collector) + # pylint: disable=protected-access + exporter._collector = collector_mock + + exporter.export((self._test_span,)) + self.assertEqual(agent_client_mock.emit.call_count, 1) + self.assertEqual(collector_mock.submit.call_count, 1) + + def test_agent_client(self): + agent_client = jaeger_exporter.AgentClientUDP( + host_name="localhost", port=6354 + ) + + batch = jaeger.Batch( + # pylint: disable=protected-access + spans=jaeger_exporter.translate.thrift._to_jaeger( + (self._test_span,) + ), + process=jaeger.Process(serviceName="xxx"), + ) + + agent_client.emit(batch) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py new file mode 100644 index 00000000000..395e01f321a --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -0,0 +1,366 @@ +# Copyright 2018, OpenCensus Authors +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest + +from google.protobuf.timestamp_pb2 import Timestamp + +# pylint:disable=no-name-in-module +# pylint:disable=import-error +import opentelemetry.exporter.jaeger as jaeger_exporter +import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 +import opentelemetry.exporter.jaeger.translate as translate +from opentelemetry import trace as trace_api +from opentelemetry.configuration import Configuration +from opentelemetry.sdk import trace +from opentelemetry.sdk.trace import Resource +from opentelemetry.sdk.util.instrumentation import InstrumentationInfo +from opentelemetry.trace import SpanKind +from opentelemetry.trace.status import Status, StatusCode + + +class TestJaegerSpanExporter(unittest.TestCase): + def setUp(self): + # create and save span to be used in tests + context = trace_api.SpanContext( + trace_id=0x000000000000000000000000DEADBEEF, + span_id=0x00000000DEADBEF0, + is_remote=False, + ) + + self._test_span = trace._Span("test_span", context=context) + self._test_span.start() + self._test_span.end() + # pylint: disable=protected-access + Configuration._reset() + + def tearDown(self): + # pylint: disable=protected-access + Configuration._reset() + + def test_nsec_to_usec_round(self): + # pylint: disable=protected-access + nsec_to_usec_round = jaeger_exporter.translate._nsec_to_usec_round + + self.assertEqual(nsec_to_usec_round(5000), 5) + self.assertEqual(nsec_to_usec_round(5499), 5) + self.assertEqual(nsec_to_usec_round(5500), 6) + + def test_all_otlp_span_kinds_are_mapped(self): + for kind in SpanKind: + self.assertIn( + kind, jaeger_exporter.translate.OTLP_JAEGER_SPAN_KIND + ) + + # pylint: disable=too-many-locals + def test_translate_to_jaeger(self): + # pylint: disable=invalid-name + self.maxDiff = None + + span_names = ("test1", "test2", "test3") + trace_id = 0x6E0C63257DE34C926F9EFCD03927272E + span_id = 0x34BF92DEEFC58C92 + parent_id = 0x1111111111111111 + other_id = 0x2222222222222222 + + base_time = int(0.683647322 * (10 ** 9)) # in ns + start_times = ( + base_time, + base_time + 150 * 10 ** 6, + base_time + 300 * 10 ** 6, + ) + durations = (50 * 10 ** 6, 100 * 10 ** 6, 200 * 10 ** 6) + end_times = ( + start_times[0] + durations[0], + start_times[1] + durations[1], + start_times[2] + durations[2], + ) + + span_context = trace_api.SpanContext( + trace_id, span_id, is_remote=False + ) + parent_span_context = trace_api.SpanContext( + trace_id, parent_id, is_remote=False + ) + other_context = trace_api.SpanContext( + trace_id, other_id, is_remote=False + ) + + event_attributes = { + "annotation_bool": True, + "annotation_string": "annotation_test", + "key_float": 0.3, + } + + event_timestamp = base_time + 50 * 10 ** 6 + event_timestamp_proto = Timestamp( + seconds=translate._nsec_to_sec_round(event_timestamp), + nanos=event_timestamp, + ) + event = trace.Event( + name="event0", + timestamp=event_timestamp, + attributes=event_attributes, + ) + + link_attributes = {"key_bool": True} + + link = trace_api.Link( + context=other_context, attributes=link_attributes + ) + + default_tags = [ + model_pb2.KeyValue( + key="status.code", + v_type=model_pb2.ValueType.INT64, + v_int64=StatusCode.UNSET.value, + ), + model_pb2.KeyValue( + key="status.message", + v_type=model_pb2.ValueType.STRING, + v_str=None, + ), + model_pb2.KeyValue( + key="span.kind", + v_type=model_pb2.ValueType.STRING, + v_str="internal", + ), + ] + + otel_spans = [ + trace._Span( + name=span_names[0], + context=span_context, + parent=parent_span_context, + events=(event,), + links=(link,), + kind=trace_api.SpanKind.CLIENT, + ), + trace._Span( + name=span_names[1], context=parent_span_context, parent=None + ), + trace._Span( + name=span_names[2], context=other_context, parent=None + ), + ] + + otel_spans[0].start(start_time=start_times[0]) + # added here to preserve order + otel_spans[0].set_attribute("key_bool", False) + otel_spans[0].set_attribute("key_string", "hello_world") + otel_spans[0].set_attribute("key_float", 111.22) + otel_spans[0].set_attribute("key_tuple", ("tuple_element",)) + otel_spans[0].resource = Resource( + attributes={"key_resource": "some_resource"} + ) + otel_spans[0].set_status( + Status(StatusCode.ERROR, "Example description") + ) + otel_spans[0].end(end_time=end_times[0]) + + otel_spans[1].start(start_time=start_times[1]) + otel_spans[1].resource = Resource({}) + otel_spans[1].end(end_time=end_times[1]) + + otel_spans[2].start(start_time=start_times[2]) + otel_spans[2].resource = Resource({}) + otel_spans[2].set_status(Status(StatusCode.OK, "Example description")) + otel_spans[2].end(end_time=end_times[2]) + otel_spans[2].instrumentation_info = InstrumentationInfo( + name="name", version="version" + ) + + # pylint: disable=protected-access + spans = translate.protobuf._to_jaeger(otel_spans) + + span1_start_time = Timestamp( + seconds=translate._nsec_to_sec_round(start_times[0]), + nanos=start_times[0], + ) + span2_start_time = Timestamp( + seconds=translate._nsec_to_sec_round(start_times[1]), + nanos=start_times[1], + ) + span3_start_time = Timestamp( + seconds=translate._nsec_to_sec_round(start_times[2]), + nanos=start_times[2], + ) + + span1_end_time = Timestamp( + seconds=translate._nsec_to_sec_round(end_times[0]), + nanos=end_times[0], + ) + span2_end_time = Timestamp( + seconds=translate._nsec_to_sec_round(end_times[1]), + nanos=end_times[1], + ) + span3_end_time = Timestamp( + seconds=translate._nsec_to_sec_round(end_times[2]), + nanos=end_times[2], + ) + + span1_duration = translate.protobuf._duration_from_two_time_stamps( + span1_start_time, span1_end_time + ) + span2_duration = translate.protobuf._duration_from_two_time_stamps( + span2_start_time, span2_end_time + ) + span3_duration = translate.protobuf._duration_from_two_time_stamps( + span3_start_time, span3_end_time + ) + + expected_spans = [ + model_pb2.Span( + operation_name=span_names[0], + trace_id=translate._int_to_bytes(trace_id), + span_id=translate._int_to_bytes(span_id), + start_time=span1_start_time, + duration=span1_duration, + flags=0, + tags=[ + model_pb2.KeyValue( + key="key_bool", + v_type=model_pb2.ValueType.BOOL, + v_bool=False, + ), + model_pb2.KeyValue( + key="key_string", + v_type=model_pb2.ValueType.STRING, + v_str="hello_world", + ), + model_pb2.KeyValue( + key="key_float", + v_type=model_pb2.ValueType.FLOAT64, + v_float64=111.22, + ), + model_pb2.KeyValue( + key="key_tuple", + v_type=model_pb2.ValueType.STRING, + v_str="('tuple_element',)", + ), + model_pb2.KeyValue( + key="key_resource", + v_type=model_pb2.ValueType.STRING, + v_str="some_resource", + ), + model_pb2.KeyValue( + key="status.code", + v_type=model_pb2.ValueType.INT64, + v_int64=StatusCode.ERROR.value, + ), + model_pb2.KeyValue( + key="status.message", + v_type=model_pb2.ValueType.STRING, + v_str="Example description", + ), + model_pb2.KeyValue( + key="span.kind", + v_type=model_pb2.ValueType.STRING, + v_str="client", + ), + model_pb2.KeyValue( + key="error", + v_type=model_pb2.ValueType.BOOL, + v_bool=True, + ), + ], + references=[ + model_pb2.SpanRef( + ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, + trace_id=translate._int_to_bytes(trace_id), + span_id=translate._int_to_bytes(other_id), + ) + ], + logs=[ + model_pb2.Log( + timestamp=event_timestamp_proto, + fields=[ + model_pb2.KeyValue( + key="annotation_bool", + v_type=model_pb2.ValueType.BOOL, + v_bool=True, + ), + model_pb2.KeyValue( + key="annotation_string", + v_type=model_pb2.ValueType.STRING, + v_str="annotation_test", + ), + model_pb2.KeyValue( + key="key_float", + v_type=model_pb2.ValueType.FLOAT64, + v_float64=0.3, + ), + model_pb2.KeyValue( + key="message", + v_type=model_pb2.ValueType.STRING, + v_str="event0", + ), + ], + ) + ], + ), + model_pb2.Span( + operation_name=span_names[1], + trace_id=translate._int_to_bytes(trace_id), + span_id=translate._int_to_bytes(parent_id), + start_time=span2_start_time, + duration=span2_duration, + flags=0, + tags=default_tags, + ), + model_pb2.Span( + operation_name=span_names[2], + trace_id=translate._int_to_bytes(trace_id), + span_id=translate._int_to_bytes(other_id), + start_time=span3_start_time, + duration=span3_duration, + flags=0, + tags=[ + model_pb2.KeyValue( + key="status.code", + v_type=model_pb2.ValueType.INT64, + v_int64=StatusCode.OK.value, + ), + model_pb2.KeyValue( + key="status.message", + v_type=model_pb2.ValueType.STRING, + v_str="Example description", + ), + model_pb2.KeyValue( + key="span.kind", + v_type=model_pb2.ValueType.STRING, + v_str="internal", + ), + model_pb2.KeyValue( + key="otel.instrumentation_library.name", + v_type=model_pb2.ValueType.STRING, + v_str="name", + ), + model_pb2.KeyValue( + key="otel.instrumentation_library.version", + v_type=model_pb2.ValueType.STRING, + v_str="version", + ), + ], + ), + ] + + # events are complicated to compare because order of fields + # (attributes) in otel is not important but in jeager it is + self.assertCountEqual( + spans[0].logs[0].fields, expected_spans[0].logs[0].fields + ) + + self.assertEqual(spans, expected_spans) From 84533a645f8d4617c31be1f1346a240b97081245 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 12 Dec 2020 20:45:33 +0530 Subject: [PATCH 09/41] WIP --- .../opentelemetry/exporter/jaeger/__init__.py | 25 ++++++------- .../exporter/jaeger/translate/__init__.py | 4 +++ .../exporter/jaeger/translate/protobuf.py | 12 +++++-- .../src/opentelemetry/exporter/jaeger/util.py | 36 +++++++++++++++++++ 4 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index e22d0974139..010bfae1591 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -58,6 +58,7 @@ .. _Jaeger: https://www.jaegertracing.io/ .. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/ """ +# pylint: disable=protected-access import base64 import logging @@ -74,6 +75,7 @@ from thrift.transport import THttpClient, TTransport import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 +import opentelemetry.exporter.jaeger.util as util from opentelemetry.configuration import Configuration from opentelemetry.exporter.jaeger.gen.agent import Agent as agent from opentelemetry.exporter.jaeger.gen.collector_pb2 import PostSpansRequest @@ -106,7 +108,8 @@ class JaegerSpanExporter(SpanExporter): when query for spans. agent_host_name: The host name of the Jaeger-Agent. agent_port: The port of the Jaeger-Agent. - collector_endpoint: The endpoint of the Jaeger-Collector HTTP/HTTPS Thrift. + collector_endpoint: The endpoint of the Jaeger-Collector + Thrift over HTTP/HTTPS or Protobuf via gRPC. username: The user name of the Basic Auth if authentication is required. password: The password of the Basic Auth if authentication is @@ -160,9 +163,9 @@ def __init__( ) self._collector = None self._grpc_client = None - self.insecure = insecure - self.credentials = credentials - self.transport_format = transport_format + self.insecure = util._get_insecure(insecure) + self.credentials = util._get_credentials(credentials) + self.transport_format = transport_format or TRANSPORT_FORMAT_THRIFT @property def agent_client(self) -> AgentClientUDP: @@ -183,11 +186,8 @@ def grpc_client(self) -> Optional[CollectorServiceStub]: insecure_channel(self.collector_endpoint) ) else: - creds = self.credentials - if creds is None: - creds = ssl_channel_credentials() self._grpc_client = CollectorServiceStub( - secure_channel(self.collector_endpoint, creds) + secure_channel(self.collector_endpoint, self.credentials) ) return self._grpc_client @@ -208,12 +208,13 @@ def collector(self) -> Optional[Collector]: ) return self._collector - def export(self, spans): + def export(self, spans) -> SpanExportResult: if self.transport_format == TRANSPORT_FORMAT_PROTOBUF: - spans = protobuf._to_jaeger(spans) - batch = model_pb2.Batch(spans) + jaeger_spans = protobuf._to_jaeger(spans) + batch = model_pb2.Batch(spans=jaeger_spans) request = PostSpansRequest(batch=batch) - self._grpc_client.PostSpans(request) + if self.grpc_client is not None: + self.grpc_client.PostSpans(request) else: jaeger_spans = thrift._to_jaeger(spans) batch = jaeger.Batch( diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py index f0f42094da7..1991a825de0 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py @@ -28,6 +28,10 @@ def _nsec_to_sec_round(nsec: int) -> int: return (nsec + 500) // 10 ** 9 +def _nsec_to_nanos(nsec: int) -> int: + return int(nsec - _nsec_to_sec_round(nsec) * 1e9) + + def _convert_int_to_i64(val): """Convert integer to signed int64 (i64)""" if val > 0x7FFFFFFFFFFFFFFF: diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 4f6803447a1..a74d7499e6f 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -8,6 +8,7 @@ OTLP_JAEGER_SPAN_KIND, VERSION_KEY, _nsec_to_sec_round, + _nsec_to_nanos, _int_to_bytes, ) from opentelemetry.sdk.trace import Span @@ -164,7 +165,8 @@ def _extract_logs(span: Span) -> Optional[Sequence[model_pb2.Log]]: ) ) event_ts = Timestamp( - seconds=_nsec_to_sec_round(event.timestamp), nanos=event.timestamp + seconds=_nsec_to_sec_round(event.timestamp), + nanos=_nsec_to_nanos(event.timestamp), ) logs.append(model_pb2.Log(timestamp=event_ts, fields=fields)) @@ -202,10 +204,12 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: span_id = ctx.span_id start_time = Timestamp( - seconds=_nsec_to_sec_round(span.start_time), nanos=span.start_time + seconds=_nsec_to_sec_round(span.start_time), + nanos=_nsec_to_nanos(span.start_time), ) end_time = Timestamp( - seconds=_nsec_to_sec_round(span.end_time), nanos=span.end_time + seconds=_nsec_to_sec_round(span.end_time), + nanos=_nsec_to_nanos(span.end_time), ) duration = _duration_from_two_time_stamps(start_time, end_time) @@ -215,6 +219,7 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: flags = int(ctx.trace_flags) + # process = model_pb2.Process(service_name=svc_name) jaeger_span = model_pb2.Span( trace_id=_int_to_bytes(trace_id), span_id=_int_to_bytes(span_id), @@ -225,6 +230,7 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: duration=duration, tags=tags, logs=logs, + # process=process, ) jaeger_spans.append(jaeger_span) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py new file mode 100644 index 00000000000..4bfea04f0f6 --- /dev/null +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py @@ -0,0 +1,36 @@ +import logging + +from grpc import ssl_channel_credentials, ChannelCredentials +from opentelemetry.configuration import Configuration + +logger = logging.getLogger(__name__) + +DEFAULT_INSECURE = False + + +def _get_insecure(param): + if param is not None: + return param + insecure_env = Configuration().get("EXPORTER_JAEGER_INSECURE", None) + if insecure_env is not None: + return insecure_env.lower() == "true" + return DEFAULT_INSECURE + + +def _load_credential_from_file(path) -> ChannelCredentials: + try: + with open(path, "rb") as f: + credential = f.read() + return ssl_channel_credentials(credential) + except FileNotFoundError: + logger.exception("Failed to read credential file") + return None + + +def _get_credentials(param): + if param is not None: + return param + creds_env = Configuration().get("EXPORTER_JAEGER_CERTIFICATE", None) + if creds_env: + return _load_credential_from_file(creds_env) + return ssl_channel_credentials() From 47570ffec98085d13090e5b154629d59cfa50e97 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 12 Dec 2020 22:55:17 +0530 Subject: [PATCH 10/41] Fix translation bugs --- .../opentelemetry/exporter/jaeger/__init__.py | 2 +- .../exporter/jaeger/send/protobuf.py | 0 .../exporter/jaeger/translate/__init__.py | 13 --- .../exporter/jaeger/translate/protobuf.py | 103 +++++++++++------- 4 files changed, 62 insertions(+), 56 deletions(-) delete mode 100644 exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/protobuf.py diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 010bfae1591..23a4036fe08 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -210,7 +210,7 @@ def collector(self) -> Optional[Collector]: def export(self, spans) -> SpanExportResult: if self.transport_format == TRANSPORT_FORMAT_PROTOBUF: - jaeger_spans = protobuf._to_jaeger(spans) + jaeger_spans = protobuf._to_jaeger(spans, self.service_name) batch = model_pb2.Batch(spans=jaeger_spans) request = PostSpansRequest(batch=batch) if self.grpc_client is not None: diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/protobuf.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py index 1991a825de0..516074b11a6 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py @@ -23,21 +23,8 @@ def _nsec_to_usec_round(nsec: int) -> int: return (nsec + 500) // 10 ** 3 -def _nsec_to_sec_round(nsec: int) -> int: - """Round nanoseconds to seconds""" - return (nsec + 500) // 10 ** 9 - - -def _nsec_to_nanos(nsec: int) -> int: - return int(nsec - _nsec_to_sec_round(nsec) * 1e9) - - def _convert_int_to_i64(val): """Convert integer to signed int64 (i64)""" if val > 0x7FFFFFFFFFFFFFFF: val -= 0x10000000000000000 return val - - -def _int_to_bytes(val: int) -> bytes: - return val.to_bytes((val.bit_length() + 7) // 8, "big") diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index a74d7499e6f..025201ac97e 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -1,20 +1,18 @@ from typing import Optional, Sequence -import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 -from google.protobuf.timestamp_pb2 import Timestamp from google.protobuf.duration_pb2 import Duration +from google.protobuf.timestamp_pb2 import Timestamp + +import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 from opentelemetry.exporter.jaeger.translate import ( NAME_KEY, OTLP_JAEGER_SPAN_KIND, VERSION_KEY, - _nsec_to_sec_round, - _nsec_to_nanos, - _int_to_bytes, ) from opentelemetry.sdk.trace import Span from opentelemetry.util import types -# pylint: disable=no-member +# pylint: disable=no-member,too-many-locals def _get_string_key_value( @@ -53,9 +51,7 @@ def _get_double_key_value( ) -def _get_binary_key_value( - key: str, value: types.AttributeValue -) -> model_pb2.KeyValue: +def _get_binary_key_value(key: str, value: bytes) -> model_pb2.KeyValue: """Returns jaeger double KeyValue.""" return model_pb2.KeyValue( key=key, v_binary=value, v_type=model_pb2.ValueType.BINARY @@ -66,21 +62,24 @@ def _translate_attribute( key: str, value: types.AttributeValue ) -> Optional[model_pb2.KeyValue]: """Convert the attributes to jaeger keyvalues.""" + translated = None if isinstance(value, bool): - return _get_bool_key_value(key, value) - if isinstance(value, str): - return _get_string_key_value(key, value) - if isinstance(value, int): - return _get_long_key_value(key, value) - if isinstance(value, float): - return _get_double_key_value(key, value) - if isinstance(value, tuple): - return _get_string_key_value(key, str(value)) - return None + translated = _get_bool_key_value(key, value) + elif isinstance(value, str): + translated = _get_string_key_value(key, value) + elif isinstance(value, int): + translated = _get_long_key_value(key, value) + elif isinstance(value, float): + translated = _get_double_key_value(key, value) + elif isinstance(value, bytes): + translated = _get_binary_key_value(key, value) + elif isinstance(value, tuple): + translated = _get_string_key_value(key, str(value)) + return translated def _extract_key_values(span: Span) -> Sequence[model_pb2.KeyValue]: - """Extracts keyvalues from span and returns list of jaeger keyvalues. + """Extracts attributes from span and returns list of jaeger keyvalues. Args: span: span to extract keyvalues @@ -133,8 +132,8 @@ def _extract_refs(span: Span) -> Optional[Sequence[model_pb2.SpanRef]]: refs.append( model_pb2.SpanRef( ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, - trace_id=_int_to_bytes(trace_id), - span_id=_int_to_bytes(span_id), + trace_id=trace_id.to_bytes(16, "big"), + span_id=span_id.to_bytes(8, "big"), ) ) return refs @@ -164,16 +163,27 @@ def _extract_logs(span: Span) -> Optional[Sequence[model_pb2.Log]]: v_str=event.name, ) ) - event_ts = Timestamp( - seconds=_nsec_to_sec_round(event.timestamp), - nanos=_nsec_to_nanos(event.timestamp), - ) - + event_ts = _proto_timestamp_from_epoch_nanos(event.timestamp) logs.append(model_pb2.Log(timestamp=event_ts, fields=fields)) return logs +def _extract_resource_tags(span: Span) -> Sequence[model_pb2.KeyValue]: + """Extracts resource attributes from span and returns + list of jaeger keyvalues. + + Args: + span: span to extract keyvalues + """ + tags = [] + for key, value in span.resource.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + tags.append(tag) + return tags + + def _duration_from_two_time_stamps( start: Timestamp, end: Timestamp ) -> Duration: @@ -190,7 +200,19 @@ def _duration_from_two_time_stamps( return duration -def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: +def _proto_timestamp_from_epoch_nanos(nsec: int) -> Timestamp: + """Create a Timestamp from the number of nanoseconds + elapsed from the epoch. + """ + nsec_time = nsec / 1e9 + seconds = int(nsec_time) + nanos = int((nsec_time - seconds) * 1e9) + return Timestamp(seconds=seconds, nanos=nanos) + + +def _to_jaeger( + spans: Sequence[Span], svc_name: str +) -> Sequence[model_pb2.Span]: """Translate the spans to Jaeger format. Args: @@ -200,17 +222,12 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: for span in spans: ctx = span.get_span_context() - trace_id = ctx.trace_id - span_id = ctx.span_id + # pb2 span expects in byte format + trace_id = ctx.trace_id.to_bytes(16, "big") + span_id = ctx.span_id.to_bytes(8, "big") - start_time = Timestamp( - seconds=_nsec_to_sec_round(span.start_time), - nanos=_nsec_to_nanos(span.start_time), - ) - end_time = Timestamp( - seconds=_nsec_to_sec_round(span.end_time), - nanos=_nsec_to_nanos(span.end_time), - ) + start_time = _proto_timestamp_from_epoch_nanos(span.start_time) + end_time = _proto_timestamp_from_epoch_nanos(span.end_time) duration = _duration_from_two_time_stamps(start_time, end_time) tags = _extract_key_values(span) @@ -219,10 +236,12 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: flags = int(ctx.trace_flags) - # process = model_pb2.Process(service_name=svc_name) + process = model_pb2.Process( + service_name=svc_name, tags=_extract_resource_tags(span) + ) jaeger_span = model_pb2.Span( - trace_id=_int_to_bytes(trace_id), - span_id=_int_to_bytes(span_id), + trace_id=trace_id, + span_id=span_id, operation_name=span.name, references=refs, flags=flags, @@ -230,7 +249,7 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[model_pb2.Span]: duration=duration, tags=tags, logs=logs, - # process=process, + process=process, ) jaeger_spans.append(jaeger_span) From 3dc0ede9d45be76073e94b32747e08cbadcfcab5 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 12 Dec 2020 23:31:03 +0530 Subject: [PATCH 11/41] Add function for trace_id and span_id to bytes --- .../exporter/jaeger/translate/protobuf.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 025201ac97e..93e77b8504d 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -15,6 +15,16 @@ # pylint: disable=no-member,too-many-locals +def _trace_id_to_bytes(trace_id: int) -> bytes: + """Returns bytes representation of trace id.""" + return trace_id.to_bytes(16, "big") + + +def _span_id_to_bytes(span_id: int) -> bytes: + """Returns bytes representation of span id""" + return span_id.to_bytes(8, "big") + + def _get_string_key_value( key, value: types.AttributeValue ) -> model_pb2.KeyValue: @@ -132,8 +142,8 @@ def _extract_refs(span: Span) -> Optional[Sequence[model_pb2.SpanRef]]: refs.append( model_pb2.SpanRef( ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, - trace_id=trace_id.to_bytes(16, "big"), - span_id=span_id.to_bytes(8, "big"), + trace_id=_trace_id_to_bytes(trace_id), + span_id=_span_id_to_bytes(span_id), ) ) return refs @@ -223,8 +233,8 @@ def _to_jaeger( for span in spans: ctx = span.get_span_context() # pb2 span expects in byte format - trace_id = ctx.trace_id.to_bytes(16, "big") - span_id = ctx.span_id.to_bytes(8, "big") + trace_id = _trace_id_to_bytes(ctx.trace_id) + span_id = _span_id_to_bytes(ctx.span_id) start_time = _proto_timestamp_from_epoch_nanos(span.start_time) end_time = _proto_timestamp_from_epoch_nanos(span.end_time) From ff506a8a8c2ea37f82e50f645c38a5b380a64238 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 12 Dec 2020 23:31:18 +0530 Subject: [PATCH 12/41] Fix tests --- .../tests/test_jarget_exporter_protobuf.py | 72 ++++++++++--------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 395e01f321a..29e473230f4 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -30,7 +30,7 @@ from opentelemetry.trace import SpanKind from opentelemetry.trace.status import Status, StatusCode - +# pylint:disable=protected-access class TestJaegerSpanExporter(unittest.TestCase): def setUp(self): # create and save span to be used in tests @@ -64,7 +64,7 @@ def test_all_otlp_span_kinds_are_mapped(self): kind, jaeger_exporter.translate.OTLP_JAEGER_SPAN_KIND ) - # pylint: disable=too-many-locals + # pylint: disable=too-many-locals,protected-access def test_translate_to_jaeger(self): # pylint: disable=invalid-name self.maxDiff = None @@ -105,10 +105,10 @@ def test_translate_to_jaeger(self): } event_timestamp = base_time + 50 * 10 ** 6 - event_timestamp_proto = Timestamp( - seconds=translate._nsec_to_sec_round(event_timestamp), - nanos=event_timestamp, + event_timestamp_proto = translate.protobuf._proto_timestamp_from_epoch_nanos( + event_timestamp ) + event = trace.Event( name="event0", timestamp=event_timestamp, @@ -183,32 +183,26 @@ def test_translate_to_jaeger(self): ) # pylint: disable=protected-access - spans = translate.protobuf._to_jaeger(otel_spans) + spans = translate.protobuf._to_jaeger(otel_spans, "svc") - span1_start_time = Timestamp( - seconds=translate._nsec_to_sec_round(start_times[0]), - nanos=start_times[0], + span1_start_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + start_times[0] ) - span2_start_time = Timestamp( - seconds=translate._nsec_to_sec_round(start_times[1]), - nanos=start_times[1], + span2_start_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + start_times[1] ) - span3_start_time = Timestamp( - seconds=translate._nsec_to_sec_round(start_times[2]), - nanos=start_times[2], + span3_start_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + start_times[2] ) - span1_end_time = Timestamp( - seconds=translate._nsec_to_sec_round(end_times[0]), - nanos=end_times[0], + span1_end_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + end_times[0] ) - span2_end_time = Timestamp( - seconds=translate._nsec_to_sec_round(end_times[1]), - nanos=end_times[1], + span2_end_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + end_times[1] ) - span3_end_time = Timestamp( - seconds=translate._nsec_to_sec_round(end_times[2]), - nanos=end_times[2], + span3_end_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + end_times[2] ) span1_duration = translate.protobuf._duration_from_two_time_stamps( @@ -224,8 +218,8 @@ def test_translate_to_jaeger(self): expected_spans = [ model_pb2.Span( operation_name=span_names[0], - trace_id=translate._int_to_bytes(trace_id), - span_id=translate._int_to_bytes(span_id), + trace_id=translate.protobuf._trace_id_to_bytes(trace_id), + span_id=translate.protobuf._span_id_to_bytes(span_id), start_time=span1_start_time, duration=span1_duration, flags=0, @@ -279,8 +273,10 @@ def test_translate_to_jaeger(self): references=[ model_pb2.SpanRef( ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, - trace_id=translate._int_to_bytes(trace_id), - span_id=translate._int_to_bytes(other_id), + trace_id=translate.protobuf._trace_id_to_bytes( + trace_id + ), + span_id=translate.protobuf._span_id_to_bytes(other_id), ) ], logs=[ @@ -310,20 +306,31 @@ def test_translate_to_jaeger(self): ], ) ], + process=model_pb2.Process( + service_name="svc", + tags=[ + model_pb2.KeyValue( + key="key_resource", + v_str="some_resource", + v_type=model_pb2.ValueType.STRING, + ) + ], + ), ), model_pb2.Span( operation_name=span_names[1], - trace_id=translate._int_to_bytes(trace_id), - span_id=translate._int_to_bytes(parent_id), + trace_id=translate.protobuf._trace_id_to_bytes(trace_id), + span_id=translate.protobuf._span_id_to_bytes(parent_id), start_time=span2_start_time, duration=span2_duration, flags=0, tags=default_tags, + process=model_pb2.Process(service_name="svc",), ), model_pb2.Span( operation_name=span_names[2], - trace_id=translate._int_to_bytes(trace_id), - span_id=translate._int_to_bytes(other_id), + trace_id=translate.protobuf._trace_id_to_bytes(trace_id), + span_id=translate.protobuf._span_id_to_bytes(other_id), start_time=span3_start_time, duration=span3_duration, flags=0, @@ -354,6 +361,7 @@ def test_translate_to_jaeger(self): v_str="version", ), ], + process=model_pb2.Process(service_name="svc",), ), ] From cfef392740b5eb0670f37b6c986c310d9776da63 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 10:54:49 +0530 Subject: [PATCH 13/41] Update documentation --- .../opentelemetry/exporter/jaeger/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 23a4036fe08..b59ac2f096a 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -15,9 +15,11 @@ """ The **OpenTelemetry Jaeger Exporter** allows to export `OpenTelemetry`_ traces to `Jaeger`_. -This exporter always send traces to the configured agent using Thrift compact protocol over UDP. -An optional collector can be configured, in this case Thrift binary protocol over HTTP is used. -gRPC is still not supported by this implementation. +This exporter always sends traces to the configured agent using Thrift compact protocol over UDP. +When it is not feasible to deploy Jaeger Agent next to the application, for example, when the +application code is running as Lambda function, A collector can be configured to send spans +with either Thrift over UDP or Protobuf via gRPC. If both agent and collector are configured, +exporter sends traces only to collector to eliminate the duplicate entries. Usage ----- @@ -42,6 +44,9 @@ # collector_endpoint='http://localhost:14268/api/traces?format=jaeger.thrift', # username=xxxx, # optional # password=xxxx, # optional + # insecure=xxxx, # optional + # credentials=xxxx # optional + # transport_format=xxxx # optional ) # Create a BatchExportSpanProcessor and add the exporter to it @@ -114,8 +119,9 @@ class JaegerSpanExporter(SpanExporter): required. password: The password of the Basic Auth if authentication is required. - insecure: Connection type - credentials: Credentials for server authentication + insecure: Connection type. + credentials: Credentials for server authentication. + transport_format: Transport format for exporting spans to collector. """ def __init__( From b435a12dfafac02d190d4cd37dd5b414569ecb46 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 11:10:49 +0530 Subject: [PATCH 14/41] Remove unused imports --- .../src/opentelemetry/exporter/jaeger/translate/__init__.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py index 516074b11a6..85fd67264ba 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py @@ -1,10 +1,4 @@ -from abc import ABC, abstractmethod -from typing import Any, Sequence, Union, Optional - -from opentelemetry.exporter.jaeger.gen.jaeger import Collector as TCollector -from opentelemetry.sdk.trace import Span from opentelemetry.trace import SpanKind -from opentelemetry.util import types OTLP_JAEGER_SPAN_KIND = { SpanKind.CLIENT: "client", From 58497bf56467ab516ea4336d71d1ec789c721a6a Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 11:11:09 +0530 Subject: [PATCH 15/41] Update translations --- .../exporter/jaeger/translate/protobuf.py | 36 +++++++------------ .../exporter/jaeger/translate/thrift.py | 8 ++--- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 93e77b8504d..9d9f78f3511 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -25,36 +25,28 @@ def _span_id_to_bytes(span_id: int) -> bytes: return span_id.to_bytes(8, "big") -def _get_string_key_value( - key, value: types.AttributeValue -) -> model_pb2.KeyValue: +def _get_string_key_value(key, value: str) -> model_pb2.KeyValue: """Returns jaeger string KeyValue.""" return model_pb2.KeyValue( key=key, v_str=value, v_type=model_pb2.ValueType.STRING ) -def _get_bool_key_value( - key: str, value: types.AttributeValue -) -> model_pb2.KeyValue: +def _get_bool_key_value(key: str, value: bool) -> model_pb2.KeyValue: """Returns jaeger boolean KeyValue.""" return model_pb2.KeyValue( key=key, v_bool=value, v_type=model_pb2.ValueType.BOOL ) -def _get_long_key_value( - key: str, value: types.AttributeValue -) -> model_pb2.KeyValue: +def _get_long_key_value(key: str, value: int) -> model_pb2.KeyValue: """Returns jaeger long KeyValue.""" return model_pb2.KeyValue( key=key, v_int64=value, v_type=model_pb2.ValueType.INT64 ) -def _get_double_key_value( - key: str, value: types.AttributeValue -) -> model_pb2.KeyValue: +def _get_double_key_value(key: str, value: float) -> model_pb2.KeyValue: """Returns jaeger double KeyValue.""" return model_pb2.KeyValue( key=key, v_float64=value, v_type=model_pb2.ValueType.FLOAT64 @@ -81,8 +73,6 @@ def _translate_attribute( translated = _get_long_key_value(key, value) elif isinstance(value, float): translated = _get_double_key_value(key, value) - elif isinstance(value, bytes): - translated = _get_binary_key_value(key, value) elif isinstance(value, tuple): translated = _get_string_key_value(key, str(value)) return translated @@ -166,13 +156,7 @@ def _extract_logs(span: Span) -> Optional[Sequence[model_pb2.Log]]: if tag: fields.append(tag) - fields.append( - model_pb2.KeyValue( - key="message", - v_type=model_pb2.ValueType.STRING, - v_str=event.name, - ) - ) + fields.append(_get_string_key_value(key="message", value=event.name,)) event_ts = _proto_timestamp_from_epoch_nanos(event.timestamp) logs.append(model_pb2.Log(timestamp=event_ts, fields=fields)) @@ -197,7 +181,10 @@ def _extract_resource_tags(span: Span) -> Sequence[model_pb2.KeyValue]: def _duration_from_two_time_stamps( start: Timestamp, end: Timestamp ) -> Duration: - """Compute Duration from two Timestamps.""" + """Compute Duration from two Timestamps. + + See https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration + """ duration = Duration( seconds=end.seconds - start.seconds, nanos=end.nanos - start.nanos, ) @@ -211,8 +198,9 @@ def _duration_from_two_time_stamps( def _proto_timestamp_from_epoch_nanos(nsec: int) -> Timestamp: - """Create a Timestamp from the number of nanoseconds - elapsed from the epoch. + """Create a Timestamp from the number of nanoseconds elapsed from the epoch. + + See https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp """ nsec_time = nsec / 1e9 seconds = int(nsec_time) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py index c9378a8217b..ac02c851426 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py @@ -12,22 +12,22 @@ from opentelemetry.util import types -def _get_string_tag(key, value: types.AttributeValue) -> TCollector.Tag: +def _get_string_tag(key, value: str) -> TCollector.Tag: """Returns jaeger string tag.""" return TCollector.Tag(key=key, vStr=value, vType=TCollector.TagType.STRING) -def _get_bool_tag(key: str, value: types.AttributeValue) -> TCollector.Tag: +def _get_bool_tag(key: str, value: bool) -> TCollector.Tag: """Returns jaeger boolean tag.""" return TCollector.Tag(key=key, vBool=value, vType=TCollector.TagType.BOOL) -def _get_long_tag(key: str, value: types.AttributeValue) -> TCollector.Tag: +def _get_long_tag(key: str, value: int) -> TCollector.Tag: """Returns jaeger long tag.""" return TCollector.Tag(key=key, vLong=value, vType=TCollector.TagType.LONG) -def _get_double_tag(key: str, value: types.AttributeValue) -> TCollector.Tag: +def _get_double_tag(key: str, value: float) -> TCollector.Tag: """Returns jaeger double tag.""" return TCollector.Tag( key=key, vDouble=value, vType=TCollector.TagType.DOUBLE From 07771eba7ef8e7ef782954c2acfb5699134da18c Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 11:29:50 +0530 Subject: [PATCH 16/41] Add gRPC example --- .../examples/jaeger_exporter_example.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py index 0552f75183b..d1d1faf87c8 100644 --- a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py +++ b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py @@ -22,6 +22,14 @@ # password=xxxx, # optional ) +# JaegerSpanExporter with gRPC +# jaeger_exporter = jaeger.JaegerSpanExporter( +# service_name="my-helloworld-service", +# collector_endpoint="localhost:14250", +# insecure=True, +# transport_format="protobuf" +# ) + # create a BatchExportSpanProcessor and add the exporter to it span_processor = BatchExportSpanProcessor(jaeger_exporter) From ec310ac10eb97e9ba441dcda8e17d55b184d5fb4 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 12:06:12 +0530 Subject: [PATCH 17/41] Fix tests --- .../opentelemetry/exporter/jaeger/__init__.py | 6 +++--- .../tests/test_jarget_exporter_protobuf.py | 17 +---------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index b59ac2f096a..dcc2f2a39c2 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -87,7 +87,7 @@ from opentelemetry.exporter.jaeger.gen.collector_pb2_grpc import ( CollectorServiceStub, ) -from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger +from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger_thrift from opentelemetry.exporter.jaeger.send.thrift import AgentClientUDP, Collector from opentelemetry.exporter.jaeger.translate import thrift, protobuf from opentelemetry.sdk.trace.export import Span, SpanExporter, SpanExportResult @@ -223,9 +223,9 @@ def export(self, spans) -> SpanExportResult: self.grpc_client.PostSpans(request) else: jaeger_spans = thrift._to_jaeger(spans) - batch = jaeger.Batch( + batch = jaeger_thrift.Batch( spans=jaeger_spans, - process=jaeger.Process(serviceName=self.service_name), + process=jaeger_thrift.Process(serviceName=self.service_name), ) if self.collector is not None: self.collector.submit(batch) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 29e473230f4..da683a520c1 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -1,4 +1,3 @@ -# Copyright 2018, OpenCensus Authors # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,20 +49,6 @@ def tearDown(self): # pylint: disable=protected-access Configuration._reset() - def test_nsec_to_usec_round(self): - # pylint: disable=protected-access - nsec_to_usec_round = jaeger_exporter.translate._nsec_to_usec_round - - self.assertEqual(nsec_to_usec_round(5000), 5) - self.assertEqual(nsec_to_usec_round(5499), 5) - self.assertEqual(nsec_to_usec_round(5500), 6) - - def test_all_otlp_span_kinds_are_mapped(self): - for kind in SpanKind: - self.assertIn( - kind, jaeger_exporter.translate.OTLP_JAEGER_SPAN_KIND - ) - # pylint: disable=too-many-locals,protected-access def test_translate_to_jaeger(self): # pylint: disable=invalid-name @@ -75,7 +60,7 @@ def test_translate_to_jaeger(self): parent_id = 0x1111111111111111 other_id = 0x2222222222222222 - base_time = int(0.683647322 * (10 ** 9)) # in ns + base_time = 683647322 * 10 ** 9 # in ns start_times = ( base_time, base_time + 150 * 10 ** 6, From 8e98f5af42fc756109a42fcbf81e824609be1413 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 12:18:38 +0530 Subject: [PATCH 18/41] Fix <= p36 tests --- .../src/opentelemetry/exporter/jaeger/__init__.py | 4 ++-- .../src/opentelemetry/exporter/jaeger/translate/protobuf.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index dcc2f2a39c2..e90088b5b59 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -79,8 +79,8 @@ from thrift.protocol import TBinaryProtocol, TCompactProtocol from thrift.transport import THttpClient, TTransport -import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 -import opentelemetry.exporter.jaeger.util as util +from opentelemetry.exporter.jaeger.gen import model_pb2 +from opentelemetry.exporter.jaeger import util from opentelemetry.configuration import Configuration from opentelemetry.exporter.jaeger.gen.agent import Agent as agent from opentelemetry.exporter.jaeger.gen.collector_pb2 import PostSpansRequest diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 9d9f78f3511..30221f17ed0 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -3,7 +3,7 @@ from google.protobuf.duration_pb2 import Duration from google.protobuf.timestamp_pb2 import Timestamp -import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 +from opentelemetry.exporter.jaeger.gen import model_pb2 from opentelemetry.exporter.jaeger.translate import ( NAME_KEY, OTLP_JAEGER_SPAN_KIND, From b091816b10f0f6b7d8227c521e12c8abeb550b9c Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 12:55:54 +0530 Subject: [PATCH 19/41] Remove fields as order fails the test --- .../tests/test_jarget_exporter_protobuf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index da683a520c1..7b543afb5ac 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -356,4 +356,8 @@ def test_translate_to_jaeger(self): spans[0].logs[0].fields, expected_spans[0].logs[0].fields ) + # get rid of fields to be able to compare the whole spans + spans[0].logs[0].fields = None + expected_spans[0].logs[0].fields = None + self.assertEqual(spans, expected_spans) From cc9cf7f23c33c0cd10c84384552c083764d21217 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 13:01:46 +0530 Subject: [PATCH 20/41] Remove exporter example --- .../examples/jaeger_exporter_example.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py index d1d1faf87c8..8b8b5e5f302 100644 --- a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py +++ b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py @@ -22,13 +22,6 @@ # password=xxxx, # optional ) -# JaegerSpanExporter with gRPC -# jaeger_exporter = jaeger.JaegerSpanExporter( -# service_name="my-helloworld-service", -# collector_endpoint="localhost:14250", -# insecure=True, -# transport_format="protobuf" -# ) # create a BatchExportSpanProcessor and add the exporter to it span_processor = BatchExportSpanProcessor(jaeger_exporter) From a732ff3e0f66e3d10a52b1c8e8117c0fcb110f9c Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 13:32:52 +0530 Subject: [PATCH 21/41] Lint fixes --- .../src/opentelemetry/exporter/jaeger/__init__.py | 6 +++--- .../src/opentelemetry/exporter/jaeger/send/thrift.py | 5 +++-- .../src/opentelemetry/exporter/jaeger/util.py | 1 + .../tests/test_jarget_exporter_protobuf.py | 11 +++-------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index e90088b5b59..8af14c856e8 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -79,9 +79,9 @@ from thrift.protocol import TBinaryProtocol, TCompactProtocol from thrift.transport import THttpClient, TTransport -from opentelemetry.exporter.jaeger.gen import model_pb2 -from opentelemetry.exporter.jaeger import util from opentelemetry.configuration import Configuration +from opentelemetry.exporter.jaeger import util +from opentelemetry.exporter.jaeger.gen import model_pb2 from opentelemetry.exporter.jaeger.gen.agent import Agent as agent from opentelemetry.exporter.jaeger.gen.collector_pb2 import PostSpansRequest from opentelemetry.exporter.jaeger.gen.collector_pb2_grpc import ( @@ -89,7 +89,7 @@ ) from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger_thrift from opentelemetry.exporter.jaeger.send.thrift import AgentClientUDP, Collector -from opentelemetry.exporter.jaeger.translate import thrift, protobuf +from opentelemetry.exporter.jaeger.translate import protobuf, thrift from opentelemetry.sdk.trace.export import Span, SpanExporter, SpanExportResult from opentelemetry.trace import SpanKind from opentelemetry.trace.status import StatusCode diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py index 45b139b37d3..a0f0616f25e 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py @@ -2,11 +2,12 @@ import logging import socket -from opentelemetry.exporter.jaeger.gen.agent import Agent as agent -from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger from thrift.protocol import TBinaryProtocol, TCompactProtocol from thrift.transport import THttpClient, TTransport +from opentelemetry.exporter.jaeger.gen.agent import Agent as agent +from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger + UDP_PACKET_MAX_LENGTH = 65000 diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py index 4bfea04f0f6..afce62708a8 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py @@ -1,6 +1,7 @@ import logging from grpc import ssl_channel_credentials, ChannelCredentials + from opentelemetry.configuration import Configuration logger = logging.getLogger(__name__) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 7b543afb5ac..8be3a981864 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -14,11 +14,8 @@ import unittest -from google.protobuf.timestamp_pb2 import Timestamp - # pylint:disable=no-name-in-module # pylint:disable=import-error -import opentelemetry.exporter.jaeger as jaeger_exporter import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 import opentelemetry.exporter.jaeger.translate as translate from opentelemetry import trace as trace_api @@ -26,10 +23,9 @@ from opentelemetry.sdk import trace from opentelemetry.sdk.trace import Resource from opentelemetry.sdk.util.instrumentation import InstrumentationInfo -from opentelemetry.trace import SpanKind from opentelemetry.trace.status import Status, StatusCode -# pylint:disable=protected-access + class TestJaegerSpanExporter(unittest.TestCase): def setUp(self): # create and save span to be used in tests @@ -49,10 +45,8 @@ def tearDown(self): # pylint: disable=protected-access Configuration._reset() - # pylint: disable=too-many-locals,protected-access + # pylint: disable=too-many-locals def test_translate_to_jaeger(self): - # pylint: disable=invalid-name - self.maxDiff = None span_names = ("test1", "test2", "test3") trace_id = 0x6E0C63257DE34C926F9EFCD03927272E @@ -90,6 +84,7 @@ def test_translate_to_jaeger(self): } event_timestamp = base_time + 50 * 10 ** 6 + # pylint:disable=protected-access event_timestamp_proto = translate.protobuf._proto_timestamp_from_epoch_nanos( event_timestamp ) From c1907f421d8a8875fb75be404a4b28579738b1a6 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 13:41:47 +0530 Subject: [PATCH 22/41] Fix tests; update doc --- .../examples/jaeger_exporter_example.py | 1 - .../opentelemetry/exporter/jaeger/__init__.py | 2 +- .../tests/test_jarget_exporter_protobuf.py | 17 ++++++++--------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py index 8b8b5e5f302..0552f75183b 100644 --- a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py +++ b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py @@ -22,7 +22,6 @@ # password=xxxx, # optional ) - # create a BatchExportSpanProcessor and add the exporter to it span_processor = BatchExportSpanProcessor(jaeger_exporter) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 8af14c856e8..e235753f778 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -18,7 +18,7 @@ This exporter always sends traces to the configured agent using Thrift compact protocol over UDP. When it is not feasible to deploy Jaeger Agent next to the application, for example, when the application code is running as Lambda function, A collector can be configured to send spans -with either Thrift over UDP or Protobuf via gRPC. If both agent and collector are configured, +with either Thrift over HTTP or Protobuf via gRPC. If both agent and collector are configured, exporter sends traces only to collector to eliminate the duplicate entries. Usage diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 8be3a981864..b4a9cce2a91 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -13,6 +13,7 @@ # limitations under the License. import unittest +from collections import OrderedDict # pylint:disable=no-name-in-module # pylint:disable=import-error @@ -77,11 +78,13 @@ def test_translate_to_jaeger(self): trace_id, other_id, is_remote=False ) - event_attributes = { - "annotation_bool": True, - "annotation_string": "annotation_test", - "key_float": 0.3, - } + event_attributes = OrderedDict( + { + "annotation_bool": True, + "annotation_string": "annotation_test", + "key_float": 0.3, + } + ) event_timestamp = base_time + 50 * 10 ** 6 # pylint:disable=protected-access @@ -351,8 +354,4 @@ def test_translate_to_jaeger(self): spans[0].logs[0].fields, expected_spans[0].logs[0].fields ) - # get rid of fields to be able to compare the whole spans - spans[0].logs[0].fields = None - expected_spans[0].logs[0].fields = None - self.assertEqual(spans, expected_spans) From b730cd225e4ff4a697fd6977ffcc5fb671ab836f Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 13:49:07 +0530 Subject: [PATCH 23/41] Fix py35 test --- .../tests/test_jarget_exporter_protobuf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index b4a9cce2a91..5b2411e40b9 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -79,11 +79,11 @@ def test_translate_to_jaeger(self): ) event_attributes = OrderedDict( - { - "annotation_bool": True, - "annotation_string": "annotation_test", - "key_float": 0.3, - } + [ + ("annotation_bool", True), + ("annotation_string", "annotation_test"), + ("key_float", 0.3), + ] ) event_timestamp = base_time + 50 * 10 ** 6 From a4f655f4d14e7ad37e57db17e885230d25946557 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 13:49:18 +0530 Subject: [PATCH 24/41] Fix lint --- .../src/opentelemetry/exporter/jaeger/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py index afce62708a8..9106a1b31a5 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py @@ -1,6 +1,6 @@ import logging -from grpc import ssl_channel_credentials, ChannelCredentials +from grpc import ChannelCredentials, ssl_channel_credentials from opentelemetry.configuration import Configuration From 76a9a4236e1daf695ab51af05526918086a0b6d7 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 14:20:56 +0530 Subject: [PATCH 25/41] Bump sphinx version --- dev-requirements.txt | 2 +- docs-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 489fc33fcb4..35d8354ad7e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,7 +3,7 @@ flake8~=3.7 isort~=4.3 black>=19.3b0,==19.* mypy==0.770 -sphinx~=2.1 +sphinx~=3.3.1 sphinx-rtd-theme~=0.4 sphinx-autodoc-typehints~=1.10.2 pytest>=6.0 diff --git a/docs-requirements.txt b/docs-requirements.txt index 9a175692051..08f7826612d 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,4 +1,4 @@ -sphinx~=2.4 +sphinx~=3.3.1 sphinx-rtd-theme~=0.4 sphinx-autodoc-typehints~=1.10.2 From a7c78fee737355b27c76b4c2a0d8cd53b5bd5d01 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 14:33:23 +0530 Subject: [PATCH 26/41] Bump typehints version --- dev-requirements.txt | 2 +- docs-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 35d8354ad7e..1c35e5ed460 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,7 +5,7 @@ black>=19.3b0,==19.* mypy==0.770 sphinx~=3.3.1 sphinx-rtd-theme~=0.4 -sphinx-autodoc-typehints~=1.10.2 +sphinx-autodoc-typehints~=1.11.1 pytest>=6.0 pytest-cov>=2.8 readme-renderer~=24.0 diff --git a/docs-requirements.txt b/docs-requirements.txt index 08f7826612d..dd1c047f7c9 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,6 +1,6 @@ sphinx~=3.3.1 sphinx-rtd-theme~=0.4 -sphinx-autodoc-typehints~=1.10.2 +sphinx-autodoc-typehints~=1.11.1 # Need to install the api/sdk in the venv for autodoc. Modifying sys.path # doesn't work for pkg_resources. From 5e51115a8b73ea2c4f9427c9f64cd27c58ac96f4 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 15:20:30 +0530 Subject: [PATCH 27/41] Fix docs build issue --- docs/exporter/jaeger/jaeger.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/exporter/jaeger/jaeger.rst b/docs/exporter/jaeger/jaeger.rst index 6988d8cea9c..efbcfbd7d72 100644 --- a/docs/exporter/jaeger/jaeger.rst +++ b/docs/exporter/jaeger/jaeger.rst @@ -14,3 +14,13 @@ Submodules :members: :undoc-members: :show-inheritance: + +.. automodule:: opentelemetry.exporter.jaeger.send.thrift + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: opentelemetry.exporter.jaeger.gen.collector_pb2_grpc + :members: + :undoc-members: + :show-inheritance: From 647a211570e36ccc1b12b79d3b25f4ba4462e891 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 20:40:29 +0530 Subject: [PATCH 28/41] Final changes --- dev-requirements.txt | 2 +- docs-requirements.txt | 4 +- .../opentelemetry/exporter/jaeger/__init__.py | 10 ++++- .../exporter/jaeger/translate/protobuf.py | 1 + .../src/opentelemetry/exporter/jaeger/util.py | 4 +- .../tests/certs/cred.cert | 0 .../tests/test_jarget_exporter_protobuf.py | 38 ++++++++++++++++++- 7 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 exporter/opentelemetry-exporter-jaeger/tests/certs/cred.cert diff --git a/dev-requirements.txt b/dev-requirements.txt index 3b0c1125e90..bd2515b1170 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -6,7 +6,7 @@ httpretty~=1.0 mypy==0.790 sphinx~=2.1 sphinx-rtd-theme~=0.4 -sphinx-autodoc-typehints~=1.11.1 +sphinx-autodoc-typehints~=1.10.2 pytest>=6.0 pytest-cov>=2.8 readme-renderer~=24.0 diff --git a/docs-requirements.txt b/docs-requirements.txt index fd299565017..64fd71c5a99 100644 --- a/docs-requirements.txt +++ b/docs-requirements.txt @@ -1,6 +1,6 @@ -sphinx~=3.3.1 +sphinx~=2.4 sphinx-rtd-theme~=0.4 -sphinx-autodoc-typehints~=1.11.1 +sphinx-autodoc-typehints~=1.10.2 # Need to install the api/sdk in the venv for autodoc. Modifying sys.path # doesn't work for pkg_resources. diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index e235753f778..15814022cf0 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -183,7 +183,10 @@ def agent_client(self) -> AgentClientUDP: @property def grpc_client(self) -> Optional[CollectorServiceStub]: - if not self.collector_endpoint: + if ( + not self.collector_endpoint + or self.transport_format != TRANSPORT_FORMAT_PROTOBUF + ): return None if self._grpc_client is None: @@ -202,7 +205,10 @@ def collector(self) -> Optional[Collector]: if self._collector is not None: return self._collector - if self.collector_endpoint is None: + if ( + self.collector_endpoint is None + or self.transport_format != TRANSPORT_FORMAT_THRIFT + ): return None auth = None diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 30221f17ed0..08988bcb2b9 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -188,6 +188,7 @@ def _duration_from_two_time_stamps( duration = Duration( seconds=end.seconds - start.seconds, nanos=end.nanos - start.nanos, ) + # pylint: disable=chained-comparison if duration.seconds < 0 and duration.nanos > 0: duration.seconds += 1 duration.nanos -= 1000000000 diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py index 9106a1b31a5..f0ead91c524 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py @@ -20,8 +20,8 @@ def _get_insecure(param): def _load_credential_from_file(path) -> ChannelCredentials: try: - with open(path, "rb") as f: - credential = f.read() + with open(path, "rb") as creds_file: + credential = creds_file.read() return ssl_channel_credentials(credential) except FileNotFoundError: logger.exception("Failed to read credential file") diff --git a/exporter/opentelemetry-exporter-jaeger/tests/certs/cred.cert b/exporter/opentelemetry-exporter-jaeger/tests/certs/cred.cert new file mode 100644 index 00000000000..e69de29bb2d diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 5b2411e40b9..7f5fd9e520a 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -13,6 +13,8 @@ # limitations under the License. import unittest +import os +from unittest.mock import patch from collections import OrderedDict # pylint:disable=no-name-in-module @@ -21,12 +23,13 @@ import opentelemetry.exporter.jaeger.translate as translate from opentelemetry import trace as trace_api from opentelemetry.configuration import Configuration +from opentelemetry.exporter.jaeger import JaegerSpanExporter from opentelemetry.sdk import trace from opentelemetry.sdk.trace import Resource from opentelemetry.sdk.util.instrumentation import InstrumentationInfo from opentelemetry.trace.status import Status, StatusCode - +# pylint:disable=no-member class TestJaegerSpanExporter(unittest.TestCase): def setUp(self): # create and save span to be used in tests @@ -46,6 +49,36 @@ def tearDown(self): # pylint: disable=protected-access Configuration._reset() + def test_constructor_by_environment_variables(self): + """Test using Environment Variables.""" + # pylint: disable=protected-access + Configuration._reset() + service = "my-opentelemetry-jaeger" + + collector_endpoint = "localhost:14250" + + env_patch = patch.dict( + "os.environ", + { + "OTEL_EXPORTER_JAEGER_ENDPOINT": collector_endpoint, + "OTEL_EXPORTER_JAEGER_CERTIFICATE": os.path.dirname(__file__) + + "/certs/cred.cert", + }, + ) + + env_patch.start() + + exporter = JaegerSpanExporter( + service_name=service, transport_format="protobuf" + ) + + self.assertEqual(exporter.service_name, service) + self.assertTrue(exporter.grpc_client is not None) + self.assertEqual(exporter.collector_endpoint, collector_endpoint) + self.assertIsNotNone(exporter.credentials) + + env_patch.stop() + # pylint: disable=too-many-locals def test_translate_to_jaeger(self): @@ -350,8 +383,9 @@ def test_translate_to_jaeger(self): # events are complicated to compare because order of fields # (attributes) in otel is not important but in jeager it is + # pylint: disable=no-member self.assertCountEqual( - spans[0].logs[0].fields, expected_spans[0].logs[0].fields + spans[0].logs[0].fields, expected_spans[0].logs[0].fields, ) self.assertEqual(spans, expected_spans) From 1aba1f944ba4937c5e3401cfcb2009aa655e956c Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 20:51:21 +0530 Subject: [PATCH 29/41] Exclude jaeger from pypy --- .../tests/test_jarget_exporter_protobuf.py | 5 +++-- tox.ini | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 7f5fd9e520a..8fa8cc31359 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import unittest import os -from unittest.mock import patch +import unittest from collections import OrderedDict +from unittest.mock import patch # pylint:disable=no-name-in-module # pylint:disable=import-error @@ -29,6 +29,7 @@ from opentelemetry.sdk.util.instrumentation import InstrumentationInfo from opentelemetry.trace.status import Status, StatusCode + # pylint:disable=no-member class TestJaegerSpanExporter(unittest.TestCase): def setUp(self): diff --git a/tox.ini b/tox.ini index c5044993b81..cdcb1679785 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,6 @@ envlist = ; opentelemetry-exporter-jaeger py3{5,6,7,8,9}-test-exporter-jaeger - pypy3-test-exporter-jaeger ; opentelemetry-exporter-opencensus py3{5,6,7,8,9}-test-exporter-opencensus From 44635a96ba396356c9ef22a07bbc176de30b0d29 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 21:15:54 +0530 Subject: [PATCH 30/41] Add grpc example --- .../examples/jaeger_exporter_example.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py index 0552f75183b..6e440419e0f 100644 --- a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py +++ b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py @@ -22,6 +22,14 @@ # password=xxxx, # optional ) +# gRPC example +# jaeger_exporter = jaeger.JaegerSpanExporter( +# service_name="my-helloworld-service", +# collector_endpoint="localhost:14250", +# insecure=True, +# transport_format="protobuf", +# ) + # create a BatchExportSpanProcessor and add the exporter to it span_processor = BatchExportSpanProcessor(jaeger_exporter) From 54aace17ae7d5e000020a26ff60bf01756a2d2c1 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 13 Dec 2020 21:19:13 +0530 Subject: [PATCH 31/41] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73ec8a070c7..78c01b8bccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v0.16b1...HEAD) +- Add protobuf via gRPC exporting support for Jaeger + ([#1471](https://github.com/open-telemetry/opentelemetry-python/pull/1471)) + - Add support for Python 3.9 ([#1441](https://github.com/open-telemetry/opentelemetry-python/pull/1441)) From 7a13b69d601c49607b5bbc44937c1bde4513a313 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 18 Dec 2020 10:34:54 +0530 Subject: [PATCH 32/41] Add more explanation to jaeger protobuf example --- .../examples/jaeger_exporter_example.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py index 6e440419e0f..0d312676b90 100644 --- a/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py +++ b/exporter/opentelemetry-exporter-jaeger/examples/jaeger_exporter_example.py @@ -22,7 +22,12 @@ # password=xxxx, # optional ) -# gRPC example +# Create a JaegerSpanExporter to send spans with gRPC +# If there is no encryption or authentication set `insecure` to True +# If server has authentication with SSL/TLS you can set the +# parameter credentials=ChannelCredentials(...) or the environment variable +# `EXPORTER_JAEGER_CERTIFICATE` with file containing creds. + # jaeger_exporter = jaeger.JaegerSpanExporter( # service_name="my-helloworld-service", # collector_endpoint="localhost:14250", From 504b6766f1556fb980c7eaf79b76335100799eec Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 18 Dec 2020 10:36:07 +0530 Subject: [PATCH 33/41] Review suggestions --- .../opentelemetry/exporter/jaeger/__init__.py | 20 +++++++++---------- .../exporter/jaeger/send/thrift.py | 14 +++++++++++++ .../exporter/jaeger/translate/__init__.py | 14 +++++++++++++ .../exporter/jaeger/translate/protobuf.py | 16 ++++++++++++++- .../exporter/jaeger/translate/thrift.py | 14 +++++++++++++ .../src/opentelemetry/exporter/jaeger/util.py | 14 +++++++++++++ .../tests/test_jarget_exporter_protobuf.py | 2 +- 7 files changed, 82 insertions(+), 12 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 15814022cf0..ca3e025c624 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -15,11 +15,11 @@ """ The **OpenTelemetry Jaeger Exporter** allows to export `OpenTelemetry`_ traces to `Jaeger`_. -This exporter always sends traces to the configured agent using Thrift compact protocol over UDP. +This exporter always sends traces to the configured agent using the Thrift compact protocol over UDP. When it is not feasible to deploy Jaeger Agent next to the application, for example, when the -application code is running as Lambda function, A collector can be configured to send spans -with either Thrift over HTTP or Protobuf via gRPC. If both agent and collector are configured, -exporter sends traces only to collector to eliminate the duplicate entries. +application code is running as Lambda function, a collector can be configured to send spans +using either Thrift over HTTP or Protobuf via gRPC. If both agent and collector are configured, +the exporter sends traces only to the collector to eliminate the duplicate entries. Usage ----- @@ -44,9 +44,9 @@ # collector_endpoint='http://localhost:14268/api/traces?format=jaeger.thrift', # username=xxxx, # optional # password=xxxx, # optional - # insecure=xxxx, # optional - # credentials=xxxx # optional - # transport_format=xxxx # optional + # insecure=True, # optional + # credentials=ChannelCredentials(...) # optional + # transport_format='protobuf' # optional ) # Create a BatchExportSpanProcessor and add the exporter to it @@ -113,13 +113,13 @@ class JaegerSpanExporter(SpanExporter): when query for spans. agent_host_name: The host name of the Jaeger-Agent. agent_port: The port of the Jaeger-Agent. - collector_endpoint: The endpoint of the Jaeger-Collector + collector_endpoint: The endpoint of the Jaeger collector that uses Thrift over HTTP/HTTPS or Protobuf via gRPC. username: The user name of the Basic Auth if authentication is required. password: The password of the Basic Auth if authentication is required. - insecure: Connection type. + insecure: True if collector has no encryption or authentication credentials: Credentials for server authentication. transport_format: Transport format for exporting spans to collector. """ @@ -184,7 +184,7 @@ def agent_client(self) -> AgentClientUDP: @property def grpc_client(self) -> Optional[CollectorServiceStub]: if ( - not self.collector_endpoint + self.collector_endpoint is None or self.transport_format != TRANSPORT_FORMAT_PROTOBUF ): return None diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py index a0f0616f25e..151e017b457 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/send/thrift.py @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import base64 import logging import socket diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py index 85fd67264ba..c4ef5e125f1 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from opentelemetry.trace import SpanKind OTLP_JAEGER_SPAN_KIND = { diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 08988bcb2b9..8887f2c5f8a 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Optional, Sequence from google.protobuf.duration_pb2 import Duration @@ -88,7 +102,7 @@ def _extract_key_values(span: Span) -> Sequence[model_pb2.KeyValue]: if span.attributes: for key, value in span.attributes.items(): key_value = _translate_attribute(key, value) - if key_value: + if key_value is not None: translated.append(key_value) if span.resource.attributes: for key, value in span.resource.attributes.items(): diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py index ac02c851426..19125dfbe81 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Optional, Sequence from opentelemetry.exporter.jaeger.gen.jaeger import Collector as TCollector diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py index f0ead91c524..6be9d509ac8 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/util.py @@ -1,3 +1,17 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging from grpc import ChannelCredentials, ssl_channel_credentials diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 8fa8cc31359..441f0efd19b 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -74,7 +74,7 @@ def test_constructor_by_environment_variables(self): ) self.assertEqual(exporter.service_name, service) - self.assertTrue(exporter.grpc_client is not None) + self.assertIsNotNone(exporter.grpc_client) self.assertEqual(exporter.collector_endpoint, collector_endpoint) self.assertIsNotNone(exporter.credentials) From 9070d736f49f7b7f7a3109a366bc46994ba9b192 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Wed, 23 Dec 2020 16:02:20 +0530 Subject: [PATCH 34/41] Make attributes private --- .../opentelemetry/exporter/jaeger/__init__.py | 36 ++++++++----------- .../tests/test_jaeger_exporter_thrift.py | 33 ++++++++--------- .../tests/test_jarget_exporter_protobuf.py | 2 +- 3 files changed, 32 insertions(+), 39 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index ca3e025c624..57b030e3899 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -144,14 +144,14 @@ def __init__( env_variable=Configuration().EXPORTER_JAEGER_AGENT_HOST, default=DEFAULT_AGENT_HOST_NAME, ) - self.agent_port = int( - _parameter_setter( - param=agent_port, - env_variable=Configuration().EXPORTER_JAEGER_AGENT_PORT, - default=DEFAULT_AGENT_PORT, - ) + self.agent_port = _parameter_setter( + param=agent_port, + env_variable=Configuration().EXPORTER_JAEGER_AGENT_PORT, + default=DEFAULT_AGENT_PORT, + ) + self._agent_client = AgentClientUDP( + host_name=self.agent_host_name, port=self.agent_port ) - self._agent_client = None self.collector_endpoint = _parameter_setter( param=collector_endpoint, env_variable=Configuration().EXPORTER_JAEGER_ENDPOINT, @@ -174,15 +174,7 @@ def __init__( self.transport_format = transport_format or TRANSPORT_FORMAT_THRIFT @property - def agent_client(self) -> AgentClientUDP: - if self._agent_client is None: - self._agent_client = AgentClientUDP( - host_name=self.agent_host_name, port=self.agent_port - ) - return self._agent_client - - @property - def grpc_client(self) -> Optional[CollectorServiceStub]: + def _collector_grpc_client(self) -> Optional[CollectorServiceStub]: if ( self.collector_endpoint is None or self.transport_format != TRANSPORT_FORMAT_PROTOBUF @@ -201,7 +193,7 @@ def grpc_client(self) -> Optional[CollectorServiceStub]: return self._grpc_client @property - def collector(self) -> Optional[Collector]: + def _collector_http_client(self) -> Optional[Collector]: if self._collector is not None: return self._collector @@ -225,18 +217,18 @@ def export(self, spans) -> SpanExportResult: jaeger_spans = protobuf._to_jaeger(spans, self.service_name) batch = model_pb2.Batch(spans=jaeger_spans) request = PostSpansRequest(batch=batch) - if self.grpc_client is not None: - self.grpc_client.PostSpans(request) + if self._collector_grpc_client is not None: + self._collector_grpc_client.PostSpans(request) else: jaeger_spans = thrift._to_jaeger(spans) batch = jaeger_thrift.Batch( spans=jaeger_spans, process=jaeger_thrift.Process(serviceName=self.service_name), ) - if self.collector is not None: - self.collector.submit(batch) + if self._collector_http_client is not None: + self._collector_http_client.submit(batch) else: - self.agent_client.emit(batch) + self._agent_client.emit(batch) return SpanExportResult.SUCCESS diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py index 7ce6fea1383..d4dd468efae 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py @@ -49,6 +49,7 @@ def tearDown(self): Configuration._reset() def test_constructor_default(self): + # pylint: disable=protected-access """Test the default values assigned by constructor.""" service_name = "my-service-name" agent_host_name = "localhost" @@ -61,10 +62,11 @@ def test_constructor_default(self): self.assertEqual(exporter.collector_endpoint, None) self.assertEqual(exporter.username, None) self.assertEqual(exporter.password, None) - self.assertTrue(exporter.collector is None) - self.assertTrue(exporter.agent_client is not None) + self.assertTrue(exporter._collector_http_client is None) + self.assertTrue(exporter._agent_client is not None) def test_constructor_explicit(self): + # pylint: disable=protected-access """Test the constructor passing all the options.""" service = "my-opentelemetry-jaeger" collector_endpoint = "https://opentelemetry.io:15875" @@ -88,20 +90,20 @@ def test_constructor_explicit(self): self.assertEqual(exporter.service_name, service) self.assertEqual(exporter.agent_host_name, agent_host_name) self.assertEqual(exporter.agent_port, agent_port) - self.assertTrue(exporter.collector is not None) - self.assertEqual(exporter.collector.auth, auth) + self.assertTrue(exporter._collector_http_client is not None) + self.assertEqual(exporter._collector_http_client.auth, auth) # property should not construct new object - collector = exporter.collector - self.assertEqual(exporter.collector, collector) + collector = exporter._collector_http_client + self.assertEqual(exporter._collector_http_client, collector) # property should construct new object - # pylint: disable=protected-access exporter._collector = None exporter.username = None exporter.password = None - self.assertNotEqual(exporter.collector, collector) - self.assertTrue(exporter.collector.auth is None) + self.assertNotEqual(exporter._collector_http_client, collector) + self.assertTrue(exporter._collector_http_client.auth is None) def test_constructor_by_environment_variables(self): + # pylint: disable=protected-access """Test the constructor using Environment Variables.""" service = "my-opentelemetry-jaeger" @@ -132,19 +134,18 @@ def test_constructor_by_environment_variables(self): self.assertEqual(exporter.service_name, service) self.assertEqual(exporter.agent_host_name, agent_host_name) self.assertEqual(exporter.agent_port, int(agent_port)) - self.assertTrue(exporter.collector is not None) + self.assertTrue(exporter._collector_http_client is not None) self.assertEqual(exporter.collector_endpoint, collector_endpoint) - self.assertEqual(exporter.collector.auth, auth) + self.assertEqual(exporter._collector_http_client.auth, auth) # property should not construct new object - collector = exporter.collector - self.assertEqual(exporter.collector, collector) + collector = exporter._collector_http_client + self.assertEqual(exporter._collector_http_client, collector) # property should construct new object - # pylint: disable=protected-access exporter._collector = None exporter.username = None exporter.password = None - self.assertNotEqual(exporter.collector, collector) - self.assertTrue(exporter.collector.auth is None) + self.assertNotEqual(exporter._collector_http_client, collector) + self.assertTrue(exporter._collector_http_client.auth is None) environ_patcher.stop() diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 441f0efd19b..8854ea89782 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -74,7 +74,7 @@ def test_constructor_by_environment_variables(self): ) self.assertEqual(exporter.service_name, service) - self.assertIsNotNone(exporter.grpc_client) + self.assertIsNotNone(exporter._collector_grpc_client) self.assertEqual(exporter.collector_endpoint, collector_endpoint) self.assertIsNotNone(exporter.credentials) From 68c477c1b02e0739c429765d478873406c77e218 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Wed, 23 Dec 2020 16:07:21 +0530 Subject: [PATCH 35/41] Use .lower for format name --- .../src/opentelemetry/exporter/jaeger/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 57b030e3899..bcc34c6742d 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -171,7 +171,11 @@ def __init__( self._grpc_client = None self.insecure = util._get_insecure(insecure) self.credentials = util._get_credentials(credentials) - self.transport_format = transport_format or TRANSPORT_FORMAT_THRIFT + self.transport_format = ( + transport_format.lower() + if transport_format + else TRANSPORT_FORMAT_THRIFT + ) @property def _collector_grpc_client(self) -> Optional[CollectorServiceStub]: From fab1ed18ba602a8669b7fa2291df6fc58d64228f Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Fri, 25 Dec 2020 20:34:25 +0530 Subject: [PATCH 36/41] grpc endpoint changes --- .../src/opentelemetry/exporter/jaeger/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index bcc34c6742d..47c895f2676 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -96,6 +96,7 @@ DEFAULT_AGENT_HOST_NAME = "localhost" DEFAULT_AGENT_PORT = 6831 +DEFAULT_GRPC_COLLECTOR_ENDPOINT = "localhost:14250" UDP_PACKET_MAX_LENGTH = 65000 @@ -179,20 +180,19 @@ def __init__( @property def _collector_grpc_client(self) -> Optional[CollectorServiceStub]: - if ( - self.collector_endpoint is None - or self.transport_format != TRANSPORT_FORMAT_PROTOBUF - ): + if self.transport_format != TRANSPORT_FORMAT_PROTOBUF: return None + endpoint = self.collector_endpoint or DEFAULT_GRPC_COLLECTOR_ENDPOINT + if self._grpc_client is None: if self.insecure: self._grpc_client = CollectorServiceStub( - insecure_channel(self.collector_endpoint) + insecure_channel(endpoint) ) else: self._grpc_client = CollectorServiceStub( - secure_channel(self.collector_endpoint, self.credentials) + secure_channel(endpoint, self.credentials) ) return self._grpc_client @@ -221,8 +221,7 @@ def export(self, spans) -> SpanExportResult: jaeger_spans = protobuf._to_jaeger(spans, self.service_name) batch = model_pb2.Batch(spans=jaeger_spans) request = PostSpansRequest(batch=batch) - if self._collector_grpc_client is not None: - self._collector_grpc_client.PostSpans(request) + self._collector_grpc_client.PostSpans(request) else: jaeger_spans = thrift._to_jaeger(spans) batch = jaeger_thrift.Batch( From 87f6274d3faae28c3f67abeaaba38ad27691cb65 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 26 Dec 2020 13:19:35 +0530 Subject: [PATCH 37/41] review suggestions --- .../opentelemetry/exporter/jaeger/__init__.py | 11 +- .../exporter/jaeger/translate/__init__.py | 49 +++++ .../exporter/jaeger/translate/protobuf.py | 190 ++++++++-------- .../exporter/jaeger/translate/thrift.py | 205 ++++++++---------- .../tests/test_jaeger_exporter_thrift.py | 15 +- .../tests/test_jarget_exporter_protobuf.py | 44 ++-- 6 files changed, 271 insertions(+), 243 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 47c895f2676..46b1609e187 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -89,7 +89,9 @@ ) from opentelemetry.exporter.jaeger.gen.jaeger import Collector as jaeger_thrift from opentelemetry.exporter.jaeger.send.thrift import AgentClientUDP, Collector -from opentelemetry.exporter.jaeger.translate import protobuf, thrift +from opentelemetry.exporter.jaeger.translate import Translate +from opentelemetry.exporter.jaeger.translate.protobuf import ProtobufTranslator +from opentelemetry.exporter.jaeger.translate.thrift import ThriftTranslator from opentelemetry.sdk.trace.export import Span, SpanExporter, SpanExportResult from opentelemetry.trace import SpanKind from opentelemetry.trace.status import StatusCode @@ -217,13 +219,16 @@ def _collector_http_client(self) -> Optional[Collector]: return self._collector def export(self, spans) -> SpanExportResult: + translator = Translate(spans) if self.transport_format == TRANSPORT_FORMAT_PROTOBUF: - jaeger_spans = protobuf._to_jaeger(spans, self.service_name) + pb_translator = ProtobufTranslator(self.service_name) + jaeger_spans = translator._translate(pb_translator) batch = model_pb2.Batch(spans=jaeger_spans) request = PostSpansRequest(batch=batch) self._collector_grpc_client.PostSpans(request) else: - jaeger_spans = thrift._to_jaeger(spans) + thrift_translator = ThriftTranslator() + jaeger_spans = translator._translate(thrift_translator) batch = jaeger_thrift.Batch( spans=jaeger_spans, process=jaeger_thrift.Process(serviceName=self.service_name), diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py index c4ef5e125f1..b840687fbeb 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/__init__.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import abc + from opentelemetry.trace import SpanKind OTLP_JAEGER_SPAN_KIND = { @@ -36,3 +38,50 @@ def _convert_int_to_i64(val): if val > 0x7FFFFFFFFFFFFFFF: val -= 0x10000000000000000 return val + + +class Translator(abc.ABC): + @abc.abstractmethod + def _translate_span(self, span): + """Translates span to jaeger format. + + Args: + span: span to translate + """ + + @abc.abstractmethod + def _extract_tags(self, span): + """Extracts tags from span and returns list of jaeger Tags. + + Args: + span: span to extract tags + """ + + @abc.abstractmethod + def _extract_refs(self, span): + """Extracts references from span and returns list of jaeger SpanRefs. + + Args: + span: span to extract references + """ + + @abc.abstractmethod + def _extract_logs(self, span): + """Extracts logs from span and returns list of jaeger Logs. + + Args: + span: span to extract logs + """ + + +class Translate: + def __init__(self, spans): + self.spans = spans + + def _translate(self, translator: Translator): + translated_spans = [] + for span in self.spans: + # pylint: disable=protected-access + translated_span = translator._translate_span(span) + translated_spans.append(translated_span) + return translated_spans diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py index 8887f2c5f8a..f43bdfb599f 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/protobuf.py @@ -22,11 +22,12 @@ NAME_KEY, OTLP_JAEGER_SPAN_KIND, VERSION_KEY, + Translator, ) from opentelemetry.sdk.trace import Span from opentelemetry.util import types -# pylint: disable=no-member,too-many-locals +# pylint: disable=no-member,too-many-locals,no-self-use def _trace_id_to_bytes(trace_id: int) -> bytes: @@ -92,91 +93,6 @@ def _translate_attribute( return translated -def _extract_key_values(span: Span) -> Sequence[model_pb2.KeyValue]: - """Extracts attributes from span and returns list of jaeger keyvalues. - - Args: - span: span to extract keyvalues - """ - translated = [] - if span.attributes: - for key, value in span.attributes.items(): - key_value = _translate_attribute(key, value) - if key_value is not None: - translated.append(key_value) - if span.resource.attributes: - for key, value in span.resource.attributes.items(): - key_value = _translate_attribute(key, value) - if key_value: - translated.append(key_value) - - code = _get_long_key_value("status.code", span.status.status_code.value) - message = _get_string_key_value("status.message", span.status.description) - kind = _get_string_key_value("span.kind", OTLP_JAEGER_SPAN_KIND[span.kind]) - translated.extend([code, message, kind]) - - # Instrumentation info KeyValues - if span.instrumentation_info: - name = _get_string_key_value(NAME_KEY, span.instrumentation_info.name) - version = _get_string_key_value( - VERSION_KEY, span.instrumentation_info.version - ) - translated.extend([name, version]) - - # Make sure to add "error" tag if span status is not OK - if not span.status.is_ok: - translated.append(_get_bool_key_value("error", True)) - - return translated - - -def _extract_refs(span: Span) -> Optional[Sequence[model_pb2.SpanRef]]: - """Returns jaeger span references if links exists, otherwise None. - - Args: - span: span to extract refs - """ - if not span.links: - return None - - refs = [] - for link in span.links: - trace_id = link.context.trace_id - span_id = link.context.span_id - refs.append( - model_pb2.SpanRef( - ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, - trace_id=_trace_id_to_bytes(trace_id), - span_id=_span_id_to_bytes(span_id), - ) - ) - return refs - - -def _extract_logs(span: Span) -> Optional[Sequence[model_pb2.Log]]: - """Returns jaeger logs if events exists, otherwise None. - - Args: - span: span to extract logs - """ - if not span.events: - return None - - logs = [] - for event in span.events: - fields = [] - for key, value in event.attributes.items(): - tag = _translate_attribute(key, value) - if tag: - fields.append(tag) - - fields.append(_get_string_key_value(key="message", value=event.name,)) - event_ts = _proto_timestamp_from_epoch_nanos(event.timestamp) - logs.append(model_pb2.Log(timestamp=event_ts, fields=fields)) - - return logs - - def _extract_resource_tags(span: Span) -> Sequence[model_pb2.KeyValue]: """Extracts resource attributes from span and returns list of jaeger keyvalues. @@ -223,17 +139,12 @@ def _proto_timestamp_from_epoch_nanos(nsec: int) -> Timestamp: return Timestamp(seconds=seconds, nanos=nanos) -def _to_jaeger( - spans: Sequence[Span], svc_name: str -) -> Sequence[model_pb2.Span]: - """Translate the spans to Jaeger format. +class ProtobufTranslator(Translator): + def __init__(self, svc_name): + self.svc_name = svc_name - Args: - spans: Tuple of spans to convert - """ - jaeger_spans = [] + def _translate_span(self, span: Span) -> model_pb2.Span: - for span in spans: ctx = span.get_span_context() # pb2 span expects in byte format trace_id = _trace_id_to_bytes(ctx.trace_id) @@ -243,14 +154,14 @@ def _to_jaeger( end_time = _proto_timestamp_from_epoch_nanos(span.end_time) duration = _duration_from_two_time_stamps(start_time, end_time) - tags = _extract_key_values(span) - refs = _extract_refs(span) - logs = _extract_logs(span) + tags = self._extract_tags(span) + refs = self._extract_refs(span) + logs = self._extract_logs(span) flags = int(ctx.trace_flags) process = model_pb2.Process( - service_name=svc_name, tags=_extract_resource_tags(span) + service_name=self.svc_name, tags=_extract_resource_tags(span) ) jaeger_span = model_pb2.Span( trace_id=trace_id, @@ -264,6 +175,83 @@ def _to_jaeger( logs=logs, process=process, ) - jaeger_spans.append(jaeger_span) + return jaeger_span + + def _extract_tags(self, span: Span) -> Sequence[model_pb2.KeyValue]: + translated = [] + if span.attributes: + for key, value in span.attributes.items(): + key_value = _translate_attribute(key, value) + if key_value is not None: + translated.append(key_value) + if span.resource.attributes: + for key, value in span.resource.attributes.items(): + key_value = _translate_attribute(key, value) + if key_value: + translated.append(key_value) + + code = _get_long_key_value( + "status.code", span.status.status_code.value + ) + message = _get_string_key_value( + "status.message", span.status.description + ) + kind = _get_string_key_value( + "span.kind", OTLP_JAEGER_SPAN_KIND[span.kind] + ) + translated.extend([code, message, kind]) + + # Instrumentation info KeyValues + if span.instrumentation_info: + name = _get_string_key_value( + NAME_KEY, span.instrumentation_info.name + ) + version = _get_string_key_value( + VERSION_KEY, span.instrumentation_info.version + ) + translated.extend([name, version]) + + # Make sure to add "error" tag if span status is not OK + if not span.status.is_ok: + translated.append(_get_bool_key_value("error", True)) + + return translated + + def _extract_refs( + self, span: Span + ) -> Optional[Sequence[model_pb2.SpanRef]]: + if not span.links: + return None + + refs = [] + for link in span.links: + trace_id = link.context.trace_id + span_id = link.context.span_id + refs.append( + model_pb2.SpanRef( + ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, + trace_id=_trace_id_to_bytes(trace_id), + span_id=_span_id_to_bytes(span_id), + ) + ) + return refs + + def _extract_logs(self, span: Span) -> Optional[Sequence[model_pb2.Log]]: + if not span.events: + return None + + logs = [] + for event in span.events: + fields = [] + for key, value in event.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + fields.append(tag) + + fields.append( + _get_string_key_value(key="message", value=event.name,) + ) + event_ts = _proto_timestamp_from_epoch_nanos(event.timestamp) + logs.append(model_pb2.Log(timestamp=event_ts, fields=fields)) - return jaeger_spans + return logs diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py index 19125dfbe81..710ba85a6ee 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/translate/thrift.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +# pylint: disable=no-self-use from typing import Optional, Sequence from opentelemetry.exporter.jaeger.gen.jaeger import Collector as TCollector @@ -19,6 +19,7 @@ NAME_KEY, OTLP_JAEGER_SPAN_KIND, VERSION_KEY, + Translator, _convert_int_to_i64, _nsec_to_usec_round, ) @@ -73,110 +74,8 @@ def _translate_attribute( return None -def _extract_tags(span: Span) -> Sequence[TCollector.Tag]: - """Extracts tags from span and returns list of jaeger tags. - - Args: - span: span to extract tags - """ - translated = [] - if span.attributes: - for key, value in span.attributes.items(): - tag = _translate_attribute(key, value) - if tag: - translated.append(tag) - if span.resource.attributes: - for key, value in span.resource.attributes.items(): - tag = _translate_attribute(key, value) - if tag: - translated.append(tag) - - code = _get_long_tag("status.code", span.status.status_code.value) - message = _get_string_tag("status.message", span.status.description) - kind = _get_string_tag("span.kind", OTLP_JAEGER_SPAN_KIND[span.kind]) - translated.extend([code, message, kind]) - - # Instrumentation info tags - if span.instrumentation_info: - name = _get_string_tag(NAME_KEY, span.instrumentation_info.name) - version = _get_string_tag( - VERSION_KEY, span.instrumentation_info.version - ) - translated.extend([name, version]) - - # Make sure to add "error" tag if span status is not OK - if not span.status.is_ok: - translated.append(_get_bool_tag("error", True)) - - return translated - - -def _extract_refs(span: Span) -> Optional[Sequence[TCollector.SpanRef]]: - """Returns jaeger span references if links exists, otherwise None. - - Args: - span: span to extract refs - """ - if not span.links: - return None - - refs = [] - for link in span.links: - trace_id = link.context.trace_id - span_id = link.context.span_id - refs.append( - TCollector.SpanRef( - refType=TCollector.SpanRefType.FOLLOWS_FROM, - traceIdHigh=_get_trace_id_high(trace_id), - traceIdLow=_get_trace_id_low(trace_id), - spanId=_convert_int_to_i64(span_id), - ) - ) - return refs - - -def _extract_logs(span: Span) -> Optional[Sequence[TCollector.Log]]: - """Returns jaeger logs if events exists, otherwise None. - - Args: - span: span to extract logs - """ - if not span.events: - return None - - logs = [] - for event in span.events: - fields = [] - for key, value in event.attributes.items(): - tag = _translate_attribute(key, value) - if tag: - fields.append(tag) - - fields.append( - TCollector.Tag( - key="message", - vType=TCollector.TagType.STRING, - vStr=event.name, - ) - ) - - event_timestamp_us = _nsec_to_usec_round(event.timestamp) - logs.append( - TCollector.Log(timestamp=int(event_timestamp_us), fields=fields) - ) - - return logs - - -def _to_jaeger(spans: Sequence[Span]) -> Sequence[TCollector.Span]: - """Translate the spans to Jaeger format. - - Args: - spans: Tuple of spans to convert - """ - jaeger_spans = [] - - for span in spans: +class ThriftTranslator(Translator): + def _translate_span(self, span: Span) -> TCollector.Span: ctx = span.get_span_context() trace_id = ctx.trace_id span_id = ctx.span_id @@ -186,16 +85,15 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[TCollector.Span]: parent_id = span.parent.span_id if span.parent else 0 - tags = _extract_tags(span) - refs = _extract_refs(span) - logs = _extract_logs(span) + tags = self._extract_tags(span) + refs = self._extract_refs(span) + logs = self._extract_logs(span) flags = int(ctx.trace_flags) jaeger_span = TCollector.Span( traceIdHigh=_get_trace_id_high(trace_id), traceIdLow=_get_trace_id_low(trace_id), - # generated code expects i64 spanId=_convert_int_to_i64(span_id), operationName=span.name, startTime=start_time_us, @@ -206,6 +104,91 @@ def _to_jaeger(spans: Sequence[Span]) -> Sequence[TCollector.Span]: flags=flags, parentSpanId=_convert_int_to_i64(parent_id), ) - jaeger_spans.append(jaeger_span) + return jaeger_span + + def _extract_tags(self, span: Span) -> Sequence[TCollector.Tag]: + + translated = [] + if span.attributes: + for key, value in span.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + translated.append(tag) + if span.resource.attributes: + for key, value in span.resource.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + translated.append(tag) + + code = _get_long_tag("status.code", span.status.status_code.value) + message = _get_string_tag("status.message", span.status.description) + kind = _get_string_tag("span.kind", OTLP_JAEGER_SPAN_KIND[span.kind]) + translated.extend([code, message, kind]) + + # Instrumentation info tags + if span.instrumentation_info: + name = _get_string_tag(NAME_KEY, span.instrumentation_info.name) + version = _get_string_tag( + VERSION_KEY, span.instrumentation_info.version + ) + translated.extend([name, version]) + + # Make sure to add "error" tag if span status is not OK + if not span.status.is_ok: + translated.append(_get_bool_tag("error", True)) + + return translated + + def _extract_refs( + self, span: Span + ) -> Optional[Sequence[TCollector.SpanRef]]: + if not span.links: + return None + + refs = [] + for link in span.links: + trace_id = link.context.trace_id + span_id = link.context.span_id + refs.append( + TCollector.SpanRef( + refType=TCollector.SpanRefType.FOLLOWS_FROM, + traceIdHigh=_get_trace_id_high(trace_id), + traceIdLow=_get_trace_id_low(trace_id), + spanId=_convert_int_to_i64(span_id), + ) + ) + return refs + + def _extract_logs(self, span: Span) -> Optional[Sequence[TCollector.Log]]: + """Returns jaeger logs if events exists, otherwise None. + + Args: + span: span to extract logs + """ + if not span.events: + return None + + logs = [] + for event in span.events: + fields = [] + for key, value in event.attributes.items(): + tag = _translate_attribute(key, value) + if tag: + fields.append(tag) + + fields.append( + TCollector.Tag( + key="message", + vType=TCollector.TagType.STRING, + vStr=event.name, + ) + ) + + event_timestamp_us = _nsec_to_usec_round(event.timestamp) + logs.append( + TCollector.Log( + timestamp=int(event_timestamp_us), fields=fields + ) + ) - return jaeger_spans + return logs diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py index d4dd468efae..853542c7bb7 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger_exporter_thrift.py @@ -22,6 +22,8 @@ from opentelemetry import trace as trace_api from opentelemetry.configuration import Configuration from opentelemetry.exporter.jaeger.gen.jaeger import ttypes as jaeger +from opentelemetry.exporter.jaeger.translate import Translate +from opentelemetry.exporter.jaeger.translate.thrift import ThriftTranslator from opentelemetry.sdk import trace from opentelemetry.sdk.trace import Resource from opentelemetry.sdk.util.instrumentation import InstrumentationInfo @@ -275,8 +277,9 @@ def test_translate_to_jaeger(self): name="name", version="version" ) + translate = Translate(otel_spans) # pylint: disable=protected-access - spans = jaeger_exporter.translate.thrift._to_jaeger(otel_spans) + spans = translate._translate(ThriftTranslator()) expected_spans = [ jaeger.Span( @@ -456,12 +459,12 @@ def test_agent_client(self): host_name="localhost", port=6354 ) + translate = Translate([self._test_span]) + # pylint: disable=protected-access + spans = translate._translate(ThriftTranslator()) + batch = jaeger.Batch( - # pylint: disable=protected-access - spans=jaeger_exporter.translate.thrift._to_jaeger( - (self._test_span,) - ), - process=jaeger.Process(serviceName="xxx"), + spans=spans, process=jaeger.Process(serviceName="xxx"), ) agent_client.emit(batch) diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 8854ea89782..15ab997256f 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -20,10 +20,11 @@ # pylint:disable=no-name-in-module # pylint:disable=import-error import opentelemetry.exporter.jaeger.gen.model_pb2 as model_pb2 -import opentelemetry.exporter.jaeger.translate as translate +import opentelemetry.exporter.jaeger.translate.protobuf as pb_translator from opentelemetry import trace as trace_api from opentelemetry.configuration import Configuration from opentelemetry.exporter.jaeger import JaegerSpanExporter +from opentelemetry.exporter.jaeger.translate import Translate from opentelemetry.sdk import trace from opentelemetry.sdk.trace import Resource from opentelemetry.sdk.util.instrumentation import InstrumentationInfo @@ -122,7 +123,7 @@ def test_translate_to_jaeger(self): event_timestamp = base_time + 50 * 10 ** 6 # pylint:disable=protected-access - event_timestamp_proto = translate.protobuf._proto_timestamp_from_epoch_nanos( + event_timestamp_proto = pb_translator._proto_timestamp_from_epoch_nanos( event_timestamp ) @@ -199,44 +200,45 @@ def test_translate_to_jaeger(self): name="name", version="version" ) + translate = Translate(otel_spans) # pylint: disable=protected-access - spans = translate.protobuf._to_jaeger(otel_spans, "svc") + spans = translate._translate(pb_translator.ProtobufTranslator("svc")) - span1_start_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + span1_start_time = pb_translator._proto_timestamp_from_epoch_nanos( start_times[0] ) - span2_start_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + span2_start_time = pb_translator._proto_timestamp_from_epoch_nanos( start_times[1] ) - span3_start_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + span3_start_time = pb_translator._proto_timestamp_from_epoch_nanos( start_times[2] ) - span1_end_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + span1_end_time = pb_translator._proto_timestamp_from_epoch_nanos( end_times[0] ) - span2_end_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + span2_end_time = pb_translator._proto_timestamp_from_epoch_nanos( end_times[1] ) - span3_end_time = translate.protobuf._proto_timestamp_from_epoch_nanos( + span3_end_time = pb_translator._proto_timestamp_from_epoch_nanos( end_times[2] ) - span1_duration = translate.protobuf._duration_from_two_time_stamps( + span1_duration = pb_translator._duration_from_two_time_stamps( span1_start_time, span1_end_time ) - span2_duration = translate.protobuf._duration_from_two_time_stamps( + span2_duration = pb_translator._duration_from_two_time_stamps( span2_start_time, span2_end_time ) - span3_duration = translate.protobuf._duration_from_two_time_stamps( + span3_duration = pb_translator._duration_from_two_time_stamps( span3_start_time, span3_end_time ) expected_spans = [ model_pb2.Span( operation_name=span_names[0], - trace_id=translate.protobuf._trace_id_to_bytes(trace_id), - span_id=translate.protobuf._span_id_to_bytes(span_id), + trace_id=pb_translator._trace_id_to_bytes(trace_id), + span_id=pb_translator._span_id_to_bytes(span_id), start_time=span1_start_time, duration=span1_duration, flags=0, @@ -290,10 +292,8 @@ def test_translate_to_jaeger(self): references=[ model_pb2.SpanRef( ref_type=model_pb2.SpanRefType.FOLLOWS_FROM, - trace_id=translate.protobuf._trace_id_to_bytes( - trace_id - ), - span_id=translate.protobuf._span_id_to_bytes(other_id), + trace_id=pb_translator._trace_id_to_bytes(trace_id), + span_id=pb_translator._span_id_to_bytes(other_id), ) ], logs=[ @@ -336,8 +336,8 @@ def test_translate_to_jaeger(self): ), model_pb2.Span( operation_name=span_names[1], - trace_id=translate.protobuf._trace_id_to_bytes(trace_id), - span_id=translate.protobuf._span_id_to_bytes(parent_id), + trace_id=pb_translator._trace_id_to_bytes(trace_id), + span_id=pb_translator._span_id_to_bytes(parent_id), start_time=span2_start_time, duration=span2_duration, flags=0, @@ -346,8 +346,8 @@ def test_translate_to_jaeger(self): ), model_pb2.Span( operation_name=span_names[2], - trace_id=translate.protobuf._trace_id_to_bytes(trace_id), - span_id=translate.protobuf._span_id_to_bytes(other_id), + trace_id=pb_translator._trace_id_to_bytes(trace_id), + span_id=pb_translator._span_id_to_bytes(other_id), start_time=span3_start_time, duration=span3_duration, flags=0, From cf8c72c9b5933b0ef01bc98dc1309e1b31efd06c Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 26 Dec 2020 14:02:51 +0530 Subject: [PATCH 38/41] Fix lint --- .../src/opentelemetry/exporter/jaeger/__init__.py | 4 +--- .../tests/test_jarget_exporter_protobuf.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 46b1609e187..d8f527d5145 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -137,9 +137,7 @@ def __init__( password: Optional[str] = None, insecure: Optional[bool] = None, credentials: Optional[ChannelCredentials] = None, - transport_format: Union[ - TRANSPORT_FORMAT_THRIFT, TRANSPORT_FORMAT_PROTOBUF - ] = None, + transport_format: Optional[str] = None, ): self.service_name = service_name self.agent_host_name = _parameter_setter( diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py index 15ab997256f..cf19428ded4 100644 --- a/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py +++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jarget_exporter_protobuf.py @@ -81,7 +81,7 @@ def test_constructor_by_environment_variables(self): env_patch.stop() - # pylint: disable=too-many-locals + # pylint: disable=too-many-locals,too-many-statements def test_translate_to_jaeger(self): span_names = ("test1", "test2", "test3") From f10591506ef0d66197451837f7b1866afde04e6d Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 26 Dec 2020 14:16:36 +0530 Subject: [PATCH 39/41] Fix docs --- .../src/opentelemetry/exporter/jaeger/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index d8f527d5145..375a2cd2f17 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -45,7 +45,7 @@ # username=xxxx, # optional # password=xxxx, # optional # insecure=True, # optional - # credentials=ChannelCredentials(...) # optional + # credentials=grpc.ChannelCredentials(...) # optional # transport_format='protobuf' # optional ) From 206622f08aaf23e3bc24012aa03d34edc53ff593 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 26 Dec 2020 14:18:35 +0530 Subject: [PATCH 40/41] Fix docs --- .../src/opentelemetry/exporter/jaeger/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py index 375a2cd2f17..297c1e2b264 100644 --- a/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py +++ b/exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/__init__.py @@ -45,7 +45,7 @@ # username=xxxx, # optional # password=xxxx, # optional # insecure=True, # optional - # credentials=grpc.ChannelCredentials(...) # optional + # credentials=xxx # optional channel creds # transport_format='protobuf' # optional ) From 070b28f50037be4540a34ac800042b572801054a Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 26 Dec 2020 14:43:24 +0530 Subject: [PATCH 41/41] Add intersphinx mapping for grpc --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index b227cb51818..0d06bffec18 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -86,6 +86,7 @@ "aiohttp": ("https://aiohttp.readthedocs.io/en/stable/", None), "wrapt": ("https://wrapt.readthedocs.io/en/latest/", None), "pymongo": ("https://pymongo.readthedocs.io/en/stable/", None), + "grpc": ("https://grpc.github.io/grpc/python/", None), } # http://www.sphinx-doc.org/en/master/config.html#confval-nitpicky