-
Notifications
You must be signed in to change notification settings - Fork 626
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
Update asyncpg instrumentation to follow semantic conventions #188
Update asyncpg instrumentation to follow semantic conventions #188
Conversation
.../opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py
Outdated
Show resolved
Hide resolved
.../opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some non-blocking comments.
Don't make function call unnecessarily when span is not recording
…39/opentelemetry-python-contrib into asyncpg-semantic-conv
.../opentelemetry-instrumentation-asyncpg/src/opentelemetry/instrumentation/asyncpg/__init__.py
Outdated
Show resolved
Hide resolved
if isinstance(addr, tuple): | ||
span_attributes["net.peer.name"] = addr[0] | ||
span_attributes["net.peer.ip"] = addr[1] | ||
span_attributes["net.transport"] = "IP.TCP" | ||
elif isinstance(addr, str): | ||
span_attributes["net.peer.name"] = addr | ||
span_attributes["net.transport"] = "Unix" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Are there any docs explaining how to parse these out? I think they could be useful to add to the function doc string for _hydrate_span_from_args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connection contains _addr
attribute which is either a host/port tuple, or Unix socket string. May be something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in a467449
…telemetry/instrumentation/asyncpg/__init__.py Co-authored-by: (Eliseo) Nathaniel Ruiz Nowell <enruizno@uwaterloo.ca>
Description
Part of #159
Type of change
How Has This Been Tested?
tox -e test-instrumentation-asyncpg