Skip to content

Commit

Permalink
Make use of OpenTelemetry in the updater
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Aug 5, 2024
1 parent 847c75f commit 819b3cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions updater/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater

# Add ENV
ENV DEPENDABOT_UPDATER_VERSION=$DEPENDABOT_UPDATER_VERSION
ENV OTEL_ENABLED=true

# ENTRYPOINT IS USED instead of CMD so as to avoid adding
# 'bin/run.sh' before the file name when running the image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "base64"
require "dependabot/base_command"
require "dependabot/dependency_snapshot"
require "dependabot/errors"
require "dependabot/opentelemetry"
require "dependabot/updater"
require "octokit"

Expand Down Expand Up @@ -43,15 +45,19 @@ def initialize(job:)
end

def perform_job
# Clone the repo contents then find all files that could contain dependency references
clone_repo_and_snapshot_dependency_files
log_what_we_found
::Dependabot::OpenTelemetry.tracer.in_span("update_files", kind: :internal) do |span|
span.set_attribute(::Dependabot::OpenTelemetry::Attributes::JOB_ID, job_id.to_s)

# Update/close any existing pull requests that are out of date or no longer required
update_all_existing_pull_requests
# Clone the repo contents then find all files that could contain dependency references
clone_repo_and_snapshot_dependency_files
log_what_we_found

# Create new pull requests any dependency [groups] that still need updating (i.e. not in an open PR already)
update_all_dependencies
# Update/close any existing pull requests that are out of date or no longer required
update_all_existing_pull_requests

# Create new pull requests any dependency [groups] that still need updating (i.e. not in an open PR already)
update_all_dependencies
end
end

private
Expand Down

0 comments on commit 819b3cc

Please sign in to comment.