Skip to content

[SB][pyamqp][OTEL] pyamqp tracing is missing values for amqpLink and amqpSession #32190

@nhtgl

Description

@nhtgl
  • Package Name: azure-servicebus==7.11.2
  • Package Version: azure-servicebus==7.11.2, azure-core==1.29.4, azure-core-tracing-opentelemetry==1.0.0b11, azure-monitor-opentelemetry-exporter==1.0.0b17, opentelemetry-*==1.20.0/0.41b
  • Operating System: macOS, Ubuntu, Debian
  • Python Version: 3.10

Describe the bug
We get logs like

2023-09-22 07:40:48.193 [WARNING] [opentelemetry.attributes] __init__._clean_attribute -: Invalid type NoneType for attribute 'amqpLink' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types
2023-09-22 07:40:48.040 [WARNING] [opentelemetry.attributes] __init__._clean_attribute -: Invalid type NoneType for attribute 'amqpSession' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types

Looks like pyamqp distributed tracing is trying to add attributes to the span that are clearly empty.

To Reproduce
Use Azure SB with pyamqp and enable opentelemetry instrumentation. Try sending some messages.

Expected behavior
amqpLink and amqpSession is not an empty value or if it's an empty value then it's not added as attribute to the span.

Screenshots
Zrzut ekranu 2023-09-22 o 10 08 01

Additional context
As a library user I would like to know if there's an issue, but this logs would come up too often and would only increase our bill.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.MessagingMessaging crewService BusbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions