Skip to content

wip: do more otel things#1840

Draft
whi-tw wants to merge 2 commits intomainfrom
whi-tw/custom-otel-stuff
Draft

wip: do more otel things#1840
whi-tw wants to merge 2 commits intomainfrom
whi-tw/custom-otel-stuff

Conversation

@whi-tw
Copy link
Member

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

What problem does this pull request solve?

Add custom spans and metadata to traces

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 from a9c761d to 452041f Compare January 14, 2026 14:39
@whi-tw whi-tw force-pushed the whi-tw/custom-otel-stuff branch from 4e2c839 to 9f8e4f8 Compare January 14, 2026 14:40
@whi-tw whi-tw force-pushed the whi-tw/opentelemetry-introduction branch from 452041f to 5f2a11d Compare January 14, 2026 14:49
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.
@whi-tw whi-tw force-pushed the whi-tw/opentelemetry-introduction branch from 5f2a11d to 319e15c Compare January 15, 2026 11:21
@@ -0,0 +1,117 @@
class TelemetryService
Copy link
Member

Choose a reason for hiding this comment

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

Could we use the Rails.event framework? It's pretty new, so we might still have to roll-our-own, but it would at least be consistent with the future direction and maybe in future it would be supported out of the box by OpenTelemetry.

@whi-tw whi-tw force-pushed the whi-tw/custom-otel-stuff branch from 9f8e4f8 to 5bf4484 Compare January 15, 2026 14:49
@whi-tw whi-tw force-pushed the whi-tw/custom-otel-stuff branch from 5bf4484 to c5d6900 Compare January 15, 2026 14:49
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

Important

Not all of the functionality of forms-runner is present in review apps.
Functionality such as sending emails, file upload, and S3 submission types are
deliberately disabled for the sake of simplifying review apps.

You should use the full dev environment to test the functionality which is disabled here.

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.

@whi-tw whi-tw force-pushed the whi-tw/opentelemetry-introduction branch from 319e15c to c7e5c58 Compare January 19, 2026 10:16
Base automatically changed from whi-tw/opentelemetry-introduction to main January 19, 2026 11:57
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.

2 participants