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

Update asyncpg instrumentation to follow semantic conventions #188

Merged
merged 13 commits into from
Nov 24, 2020

Conversation

srikanthccv
Copy link
Member

Description

Part of #159

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • tox -e test-instrumentation-asyncpg

@srikanthccv srikanthccv requested review from a team, codeboten and hectorhdzg and removed request for a team November 17, 2020 13:20
Copy link
Contributor

@lzchen lzchen left a 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.

Comment on lines +63 to +69
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"
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in a467449

@lzchen lzchen merged commit 7f0d5ae into open-telemetry:master Nov 24, 2020
@srikanthccv srikanthccv deleted the asyncpg-semantic-conv branch December 5, 2020 18:21
nstawski pushed a commit to nstawski/ns-opentelemetry-python-contrib that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants