You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your environment
opentelemetry-instrumentation-aiohttp-client==0.33b0
Steps to reproduce
import asyncio
import aiohttp
from opentelemetry import trace
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
from opentelemetry.sdk.trace import TracerProvider, Resource
from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor
trace.set_tracer_provider(
TracerProvider(resource=Resource.create({"service.name": "service1"}))
)
trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(ConsoleSpanExporter()))
tracer = trace.get_tracer(__name__)
AioHttpClientInstrumentor().instrument()
async def check():
aiohttp.ClientSession() # Just another initialisation, could be anywhere in the code
with tracer.start_as_current_span("Parent"):
async with aiohttp.ClientSession() as session:
async with session.request(
'GET',
'https://google.com',
) as response:
await response.read()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(check())
What is the expected behavior?
Trace shoud contain only 2 spans - the one with name=Parent, and one child from actual request
What is the actual behavior?
Trace contains 3 spans. This number increases with more initializations of aiohttp.ClientSession() after AioHttpClientInstrumentor().instrument() is called
i2xS
changed the title
Span doubling in aiohttp-client after multiple aiohttp.ClientSession Initialization
Span doubling-tripling in aiohttp-client after multiple aiohttp.ClientSession Initialization
Sep 1, 2022
Describe your environment
opentelemetry-instrumentation-aiohttp-client==0.33b0
Steps to reproduce
What is the expected behavior?
Trace shoud contain only 2 spans - the one with name=Parent, and one child from actual request
What is the actual behavior?
Trace contains 3 spans. This number increases with more initializations of
aiohttp.ClientSession()
afterAioHttpClientInstrumentor().instrument()
is calledAdditional context
On
opentelemetry-instrumentation-aiohttp-client==0.29b0
the issue is not reproduced.The text was updated successfully, but these errors were encountered: