feat(ruby/rails-api): add OtelFilterSpanProcessor, Sidekiq OTel fixes, and OTel Collector config#130
Open
prathamesh-sonpatki wants to merge 1 commit into
Conversation
…, and OTel Collector config - Add OtelFilterSpanProcessor inline in opentelemetry.rb — drops BEGIN/COMMIT/ROLLBACK spans, health check paths, OTLP exporter Net::HTTP calls (meta-tracing loop fix), noisy Redis commands, and configurable Sidekiq queue/job spans - Add probabilistic sampling via OTEL_SAMPLE_RATE (parentbased_traceidratio) - Disable ActionView instrumentation (high volume, irrelevant for JSON APIs) - Add config/initializers/sidekiq.rb with OTel shutdown hook to flush spans on stop - Add otel-collector/config.yaml with filter/drop_noise processor (OTTL-based) that mirrors the in-app filter — app → collector → Last9 architecture - Add docker-compose.yaml wiring Rails app to collector (LAST9_* env vars on collector) - Update .env.example with all new OTEL_FILTER_* and collector env vars - Update README with noise reduction guide, OTel Collector mode, and quick start - Fix .gitignore to allow .env.example to be committed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OtelFilterSpanProcessortoopentelemetry.rb— dropsBEGIN/COMMIT/ROLLBACKspans, health check paths, OTLP exporter Net::HTTP calls (meta-tracing loop fix), noisy Redis commands, and configurable Sidekiq queue/job spansOTEL_SAMPLE_RATEenv var (parentbased_traceidratio)ActionViewinstrumentation (high volume, irrelevant for JSON APIs)config/initializers/sidekiq.rbwith OTel shutdown hook to flush spans on Sidekiq stopotel-collector/config.yamlwithfilter/drop_noiseprocessor (OTTL-based) mirroring the in-app filter, plus optionalprobabilistic_sampler— enablesapp → collector → Last9architecturedocker-compose.yamlwiring Rails app to OTel Collector (LAST9_*env vars on collector).env.examplewith all newOTEL_FILTER_*and collector env varsCloses FDE-62
Test plan
bundle install && bin/rails serverstarts without errorsBEGIN/COMMIT/ROLLBACKspans absent from traces/healthrequests produce no spansdocker compose upstarts both app and collector; traces flow through collector to Last9OTEL_SAMPLE_RATE=0.1reduces trace volume to ~10%OTEL_FILTER_SIDEKIQ_QUEUES=mailersdrops spans from that queue🤖 Generated with Claude Code