Generated protocol buffer code.
Expand source code
-# -*- coding: utf-8 -*-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
+# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: config.proto
-"""Generated protocol buffer code."""
+
+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
@@ -48,9 +48,8 @@ Module hypertrace.agent.config.config_pb2
name='config.proto',
package='org.hypertrace.agent.config',
syntax='proto3',
- serialized_options=b'\n\033org.hypertrace.agent.configZ$github.com/hypertrace/goagent/config',
- create_key=_descriptor._internal_create_key,
- serialized_pb=b'\n\x0c\x63onfig.proto\x12\x1borg.hypertrace.agent.config\x1a\x1egoogle/protobuf/wrappers.proto\"\x8b\x04\n\x0b\x41gentConfig\x12\x32\n\x0cservice_name\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x39\n\treporting\x18\x02 \x01(\x0b\x32&.org.hypertrace.agent.config.Reporting\x12>\n\x0c\x64\x61ta_capture\x18\x03 \x01(\x0b\x32(.org.hypertrace.agent.config.DataCapture\x12K\n\x13propagation_formats\x18\x04 \x03(\x0e\x32..org.hypertrace.agent.config.PropagationFormat\x12+\n\x07\x65nabled\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x39\n\tjavaagent\x18\x06 \x01(\x0b\x32&.org.hypertrace.agent.config.JavaAgent\x12]\n\x13resource_attributes\x18\x07 \x03(\x0b\x32@.org.hypertrace.agent.config.AgentConfig.ResourceAttributesEntry\x1a\x39\n\x17ResourceAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x02\n\tReporting\x12.\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12*\n\x06secure\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12+\n\x05token\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12-\n\x03opa\x18\x04 \x01(\x0b\x32 .org.hypertrace.agent.config.Opa\x12K\n\x13trace_reporter_type\x18\x05 \x01(\x0e\x32..org.hypertrace.agent.config.TraceReporterType\"\x9c\x01\n\x03Opa\x12.\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x38\n\x13poll_period_seconds\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12+\n\x07\x65nabled\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"d\n\x07Message\x12+\n\x07request\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12,\n\x08response\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\xb0\x02\n\x0b\x44\x61taCapture\x12:\n\x0chttp_headers\x18\x01 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12\x37\n\thttp_body\x18\x02 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12:\n\x0crpc_metadata\x18\x03 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12\x36\n\x08rpc_body\x18\x04 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12\x38\n\x13\x62ody_max_size_bytes\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\"C\n\tJavaAgent\x12\x36\n\x10\x66ilter_jar_paths\x18\x01 \x03(\x0b\x32\x1c.google.protobuf.StringValue*-\n\x11PropagationFormat\x12\x06\n\x02\x42\x33\x10\x00\x12\x10\n\x0cTRACECONTEXT\x10\x01*:\n\x11TraceReporterType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\n\n\x06ZIPKIN\x10\x01\x12\x08\n\x04OTLP\x10\x02\x42\x43\n\x1borg.hypertrace.agent.configZ$github.com/hypertrace/goagent/configb\x06proto3'
+ serialized_options=_b('\n\033org.hypertrace.agent.configZ$github.com/hypertrace/goagent/config'),
+ serialized_pb=_b('\n\x0c\x63onfig.proto\x12\x1borg.hypertrace.agent.config\x1a\x1egoogle/protobuf/wrappers.proto\"\x8b\x04\n\x0b\x41gentConfig\x12\x32\n\x0cservice_name\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x39\n\treporting\x18\x02 \x01(\x0b\x32&.org.hypertrace.agent.config.Reporting\x12>\n\x0c\x64\x61ta_capture\x18\x03 \x01(\x0b\x32(.org.hypertrace.agent.config.DataCapture\x12K\n\x13propagation_formats\x18\x04 \x03(\x0e\x32..org.hypertrace.agent.config.PropagationFormat\x12+\n\x07\x65nabled\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x39\n\tjavaagent\x18\x06 \x01(\x0b\x32&.org.hypertrace.agent.config.JavaAgent\x12]\n\x13resource_attributes\x18\x07 \x03(\x0b\x32@.org.hypertrace.agent.config.AgentConfig.ResourceAttributesEntry\x1a\x39\n\x17ResourceAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x90\x02\n\tReporting\x12.\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12*\n\x06secure\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12+\n\x05token\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12-\n\x03opa\x18\x04 \x01(\x0b\x32 .org.hypertrace.agent.config.Opa\x12K\n\x13trace_reporter_type\x18\x05 \x01(\x0e\x32..org.hypertrace.agent.config.TraceReporterType\"\x9c\x01\n\x03Opa\x12.\n\x08\x65ndpoint\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.StringValue\x12\x38\n\x13poll_period_seconds\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12+\n\x07\x65nabled\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"d\n\x07Message\x12+\n\x07request\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12,\n\x08response\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\xb0\x02\n\x0b\x44\x61taCapture\x12:\n\x0chttp_headers\x18\x01 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12\x37\n\thttp_body\x18\x02 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12:\n\x0crpc_metadata\x18\x03 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12\x36\n\x08rpc_body\x18\x04 \x01(\x0b\x32$.org.hypertrace.agent.config.Message\x12\x38\n\x13\x62ody_max_size_bytes\x18\x05 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\"C\n\tJavaAgent\x12\x36\n\x10\x66ilter_jar_paths\x18\x01 \x03(\x0b\x32\x1c.google.protobuf.StringValue*-\n\x11PropagationFormat\x12\x06\n\x02\x42\x33\x10\x00\x12\x10\n\x0cTRACECONTEXT\x10\x01*:\n\x11TraceReporterType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\n\n\x06ZIPKIN\x10\x01\x12\x08\n\x04OTLP\x10\x02\x42\x43\n\x1borg.hypertrace.agent.configZ$github.com/hypertrace/goagent/configb\x06proto3')
,
dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,])
@@ -59,18 +58,15 @@ Module hypertrace.agent.config.config_pb2
full_name='org.hypertrace.agent.config.PropagationFormat',
filename=None,
file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='B3', index=0, number=0,
serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
+ type=None),
_descriptor.EnumValueDescriptor(
name='TRACECONTEXT', index=1, number=1,
serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
+ type=None),
],
containing_type=None,
serialized_options=None,
@@ -85,23 +81,19 @@ Module hypertrace.agent.config.config_pb2
full_name='org.hypertrace.agent.config.TraceReporterType',
filename=None,
file=DESCRIPTOR,
- create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='UNSPECIFIED', index=0, number=0,
serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
+ type=None),
_descriptor.EnumValueDescriptor(
name='ZIPKIN', index=1, number=1,
serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
+ type=None),
_descriptor.EnumValueDescriptor(
name='OTLP', index=2, number=2,
serialized_options=None,
- type=None,
- create_key=_descriptor._internal_create_key),
+ type=None),
],
containing_type=None,
serialized_options=None,
@@ -125,29 +117,28 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='org.hypertrace.agent.config.AgentConfig.ResourceAttributesEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
+ 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='org.hypertrace.agent.config.AgentConfig.ResourceAttributesEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
+ 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
- serialized_options=b'8\001',
+ serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
@@ -163,7 +154,6 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='service_name', full_name='org.hypertrace.agent.config.AgentConfig.service_name', index=0,
@@ -171,49 +161,49 @@ Module hypertrace.agent.config.config_pb2
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='reporting', full_name='org.hypertrace.agent.config.AgentConfig.reporting', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='data_capture', full_name='org.hypertrace.agent.config.AgentConfig.data_capture', index=2,
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='propagation_formats', full_name='org.hypertrace.agent.config.AgentConfig.propagation_formats', index=3,
number=4, 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='enabled', full_name='org.hypertrace.agent.config.AgentConfig.enabled', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='javaagent', full_name='org.hypertrace.agent.config.AgentConfig.javaagent', 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=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='resource_attributes', full_name='org.hypertrace.agent.config.AgentConfig.resource_attributes', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@@ -237,7 +227,6 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='endpoint', full_name='org.hypertrace.agent.config.Reporting.endpoint', index=0,
@@ -245,35 +234,35 @@ Module hypertrace.agent.config.config_pb2
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='secure', full_name='org.hypertrace.agent.config.Reporting.secure', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='token', full_name='org.hypertrace.agent.config.Reporting.token', index=2,
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='opa', full_name='org.hypertrace.agent.config.Reporting.opa', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='trace_reporter_type', full_name='org.hypertrace.agent.config.Reporting.trace_reporter_type', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@@ -297,7 +286,6 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='endpoint', full_name='org.hypertrace.agent.config.Opa.endpoint', index=0,
@@ -305,21 +293,21 @@ Module hypertrace.agent.config.config_pb2
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='poll_period_seconds', full_name='org.hypertrace.agent.config.Opa.poll_period_seconds', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='enabled', full_name='org.hypertrace.agent.config.Opa.enabled', index=2,
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@@ -343,7 +331,6 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='request', full_name='org.hypertrace.agent.config.Message.request', index=0,
@@ -351,14 +338,14 @@ Module hypertrace.agent.config.config_pb2
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='response', full_name='org.hypertrace.agent.config.Message.response', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@@ -382,7 +369,6 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='http_headers', full_name='org.hypertrace.agent.config.DataCapture.http_headers', index=0,
@@ -390,35 +376,35 @@ Module hypertrace.agent.config.config_pb2
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='http_body', full_name='org.hypertrace.agent.config.DataCapture.http_body', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='rpc_metadata', full_name='org.hypertrace.agent.config.DataCapture.rpc_metadata', index=2,
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='rpc_body', full_name='org.hypertrace.agent.config.DataCapture.rpc_body', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='body_max_size_bytes', full_name='org.hypertrace.agent.config.DataCapture.body_max_size_bytes', 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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@@ -442,7 +428,6 @@ Module hypertrace.agent.config.config_pb2
filename=None,
file=DESCRIPTOR,
containing_type=None,
- create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='filter_jar_paths', full_name='org.hypertrace.agent.config.JavaAgent.filter_jar_paths', index=0,
@@ -450,7 +435,7 @@ Module hypertrace.agent.config.config_pb2
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, create_key=_descriptor._internal_create_key),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@@ -501,54 +486,54 @@ Module hypertrace.agent.config.config_pb2
DESCRIPTOR.enum_types_by_name['TraceReporterType'] = _TRACEREPORTERTYPE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-AgentConfig = _reflection.GeneratedProtocolMessageType('AgentConfig', (_message.Message,), {
+AgentConfig = _reflection.GeneratedProtocolMessageType('AgentConfig', (_message.Message,), dict(
- 'ResourceAttributesEntry' : _reflection.GeneratedProtocolMessageType('ResourceAttributesEntry', (_message.Message,), {
- 'DESCRIPTOR' : _AGENTCONFIG_RESOURCEATTRIBUTESENTRY,
- '__module__' : 'config_pb2'
+ ResourceAttributesEntry = _reflection.GeneratedProtocolMessageType('ResourceAttributesEntry', (_message.Message,), dict(
+ DESCRIPTOR = _AGENTCONFIG_RESOURCEATTRIBUTESENTRY,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.AgentConfig.ResourceAttributesEntry)
- })
+ ))
,
- 'DESCRIPTOR' : _AGENTCONFIG,
- '__module__' : 'config_pb2'
+ DESCRIPTOR = _AGENTCONFIG,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.AgentConfig)
- })
+ ))
_sym_db.RegisterMessage(AgentConfig)
_sym_db.RegisterMessage(AgentConfig.ResourceAttributesEntry)
-Reporting = _reflection.GeneratedProtocolMessageType('Reporting', (_message.Message,), {
- 'DESCRIPTOR' : _REPORTING,
- '__module__' : 'config_pb2'
+Reporting = _reflection.GeneratedProtocolMessageType('Reporting', (_message.Message,), dict(
+ DESCRIPTOR = _REPORTING,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.Reporting)
- })
+ ))
_sym_db.RegisterMessage(Reporting)
-Opa = _reflection.GeneratedProtocolMessageType('Opa', (_message.Message,), {
- 'DESCRIPTOR' : _OPA,
- '__module__' : 'config_pb2'
+Opa = _reflection.GeneratedProtocolMessageType('Opa', (_message.Message,), dict(
+ DESCRIPTOR = _OPA,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.Opa)
- })
+ ))
_sym_db.RegisterMessage(Opa)
-Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), {
- 'DESCRIPTOR' : _MESSAGE,
- '__module__' : 'config_pb2'
+Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), dict(
+ DESCRIPTOR = _MESSAGE,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.Message)
- })
+ ))
_sym_db.RegisterMessage(Message)
-DataCapture = _reflection.GeneratedProtocolMessageType('DataCapture', (_message.Message,), {
- 'DESCRIPTOR' : _DATACAPTURE,
- '__module__' : 'config_pb2'
+DataCapture = _reflection.GeneratedProtocolMessageType('DataCapture', (_message.Message,), dict(
+ DESCRIPTOR = _DATACAPTURE,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.DataCapture)
- })
+ ))
_sym_db.RegisterMessage(DataCapture)
-JavaAgent = _reflection.GeneratedProtocolMessageType('JavaAgent', (_message.Message,), {
- 'DESCRIPTOR' : _JAVAAGENT,
- '__module__' : 'config_pb2'
+JavaAgent = _reflection.GeneratedProtocolMessageType('JavaAgent', (_message.Message,), dict(
+ DESCRIPTOR = _JAVAAGENT,
+ __module__ = 'config_pb2'
# @@protoc_insertion_point(class_scope:org.hypertrace.agent.config.JavaAgent)
- })
+ ))
_sym_db.RegisterMessage(JavaAgent)
diff --git a/docs/hypertrace/agent/config/file.html b/docs/hypertrace/agent/config/file.html
index f9904e16..7a5c5579 100644
--- a/docs/hypertrace/agent/config/file.html
+++ b/docs/hypertrace/agent/config/file.html
@@ -47,7 +47,7 @@ Module hypertrace.agent.config.file
try:
path = os.path.abspath(filepath)
- file = open(path, 'r')
+ file = open(path, 'r') # pylint: disable=R1732
from_file_config = yaml.load(file, Loader=yaml.FullLoader)
file.close()
@@ -87,7 +87,7 @@
try:
path = os.path.abspath(filepath)
- file = open(path, 'r')
+ file = open(path, 'r') # pylint: disable=R1732
from_file_config = yaml.load(file, Loader=yaml.FullLoader)
file.close()
diff --git a/docs/hypertrace/agent/config/index.html b/docs/hypertrace/agent/config/index.html
index b5325cfb..9503ad73 100644
--- a/docs/hypertrace/agent/config/index.html
+++ b/docs/hypertrace/agent/config/index.html
@@ -252,7 +252,7 @@
hypertrace.agent.config.config_pb2
-
-
Generated protocol buffer code.
+
hypertrace.agent.config.default
-
diff --git a/docs/hypertrace/agent/index.html b/docs/hypertrace/agent/index.html
index fea47d67..3ddf65fe 100644
--- a/docs/hypertrace/agent/index.html
+++ b/docs/hypertrace/agent/index.html
@@ -31,6 +31,7 @@
Module hypertrace.agent
import os
import os.path
import sys
+import threading
import logging
import traceback
import flask
@@ -46,8 +47,6 @@ Module hypertrace.agent
try:
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
- handler = logging.FileHandler('agent.log', mode='a')
- handler.setFormatter(formatter)
screen_handler = logging.StreamHandler(stream=sys.stdout)
screen_handler.setFormatter(formatter)
log_level = logging.INFO
@@ -69,7 +68,6 @@ Module hypertrace.agent
if ht_log_level == 'NOTSET':
log_level = logging.NOTSET
logger_.setLevel(log_level)
- logger_.addHandler(handler)
logger_.addHandler(screen_handler)
return logger_
except Exception as err: # pylint: disable=W0703
@@ -87,21 +85,36 @@ Module hypertrace.agent
class Agent:
'''Top-level entry point for Hypertrace agent.'''
+ _instance = None
+ _singleton_lock = threading.Lock()
+
+ def __new__(cls):
+ '''constructor'''
+ if cls._instance is None:
+ with cls._singleton_lock:
+ logger.debug('Creating Agent')
+ cls._instance = super(Agent, cls).__new__(cls)
+ cls._instance._initialized = False
+ else:
+ logger.debug('Using existing Agent.')
+ return cls._instance
def __init__(self):
- '''Constructor'''
- logger.debug('Initializing Agent.')
- if not self.is_enabled():
- return
- try:
- self._config = AgentConfig()
- self._init = AgentInit(self._config)
- except Exception as err: # pylint: disable=W0703
- logger.error('Failed to initialize Agent: exception=%s, stacktrace=%s',
- err,
- traceback.format_exc())
+ '''Initializer'''
+ if not self._initialized: # pylint: disable=E0203:
+ logger.debug('Initializing Agent.')
+ if not self.is_enabled():
+ return
+ try:
+ self._config = AgentConfig()
+ self._init = AgentInit(self._config)
+ self._initialized = True
+ except Exception as err: # pylint: disable=W0703
+ logger.error('Failed to initialize Agent: exception=%s, stacktrace=%s',
+ err,
+ traceback.format_exc())
- def register_flask_app(self, app: flask.Flask) -> None:
+ def register_flask_app(self, app: flask.Flask = None) -> None:
'''Register the flask instrumentation module wrapper'''
logger.debug('Calling Agent.register_flask_app.')
if not self.is_enabled():
@@ -219,6 +232,10 @@ Module hypertrace.agent
+hypertrace.agent.autoinstrumentation
+-
+
+
hypertrace.agent.config
-
Agent configuration logic that pull in values from a defaults list,
@@ -257,8 +274,6 @@
try:
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
- handler = logging.FileHandler('agent.log', mode='a')
- handler.setFormatter(formatter)
screen_handler = logging.StreamHandler(stream=sys.stdout)
screen_handler.setFormatter(formatter)
log_level = logging.INFO
@@ -280,7 +295,6 @@
if ht_log_level == 'NOTSET':
log_level = logging.NOTSET
logger_.setLevel(log_level)
- logger_.addHandler(handler)
logger_.addHandler(screen_handler)
return logger_
except Exception as err: # pylint: disable=W0703
@@ -300,28 +314,43 @@
-
Top-level entry point for Hypertrace agent.
-
Constructor
+Initializer
Expand source code
class Agent:
'''Top-level entry point for Hypertrace agent.'''
+ _instance = None
+ _singleton_lock = threading.Lock()
+
+ def __new__(cls):
+ '''constructor'''
+ if cls._instance is None:
+ with cls._singleton_lock:
+ logger.debug('Creating Agent')
+ cls._instance = super(Agent, cls).__new__(cls)
+ cls._instance._initialized = False
+ else:
+ logger.debug('Using existing Agent.')
+ return cls._instance
def __init__(self):
- '''Constructor'''
- logger.debug('Initializing Agent.')
- if not self.is_enabled():
- return
- try:
- self._config = AgentConfig()
- self._init = AgentInit(self._config)
- except Exception as err: # pylint: disable=W0703
- logger.error('Failed to initialize Agent: exception=%s, stacktrace=%s',
- err,
- traceback.format_exc())
+ '''Initializer'''
+ if not self._initialized: # pylint: disable=E0203:
+ logger.debug('Initializing Agent.')
+ if not self.is_enabled():
+ return
+ try:
+ self._config = AgentConfig()
+ self._init = AgentInit(self._config)
+ self._initialized = True
+ except Exception as err: # pylint: disable=W0703
+ logger.error('Failed to initialize Agent: exception=%s, stacktrace=%s',
+ err,
+ traceback.format_exc())
- def register_flask_app(self, app: flask.Flask) -> None:
+ def register_flask_app(self, app: flask.Flask = None) -> None:
'''Register the flask instrumentation module wrapper'''
logger.debug('Calling Agent.register_flask_app.')
if not self.is_enabled():
@@ -480,7 +509,7 @@ Methods
-def register_flask_app(self, app: flask.app.Flask) ‑> NoneType
+def register_flask_app(self, app: flask.app.Flask = None) ‑> NoneType
-
Register the flask instrumentation module wrapper
@@ -488,7 +517,7 @@ Methods
Expand source code
-def register_flask_app(self, app: flask.Flask) -> None:
+def register_flask_app(self, app: flask.Flask = None) -> None:
'''Register the flask instrumentation module wrapper'''
logger.debug('Calling Agent.register_flask_app.')
if not self.is_enabled():
@@ -659,6 +688,7 @@ Index
-
+hypertrace.agent.autoinstrumentation
hypertrace.agent.config
hypertrace.agent.constants
hypertrace.agent.init
diff --git a/docs/hypertrace/agent/init/index.html b/docs/hypertrace/agent/init/index.html
index f4fa1c7b..4fc4ce3f 100644
--- a/docs/hypertrace/agent/init/index.html
+++ b/docs/hypertrace/agent/init/index.html
@@ -63,7 +63,6 @@ Module hypertrace.agent.init
"requests": False,
"aiohttp_client": False
}
-
self._tracer_provider = None
try:
@@ -152,12 +151,30 @@ Module hypertrace.agent.init
'''Creates a flask instrumentation wrapper using the config defined in hypertraceconfig'''
logger.debug('Calling AgentInit.flaskInit().')
try:
+ if self.is_registered('flask'):
+ return
from hypertrace.agent.instrumentation.flask import FlaskInstrumentorWrapper # pylint: disable=C0415
self._modules_initialized['flask'] = True
self._flask_instrumentor_wrapper = FlaskInstrumentorWrapper()
- self._flask_instrumentor_wrapper.instrument_app(app)
+ call_default_instrumentor = True
+ # There are two ways to initialize the flask instrumenation
+ # wrapper. The first (and original way) instruments the specific
+ # Flask object that is passed in). The second way is to globally
+ # replace the Flask class definition with the hypertrace instrumentation
+ # wrapper class.
+ #
+ # If an app object is provided, then the flask wrapper is initialized
+ # by calling the instrument_app method. Then, there is no need to call
+ # instrument() (so, we pass False as the second argument to
+ # self.init_instrumentor_wrapper_base_for_http().
+ #
+ # If no app object was provided, then instrument() is called.
+ if app:
+ self._flask_instrumentor_wrapper.instrument_app(app)
+ call_default_instrumentor = False
self.init_instrumentor_wrapper_base_for_http(
- self._flask_instrumentor_wrapper)
+ self._flask_instrumentor_wrapper,
+ call_default_instrumentor)
except Exception as err: # pylint: disable=W0703
logger.error(constants.INST_WRAP_EXCEPTION_MSSG,
'flask',
@@ -168,6 +185,8 @@ Module hypertrace.agent.init
'''Creates a grpc server wrapper based on hypertrace config'''
logger.debug('Calling AgentInit.grpcServerInit')
try:
+ if self.is_registered('grpc:server'):
+ return
from hypertrace.agent.instrumentation.grpc import ( # pylint: disable=C0415
GrpcInstrumentorServerWrapper
)
@@ -195,6 +214,8 @@ Module hypertrace.agent.init
'''Creates a grpc client wrapper using the config defined in hypertraceconfig'''
logger.debug('Calling AgentInit.grpcClientInit')
try:
+ if self.is_registered('grpc:client'):
+ return
from hypertrace.agent.instrumentation.grpc import ( # pylint: disable=C0415
GrpcInstrumentorClientWrapper
)
@@ -223,6 +244,8 @@ Module hypertrace.agent.init
'''Creates a mysql server wrapper using the config defined in hypertraceconfig'''
logger.debug('Calling AgentInit.mysqlInit()')
try:
+ if self.is_registered('mysql'):
+ return
from hypertrace.agent.instrumentation.mysql import ( # pylint: disable=C0415
MySQLInstrumentorWrapper
)
@@ -241,6 +264,8 @@ Module hypertrace.agent.init
'''Creates a postgresql client wrapper using the config defined in hypertraceconfig'''
logger.debug('Calling AgentInit.postgreSQLInit()')
try:
+ if self.is_registered('postgresql'):
+ return
from hypertrace.agent.instrumentation.postgresql import ( # pylint: disable=C0415
PostgreSQLInstrumentorWrapper
)
@@ -259,6 +284,8 @@ Module hypertrace.agent.init
'''Creates a requests client wrapper using the config defined in hypertraceconfig'''
logger.debug('Calling AgentInit.requestsInit()')
try:
+ if self.is_registered('requests'):
+ return
from hypertrace.agent.instrumentation.requests import ( # pylint: disable=C0415
RequestsInstrumentorWrapper
)
@@ -277,6 +304,8 @@ Module hypertrace.agent.init
'''Creates an aiohttp-client wrapper using the config defined in hypertraceconfig'''
logger.debug('Calling AgentInit.aioHttpClientInit()')
try:
+ if self.is_registered('aiohttp_client'):
+ return
from hypertrace.agent.instrumentation.aiohttp import ( # pylint: disable=C0415
AioHttpClientInstrumentorWrapper
)
@@ -291,10 +320,13 @@ Module hypertrace.agent.init
traceback.format_exc())
# Common wrapper initialization logic
- def init_instrumentor_wrapper_base_for_http(self, instrumentor) -> None:
+ def init_instrumentor_wrapper_base_for_http(self,
+ instrumentor,
+ call_instrument: bool = True) -> None:
'''Common wrapper initialization logic'''
logger.debug('Calling AgentInit.initInstrumentorWrapperBaseForHTTP().')
- instrumentor.instrument()
+ if call_instrument:
+ instrumentor.instrument()
instrumentor.set_process_request_headers(
self._config.agent_config.data_capture.http_headers.request)
instrumentor.set_process_request_body(
@@ -352,7 +384,14 @@ Module hypertrace.agent.init
except Exception as err: # pylint: disable=W0703
logger.error('Failed to initialize OTLP exporter: exception=%s, stacktrace=%s',
err,
- traceback.format_exc())
+ traceback.format_exc())
+
+ def is_registered(self, module: str) -> bool:
+ '''Is an instrumentation module already registered?'''
+ try:
+ return self._modules_initialized[module]
+ except Exception as err: # pylint: disable=W0703,W0612
+ return False