Skip to content

Commit

Permalink
Fix typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Aug 8, 2024
1 parent d3b9a92 commit 9f79a6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/datadog/core/crashtracking/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def self.build(settings, agent_settings, logger:)
logger.warn('Missing path_to_crashtracking_receiver_binary; cannot enable crash tracking')
end

return if [agent_base_url, ld_library_path, path_to_crashtracking_receiver_binary].any?(&:nil?)
return unless agent_base_url
return unless ld_library_path
return unless path_to_crashtracking_receiver_binary

new(
tags: tags,
Expand Down
13 changes: 6 additions & 7 deletions lib/datadog/core/crashtracking/tag_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ def self.call(settings)
'runtime-id' => Environment::Identity.id,
'runtime_platform' => Environment::Identity.lang_platform,
'runtime_version' => Environment::Identity.lang_version,
}

hash['env'] = settings.env if settings.env
hash['service'] = settings.service if settings.service
hash['version'] = settings.version if settings.version
hash['git.repository_url'] = Environment::Git.git_repository_url if Environment::Git.git_repository_url
hash['git.commit.sha'] = Environment::Git.git_commit_sha if Environment::Git.git_commit_sha
'env' => settings.env,
'service' => settings.service,
'version' => settings.version,
'git.repository_url' => Environment::Git.git_repository_url,
'git.commit.sha' => Environment::Git.git_commit_sha,
}.compact

# Make sure everything is an utf-8 string, to avoid encoding issues in downstream
settings.tags.merge(hash).each_with_object({}) do |(key, value), h|
Expand Down

0 comments on commit 9f79a6c

Please sign in to comment.