open-telemetry/opentelemetry-php

service.version being set by Composer

クローズ

#1,320 opened on 2024/06/05

 (3 件のコメント) (0 件のリアクション) (0 人の担当者)PHP (224 件のフォーク)auto 404
bite sizedbughelp wanted

Repository metrics

Stars
 (894 個のスター)
PR merge metrics
 (平均マージ 5d 5h) (30d で 5 merged PRs)

説明

@julianocosta89 opened a slack thread to discuss seeing the service.version resource attribute set, even though it was not being set by default.

After getting more clarity in the #otel-community-demo channel, @puckpuck mentioned the following:

I did some sleuthing. This is set in the Composer detector here: https://github.com/open-telemetry/opentelemetry-php/blob/main/src/SDK/Resource/Detectors/Composer.php#L23-L26
Within Composer if you don't have a version set you will get the Default version which matches what we see in the otel-demo https://github.com/composer/composer/blob/main/src/Composer/Package/RootPackage.php#L22
I wonder if we should be using the version from Composer if it is set to the Default (unset)?


We should probably determine how we want to handle this service.version in the future. Other SIGs do not set this by default, so perhaps maybe we shouldn't have composer set this value if possible.

コントリビューターガイド