0
0
Fork 0

Add OpenTelemetry VCS attributes (#32904)

This commit is contained in:
Renaud Chaput 2024-11-18 09:41:09 +01:00 committed by GitHub
parent 1c6f53e70f
commit bcf5d30e01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 167 additions and 152 deletions

View file

@ -65,6 +65,13 @@ if ENV.keys.any? { |name| name.match?(/OTEL_.*_ENDPOINT/) }
"#{prefix}#{separator}#{$PROGRAM_NAME.split('/').last}"
end
c.service_version = Mastodon::Version.to_s
if Mastodon::Version.source_commit.present?
c.resource = OpenTelemetry::SDK::Resources::Resource.create(
'vcs.repository.ref.revision' => Mastodon::Version.source_commit,
'vcs.repository.url.full' => Mastodon::Version.source_base_url
)
end
end
end