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

TypeError with pymongo getMore operations #1012

Closed
DrMcTaco opened this issue Aug 18, 2020 · 0 comments · Fixed by #1132
Closed

TypeError with pymongo getMore operations #1012

DrMcTaco opened this issue Aug 18, 2020 · 0 comments · Fixed by #1132
Labels
bug Something isn't working

Comments

@DrMcTaco
Copy link

DrMcTaco commented Aug 18, 2020

Describe your environment
Describe your environment
Mac OS Catalina 10.15.6 (19G73)
Darwin-19.6.0-x86_64-i386-64bit
Python 3.7.7
Installed packages:

opentelemetry-api                      0.12b0    OpenTelemetry Python API
opentelemetry-ext-honeycomb            0.5b0     Honeycomb Exporter for OpenTelemetry
opentelemetry-instrumentation          0.12b0    Instrumentation Tools & Auto Instrumentation for OpenTelemetry Python
opentelemetry-instrumentation-botocore 0.12b0    OpenTelemetry Botocore instrumentation
opentelemetry-instrumentation-pymongo  0.12b0    OpenTelemetry pymongo instrumentation
opentelemetry-instrumentation-requests 0.12b0    OpenTelemetry requests instrumentation
pymongo                                3.11.0    Python driver for MongoDB <http://www.mongodb.org>

Steps to reproduce
any find operation where the number of documents to be returned exceeds the batch size on the cursor:

from pymongo import MongoClient
from opentelemetry import trace
from opentelemetry.trace import TracerProvider
from opentelemetry.instrumentation.pymongo import PymongoInstrumentor

trace.set_tracer_provider(TracerProvider())

PymongoInstrumentor().instrument()
client = MongoClient()
db = client["MongoDB_Database"]
collection = db["MongoDB_Collection"]
collection.find({'batch_size': 1})

What is the expected behavior?
Spans with names like mongodb.getMore.1

What is the actual behavior?

Traceback (most recent call last):
  File "/Users/drubin/cargurus/analytics/snowblower/.venv/lib/python3.7/site-packages/pymongo/monitoring.py", line 1266, in publish_command_start
    subscriber.started(event)
  File "/Users/drubin/cargurus/analytics/snowblower/.venv/lib/python3.7/site-packages/opentelemetry/instrumentation/pymongo/__init__.py", line 69, in started
    name += "." + command
TypeError: can only concatenate str (not "int") to str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant