0
0

Feature more otel customization (#31998)

This commit is contained in:
Tim Campbell 2024-09-23 10:55:35 +02:00 committed by GitHub
parent ed90d9342e
commit 11eae691ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,11 +57,12 @@ if ENV.keys.any? { |name| name.match?(/OTEL_.*_ENDPOINT/) }
}) })
prefix = ENV.fetch('OTEL_SERVICE_NAME_PREFIX', 'mastodon') prefix = ENV.fetch('OTEL_SERVICE_NAME_PREFIX', 'mastodon')
separator = ENV.fetch('OTEL_SERVICE_NAME_SEPARATOR', '/')
c.service_name = case $PROGRAM_NAME c.service_name = case $PROGRAM_NAME
when /puma/ then "#{prefix}/web" when /puma/ then "#{prefix}#{separator}web"
else else
"#{prefix}/#{$PROGRAM_NAME.split('/').last}" "#{prefix}#{separator}#{$PROGRAM_NAME.split('/').last}"
end end
c.service_version = Mastodon::Version.to_s c.service_version = Mastodon::Version.to_s
end end