Skip to content

feat: add optional prometheus metrics endpoint with saturation metrics#42

Merged
bougyman merged 1 commit intorubyists:mainfrom
pmcclory-pp:main
Apr 16, 2026
Merged

feat: add optional prometheus metrics endpoint with saturation metrics#42
bougyman merged 1 commit intorubyists:mainfrom
pmcclory-pp:main

Conversation

@pmcclory-pp
Copy link
Copy Markdown
Contributor

for each subject (unique endpoint) expose:

  • busy instances - the number of instances that are either actively processing a request or have been enqueued for processing in the nats-pure worker thread pool
  • the total number of instances for a subject (this is equal to the number of leopard instances)
  • pending requests - the number of requests that have been read from NATS but are waiting to be processed

note that this currently accesses the private handler attribute of NATS::Service::Endpoint which is not part of the public API. a follow-up PR to nats-pure.rb will add attr_reader :handler to make this public.

Comment thread lib/leopard/nats_api_server.rb Outdated
@pmcclory-pp pmcclory-pp changed the title add optional prometheus metrics endpoint with saturation metrics feat: add optional prometheus metrics endpoint with saturation metrics Apr 15, 2026
for each subject (unique endpoint) expose:
* busy instances - the number of instances that are either actively
  processing a request or have been enqueued for processing in the
  nats-pure worker thread pool
* the total number of instances for a subject (this is equal to the
  number of leopard instances)
* pending requests - the number of requests that have been read from
  NATS but are waiting to be processed

note that this currently accesses the private `handler` attribute of
`NATS::Service::Endpoint` which is not part of the public API. a follow-up
PR to nats-pure.rb will add `attr_reader :handler` to make this public.

Co-authored-by: bougyman <bougyman@users.noreply.github.com>
@bougyman bougyman merged commit fcd767a into rubyists:main Apr 16, 2026
4 checks passed
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