-
Notifications
You must be signed in to change notification settings - Fork 0
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
[WIP] semantic convention 1.20.0 verification - database instrumentation - redis #1
Conversation
verifies the database semantic convention for redis (1.20.0) fixes minor issues with attributes to align with specification
eb1b0b3
to
1869024
Compare
) | ||
attributes[SpanAttributes.NET_PEER_PORT] = conn_kwargs.get( | ||
"port", 6379 | ||
"host", "TRACE_MISSING" |
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.
Is there a sentinel defined for a missing value when one is expected? None
may be sufficient, but I wasn't sure.
Defaulting to localhost
and 6379
might obfuscate an issue.
|
||
if conn_kwargs.get("client_name"): | ||
# TODO: add to semconv? | ||
attributes["db.redis.client_name"] = conn_kwargs["client_name"] |
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.
This isn't in the semconv, but would be useful for debugging and can be different from username
.
self.assertEqual(span.attributes.get("net.peer.port"), 12345) | ||
self.assertEqual(span.attributes.get("net.transport"), "ip_tcp") | ||
self.assertEqual(span.attributes.get("db.statement"), "SET ? ?") | ||
self.assertEqual(span.attributes.get("db.redis.database_index"), 0) |
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.
Do I also need to check the negative (e.g. assertNotIn("net.sock.family", span.attributes)
)?
Description
This CR adds test to verify the semantic conventions for database instrumentation, specifically redis (other DBs to follow). Once the dependent PR is merged, we can move this PR to
main
Fixes open-telemetry#1627
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
net.transport
shouldnet.sock.family
for socket connections and"UNIX"
should be lower-case. Not sure if that needs to be updated or just wait until we get in sync with the latest).