Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up some of the open telemetry issues #8650

Merged
merged 5 commits into from
Dec 19, 2023
Merged

Conversation

jpinz
Copy link
Contributor

@jpinz jpinz commented Dec 19, 2023

This pull request primarily focuses on enhancing the OpenTelemetry integration within the Dependabot system, with changes spanning across multiple files. The main changes include the addition of shutdown and force_flush methods to the TracerProvider class, ensuring the shutdown of the OpenTelemetry exporter in the run method, and renaming the spans in perform_job methods while also setting the attribute for JOB_ID.

Changes to Dependabot's OpenTelemetry usage:

  • updater/lib/dependabot/base_command.rb: Ensured the shutdown of the OpenTelemetry exporter in the run method. This ensures that the OpenTelemetry system is properly closed when the run method finishes execution.
  • updater/lib/dependabot/opentelemetry.rb: Added a shutdown method to the OpenTelemetry class in Dependabot. This method invokes the force_flush and shutdown methods on the tracer_provider of OpenTelemetry if it should be configured.

Changes to OpenTelemetry spans:

  • updater/lib/dependabot/file_fetcher_command.rb and updater/lib/dependabot/update_files_command.rb: Renamed the spans in perform_job methods from "perform_job" to "file_fetcher" and "update_files" respectively. Also, set the attribute for JOB_ID on the span. This provides more specific information about the job being performed in the telemetry data. [1] [2]

@jpinz jpinz self-assigned this Dec 19, 2023
@jpinz jpinz requested a review from a team as a code owner December 19, 2023 19:31
Comment on lines +65 to +70

sig { params(timeout: T.nilable(Numeric)).void }
def shutdown(timeout: nil); end

sig { params(timeout: T.nilable(Numeric)).void }
def force_flush(timeout: nil); end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: I need to upstream these too Shopify/rbi-central#189

@jakecoffman jakecoffman merged commit b05d6ed into main Dec 19, 2023
@jakecoffman jakecoffman deleted the jupinzer/otel-follow-up branch December 19, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants