Skip to content

feat: sap.service.display_name in telemetry#223

Merged
LucasAlvesSoares merged 4 commits into
mainfrom
new-resource-attrs
Jul 13, 2026
Merged

feat: sap.service.display_name in telemetry#223
LucasAlvesSoares merged 4 commits into
mainfrom
new-resource-attrs

Conversation

@LucasAlvesSoares

Copy link
Copy Markdown
Contributor

Description

Adds sap.service.display_name as a new optional resource attribute in the SDK's OpenTelemetry telemetry configuration. The attribute is read from the SAP_SERVICE_DISPLAY_NAME environment variable and
follows the same pattern as sap.ord.id and mlflow.experiment_id — omitted entirely from the resource when the variable is unset or empty, so no placeholder noise is emitted.

Changes:

  • Added ATTR_SAP_SERVICE_DISPLAY_NAME = "sap.service.display_name" constant
  • Added ENV_SERVICE_DISPLAY_NAME = "SAP_SERVICE_DISPLAY_NAME" env var
  • Wired the attribute into create_resource_attributes_from_env()
  • Added unit tests covering unset, empty, set, and independence from other optional attributes

Type of Change

  • New feature (non-breaking change that adds functionality)

How to Test

  1. Set SAP_SERVICE_DISPLAY_NAME=My Service in your environment
  2. Initialize the SDK with telemetry enabled
  3. Observe that spans carry the resource attribute sap.service.display_name = "My Service"
  4. Without the env var set, confirm the attribute is absent from the resource

@LucasAlvesSoares LucasAlvesSoares marked this pull request as ready for review July 13, 2026 14:31
@LucasAlvesSoares LucasAlvesSoares requested a review from a team as a code owner July 13, 2026 14:31
@LucasAlvesSoares LucasAlvesSoares merged commit d35af86 into main Jul 13, 2026
10 of 11 checks passed
@LucasAlvesSoares LucasAlvesSoares deleted the new-resource-attrs branch July 13, 2026 14:43
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.

2 participants