Skip to content

ANA-7386 Add Protorabbit instrumentor - #41

Draft
markcmurphy wants to merge 1 commit into
mainfrom
add-protorabbit-instrumentor
Draft

ANA-7386 Add Protorabbit instrumentor#41
markcmurphy wants to merge 1 commit into
mainfrom
add-protorabbit-instrumentor

Conversation

@markcmurphy

@markcmurphy markcmurphy commented Jul 30, 2026

Copy link
Copy Markdown
Member

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 — new Protorabbit instrumentor; starts the exporter server, registers the built-in ActiveRecordCollector/ActiveRecordSql type collector, then any configured protorabbit_collectors/protorabbit_type_collectors, mirroring Hutch/Resque minus middleware setup
  • lib/bigcommerce/prometheus/configuration.rb — adds protorabbit_collectors/protorabbit_type_collectors config, defaulting to []
  • lib/bigcommerce/prometheus.rb — requires the new instrumentor
  • README.md — documents Protorabbit.new.start usage and the new config keys
  • CHANGELOG.md, version.rb — bump to 0.9.0

A few notes for reviewers:

  • Protorabbit has no tracer/middleware hook like Hutch does, so this instrumentor only starts the server and registers collectors — it doesn't wrap message processing itself. It unblocks metrics (e.g. gRPC client interceptor metrics) already being pushed from inside message handlers that were previously refused for lack of a listening exporter.
  • Protorabbit.new takes no app: arg, unlike Hutch.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.start in 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 (registers ActiveRecordCollector, 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 failure
bundle exec rspec spec/bigcommerce/prometheus/instrumentors/protorabbit_spec.rb

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.
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.

1 participant