sample/consumer/consumer.py [20:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OTEL_EXPORTER_OTLP_ENDPOINT = os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT')

OTEL_METRICS_EXPORTER_OTLP_ENDPOINT = os.environ.get('OTEL_METRICS_EXPORTER_OTLP_ENDPOINT')

logging.basicConfig(level=logging.INFO)

# Sends generated traces in the OTLP format to an ADOT Collector running on port 55678
otlp_exporter = OTLPSpanExporter(endpoint=OTEL_EXPORTER_OTLP_ENDPOINT, insecure=True)
# Processes traces in batches as opposed to immediately one after the other
span_processor = BatchSpanProcessor(otlp_exporter)
# Configures the Global Tracer Provider
trace.set_tracer_provider(TracerProvider(active_span_processor=span_processor, id_generator=AwsXRayIdGenerator()))

BotocoreInstrumentor().instrument()

tracer = trace.get_tracer(__name__)

random.seed(time.time())
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



sample/producer/producer.py [25:38]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OTEL_EXPORTER_OTLP_ENDPOINT = os.environ.get('OTEL_EXPORTER_OTLP_ENDPOINT')
OTEL_METRICS_EXPORTER_OTLP_ENDPOINT = os.environ.get('OTEL_METRICS_EXPORTER_OTLP_ENDPOINT')
logging.basicConfig(level=logging.INFO)

# Sends generated traces in the OTLP format to an ADOT Collector running on port 55678
otlp_exporter = OTLPSpanExporter(endpoint=OTEL_EXPORTER_OTLP_ENDPOINT, insecure=True)
# Processes traces in batches as opposed to immediately one after the other
span_processor = BatchSpanProcessor(otlp_exporter)
# Configures the Global Tracer Provider
trace.set_tracer_provider(TracerProvider(active_span_processor=span_processor, id_generator=AwsXRayIdGenerator()))
BotocoreInstrumentor().instrument()
tracer = trace.get_tracer(__name__)

random.seed(time.time())
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



