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

Add Open Telemetry Spans throughout the codebase #8488

Merged
merged 27 commits into from
Dec 7, 2023

Conversation

jpinz
Copy link
Contributor

@jpinz jpinz commented Nov 29, 2023

This pull request introduces OpenTelemetry tracing to various methods in the updater/lib/dependabot/api_client.rb and updater/lib/dependabot/file_fetcher_command.rb files. It also adds new methods and attributes to the updater/lib/dependabot/opentelemetry.rb file to support the tracing. Additionally, it adds a new method to the OpenTelemetry module in the sorbet/rbi/shims/opentelemetry-sdk.rbi file.

OpenTelemetry Tracing:

  • updater/lib/dependabot/api_client.rb: Added OpenTelemetry tracing to the create_pull_request, update_pull_request, close_pull_request, record_update_job_error, record_update_job_unknown_error, mark_job_as_processed, update_dependency_list, increment_metric methods. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • updater/lib/dependabot/file_fetcher_command.rb: Added OpenTelemetry tracing to the perform_job method. [1] [2]

OpenTelemetry Configuration:

  • updater/lib/dependabot/opentelemetry.rb: Added new methods tracer and record_update_job_error and a new Attributes module. Also modified the configure method to print a message when OpenTelemetry is enabled. [1] [2] [3]

Additional Changes:

  • sorbet/rbi/shims/opentelemetry-sdk.rbi: Added a new tracer_provider method to the OpenTelemetry module.
  • updater/lib/dependabot/service.rb: Modified the capture_exception method to record exceptions with OpenTelemetry.
  • updater/lib/dependabot/update_files_command.rb: Added OpenTelemetry tracing to the perform_job method.

@jpinz jpinz self-assigned this Nov 29, 2023
@jpinz jpinz requested a review from a team as a code owner November 29, 2023 22:07
@jpinz jpinz requested a review from JamieMagee December 1, 2023 17:46
@JamieMagee
Copy link
Contributor

I've also upstreamed our opentelemetry-sdk types to rbi-central: Shopify/rbi-central#189. rbi-central is the Ruby equivalent of https://github.com/DefinitelyTyped/DefinitelyTyped for TypeScript.

@jpinz jpinz requested a review from JamieMagee December 4, 2023 18:32
@jakecoffman jakecoffman merged commit ac13cec into main Dec 7, 2023
@jakecoffman jakecoffman deleted the jupinzer/otel_errors branch December 7, 2023 21:13
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