Skip to content

vine: add prometheus instrumentation to python bindings.#4433

Merged
btovar merged 10 commits into
cooperative-computing-lab:masterfrom
btovar:prometheus
Jul 14, 2026
Merged

vine: add prometheus instrumentation to python bindings.#4433
btovar merged 10 commits into
cooperative-computing-lab:masterfrom
btovar:prometheus

Conversation

@btovar

@btovar btovar commented Jun 24, 2026

Copy link
Copy Markdown
Member

For #3827, coffea-casa.

Merge Checklist

The following items must be completed before PRs can be merged.
Check these off to verify you have completed all steps.

  • make test Run local tests prior to pushing.
  • make format Format source code to comply with lint policies. Note that some lint errors can only be resolved manually (e.g., Python)
  • make lint Run lint on source code prior to pushing.
  • Manual Update: Update the manual to reflect user-visible changes.
  • Type Labels: Select a github label for the type: bugfix, enhancement, etc.
  • Product Labels: Select a github label for the product: TaskVine, Makeflow, etc.
  • PR RTM: Mark your PR as ready to merge.

@btovar
btovar requested a review from dthain June 24, 2026 16:06

@dthain dthain left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't see this one earlier. Integrating prometheus will add a lot of value. See a few quibbles below:

Comment thread doc/manuals/taskvine/index.md Outdated
This feature requires the optional `prometheus_client` package:

```sh
pip install prometheus_client

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A slight hesitation about extra manual installs. Another potential hiccup for the user, and also a dependency that we (probably) won't test since it doesn't come along for the ride in testing.

Is Prometheus available via Conda?
How much does the package weigh?
Does it make sense to make it a default dependency?

Comment thread doc/manuals/taskvine/index.md Outdated
`ImportError` when metrics are enabled.

Each scrape returns gauge metrics derived from the manager status API. Manager
statistics are exported as `vine_<field>` (for example, `vine_tasks_waiting`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to reuse the status report that the manager is generating for catalog updates?
Or is that one too heavyweight?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the report as is, we cannot. Prometheus expects this type of gauges to be single values in a time series. Both the catalog status report and Prometheus here are using the same status function (vine_status), only that they present differently the information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, makes sense.

# If not given, then TSL is not activated. If True, a self-signed temporary key and cert are generated.
# @param init_fn Function applied to the newly created manager at initialization.
# @param status_display_interval Number of seconds between updates to the jupyter status display. None, or less than 1 disables it.
# @param prometheus If True, serve Prometheus metrics on port 9090.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixing boolean and integer in the same parameter seems likely to cause headaches down the road.

Let's make it easy on the AI and call this prometheus_port and just make it an integer, such that zero means "any port" and 9090 can be chosen explicitly.

There is no avoiding the fact that multiple running taskvine instances will require some port planning/management by the end user...

@btovar
btovar merged commit cf5db1a into cooperative-computing-lab:master Jul 14, 2026
21 of 24 checks passed
@btovar
btovar deleted the prometheus branch July 14, 2026 16:33
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