open-telemetry / opentelemetry-python-contrib

OpenTelemetry instrumentation for Python modules
https://opentelemetry.io
Apache License 2.0
722 stars 593 forks source link

Redis attributes not aligned with latest semantic conventions #2885

Open luke6Lh43 opened 3 weeks ago

luke6Lh43 commented 3 weeks ago

Describe your environment

OS: macOS Sequoia Architecture: x86_64 (Intel processor) Python: 3.12.5

opentelemetry-api==1.27.0 opentelemetry-distro==0.48b0 opentelemetry-exporter-otlp==1.27.0 opentelemetry-exporter-otlp-proto-common==1.27.0 opentelemetry-exporter-otlp-proto-grpc==1.27.0 opentelemetry-exporter-otlp-proto-http==1.27.0 opentelemetry-instrumentation==0.48b0 opentelemetry-instrumentation-redis==0.48b0 opentelemetry-proto==1.27.0 opentelemetry-sdk==1.27.0 opentelemetry-semantic-conventions==0.48b0

What happened?

Hello,

I have recently been working on a project that required Redis instrumentation for two different languages. During this process, I noticed some discrepancies in the attributes being collected. To investigate further, I conducted testing to check the attributes collected for Redis instrumentation across six of the most popular languages. I have documented my testing in this GitHub repository:

[Link to GitHub Repo]

What We Capture Today ==> How It Should Look in Latest Semantic Conventions

db.statement: GET ? ==> db.statement: GET ? db.system: redis ==> db.system: redis db.redis.database_index: 0 ==> db.namespace: 0 net.peer.name: localhost ==> server.address: localhost net.peer.port: 6379 ==> network.peer.port: 6379 net.transport: ip_tcp ==> Not sure if it's needed db.redis.args_length: 2 ==> Not sure if it's needed

The latest OpenTelemetry semantic conventions for Redis can be found here: OpenTelemetry Semantic Conventions for Redis

Steps to Reproduce

https://github.com/luke6Lh43/otel-redis-testing/blob/main/Readme.md#python

Expected Result

See above

Actual Result

See above

Additional context

No response

Would you like to implement a fix?

None

bourbonkk commented 2 days ago

@luke6Lh43 Are you currently working on this issue?