ANA-7386 Add Protorabbit instrumentor - #41
Draft
markcmurphy wants to merge 1 commit into
Draft
Conversation
protorabbit worker processes ran no embedded Prometheus exporter server, so any metric pushed from inside message processing (e.g. gRPC client interceptor metrics) was refused with Errno::ECONNREFUSED on /send-metrics and silently dropped. Adds Instrumentors::Protorabbit, following the existing Hutch instrumentor pattern minus the tracer/middleware wiring that protorabbit has no hook for, plus protorabbit_collectors/protorabbit_type_collectors configuration.
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.
Jira: ANA-7386
What/Why?
Protorabbit processes have no Prometheus instrumentor, so the exporter server never starts and any metrics pushed during message processing fail with
Errno::ECONNREFUSED. This is confirmed in theme-registry, auth, bmp, and bigpay, so the fix lives here rather than in each service individually.Changes:
lib/bigcommerce/prometheus/instrumentors/protorabbit.rb— newProtorabbitinstrumentor; starts the exporter server, registers the built-inActiveRecordCollector/ActiveRecordSqltype collector, then any configuredprotorabbit_collectors/protorabbit_type_collectors, mirroringHutch/Resqueminus middleware setuplib/bigcommerce/prometheus/configuration.rb— addsprotorabbit_collectors/protorabbit_type_collectorsconfig, defaulting to[]lib/bigcommerce/prometheus.rb— requires the new instrumentorREADME.md— documentsProtorabbit.new.startusage and the new config keysCHANGELOG.md,version.rb— bump to 0.9.0A few notes for reviewers:
Protorabbit.newtakes noapp:arg, unlikeHutch.new(app:)— there's no Rails app object available in a protorabbit worker context.Rollout/Rollback
Ships as a new gem version (0.9.0) with no behavior change until a consuming service calls
Bigcommerce::Prometheus::Instrumentors::Protorabbit.new.startin its protorabbit boot code. Existing Web/Resque/Hutch instrumentation is untouched.Rollback is a plain gem downgrade; no data or schema is involved. Consuming services (theme-registry, auth, bmp, bigpay) need a follow-up change to actually wire in
.start— that adoption is out of scope here.Testing
Automated:
spec/bigcommerce/prometheus/instrumentors/protorabbit_spec.rb— covers disabled-noop, enabled start (registersActiveRecordCollector, registers the ActiveRecord SQL type collector, registers configured type collector last so it can override, starts server, starts collectors), and rescue-and-log on server start failurebundle exec rspec spec/bigcommerce/prometheus/instrumentors/protorabbit_spec.rb