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 OpenTelemetry span processing when using logstasher #372

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

theseanything
Copy link
Contributor

The logstasher gem monkey patches the process_action.action_controller instrumentation. However the gem hasn't been updated for Rails 7, which assumes that the payload has the 'request' object available. This request object is used by the OpenTelemetry SDK to process spans. This generates lots of error logs from the SDK, and prevents us from recording some spans.

This re-monkey patches the instrumentation to use a raw_payload that is expected in Rails 7. Ideally, this would be fixed in the logstasher gem however there has been little active development over the last year. Longer term fix might be to move to a maintained logging library.

The logstasher gem monkey patches the `process_action.action_controller`
instrumentation. However the gem hasn't been updated for Rails 7, which
assumes that the payload has the 'request' object available. This
request object is used by the OpenTelemetry SDK to process spans. This
generates lots of error logs from the SDK, and prevents us from
recording some spans.

This re-monkey patches the instrumentation to use a raw_payload that is
expected in Rails 7.  Ideally, this would be fixed in the logstasher gem
however there has been little active development over the last year.
Longer term fix might be to move to a maintained logging library.
@theseanything theseanything merged commit 415a048 into main Jun 5, 2024
9 checks passed
@theseanything theseanything deleted the fix-otel-with-logstasher branch June 5, 2024 07:57
theseanything added a commit to alphagov/govuk-helm-charts that referenced this pull request Jun 5, 2024
This was previously disable due to a bug causing the OpenTel SDK to
produce significant numbers of error logs. This bug has been fixed in
alphagov/govuk_app_config#372.
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