Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opentelemetry-instrumentation-pymongo is not checking suppress_information #687

Closed
andrew-matteson opened this issue Sep 20, 2021 · 0 comments · Fixed by #736
Closed

opentelemetry-instrumentation-pymongo is not checking suppress_information #687

andrew-matteson opened this issue Sep 20, 2021 · 0 comments · Fixed by #736
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@andrew-matteson
Copy link
Contributor

Describe your environment

  • Python 3.9
  • opentelemetry-instrumentation-pymongo==0.23b2

Steps to reproduce
A method polls our database waiting for success. We've tried to add suppression for this because we get many 10s of segments for this polling, but spans still get generated.

  ctx = set_value("suppress_instrumentation", True)

  with tracer.start_as_current_span("polling", ctx):
      tt = time.time()
      while timeout is None or float(timeout) > time.time() - tt:
          status = cls.status(job_id)
          if not status.is_pending():
              return
          await asyncio.sleep(increment)

Invoking cls.status(job_id) does a mongo query to determine status.

What is the expected behavior?
I expect that the mongo query triggered by the status call doesn't generate a span.

What is the actual behavior?
many 10s of spans are included in the output of the instrumentation.

Additional context
There's a possibility I'm invoking the code wrong here (I'm new to OpenTelemetry), but the implementation for PyMongo doesn't reference the suppression key like other libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
2 participants