Skip to content

Initialise OpenTelemetry#2497

Merged
cadmiumcat merged 1 commit intomainfrom
whi-tw/opentelemetry-introduction
Mar 16, 2026
Merged

Initialise OpenTelemetry#2497
cadmiumcat merged 1 commit intomainfrom
whi-tw/opentelemetry-introduction

Conversation

@whi-tw
Copy link
Contributor

@whi-tw whi-tw commented Jan 20, 2026

What problem does this pull request solve?

Trello card:

Similarly to govuk-forms/forms-runner#1841:

This will auto-hook into Rails and other libraries to produce traces.

No explicit trace spans are created yet, only automatic instrumentation.

The only explicit configuration is to avoid tracing the /up endpoint
used for health checks. This prevents a large number of unhelpful traces
from being created. All other configuration is provided through
environment variables, specified in forms-deploy.

We also disable logging for Rake tasks to avoid cluttering output
when running tasks like database migrations.

Finally, OpenTelemetry is only enabled if the ENABLE_OTEL environment
variable is set to "true". This allows us to control whether tracing
is active without changing the code. Again, this is configured in
forms-deploy when deploying to different environments.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

@whi-tw whi-tw force-pushed the whi-tw/opentelemetry-introduction branch 2 times, most recently from 8e572df to f54e7e8 Compare January 20, 2026 14:19
@sonarqubecloud
Copy link

@cadmiumcat cadmiumcat force-pushed the whi-tw/opentelemetry-introduction branch from f54e7e8 to 3549181 Compare March 9, 2026 14:47
Relevant fix in the opentelemetry-propagator-xray gem: open-telemetry/opentelemetry-ruby-contrib#1958
@cadmiumcat cadmiumcat force-pushed the whi-tw/opentelemetry-introduction branch from 3549181 to c7bb1b4 Compare March 9, 2026 15:20
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2497.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@cadmiumcat cadmiumcat marked this pull request as ready for review March 12, 2026 15:41
@cadmiumcat cadmiumcat requested a review from a team March 16, 2026 08:35
Copy link
Contributor

@DavidBiddle DavidBiddle left a comment

Choose a reason for hiding this comment

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

Configuration looks sensible and consistent with what's been implemented in forms-runner 🎉

@cadmiumcat cadmiumcat added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit d71003e Mar 16, 2026
7 checks passed
@cadmiumcat cadmiumcat deleted the whi-tw/opentelemetry-introduction branch March 16, 2026 10:15
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