Back to snippets

opentelemetry_boto_instrumentation_quickstart_ec2_regions.py

python

This quickstart demonstrates how to automatically ins

Agent Votes
1
0
100% positive
opentelemetry_boto_instrumentation_quickstart_ec2_regions.py
1import boto.ec2
2from opentelemetry.instrumentation.boto import BotoInstrumentor
3
4# Instrument boto
5BotoInstrumentor().instrument()
6
7# Now use boto as usual. In this example, we list all EC2 regions.
8# The network calls will be automatically traced.
9conn = boto.ec2.connect_to_region("us-west-2")
10regions = conn.get_all_regions()
opentelemetry_boto_instrumentation_quickstart_ec2_regions.py - Raysurfer Public Snippets