[WIP] semantic convention 1.20.0 verification - database instrumentation - redis#1
Closed
cBiscuitSurprise wants to merge 1 commit intolmolkova:update-semconvfrom
Closed
[WIP] semantic convention 1.20.0 verification - database instrumentation - redis#1cBiscuitSurprise wants to merge 1 commit intolmolkova:update-semconvfrom
cBiscuitSurprise wants to merge 1 commit intolmolkova:update-semconvfrom
Conversation
verifies the database semantic convention for redis (1.20.0) fixes minor issues with attributes to align with specification
eb1b0b3 to
1869024
Compare
cBiscuitSurprise
commented
Sep 2, 2023
| ) | ||
| attributes[SpanAttributes.NET_PEER_PORT] = conn_kwargs.get( | ||
| "port", 6379 | ||
| "host", "TRACE_MISSING" |
Author
There was a problem hiding this comment.
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.
cBiscuitSurprise
commented
Sep 2, 2023
|
|
||
| if conn_kwargs.get("client_name"): | ||
| # TODO: add to semconv? | ||
| attributes["db.redis.client_name"] = conn_kwargs["client_name"] |
Author
There was a problem hiding this comment.
This isn't in the semconv, but would be useful for debugging and can be different from username.
cBiscuitSurprise
commented
Sep 2, 2023
| 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) |
Author
There was a problem hiding this comment.
Do I also need to check the negative (e.g. assertNotIn("net.sock.family", span.attributes))?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainFixes 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.transportshouldnet.sock.familyfor 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).