Skip to content

Improve metrics#234

Draft
rcvalerio wants to merge 3 commits into
devfrom
rv-add-prometheus-grafana
Draft

Improve metrics#234
rcvalerio wants to merge 3 commits into
devfrom
rv-add-prometheus-grafana

Conversation

@rcvalerio

@rcvalerio rcvalerio commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Related https://github.com/inductiva/tasks/issues/1342

To test locally:

from prometheus_client import Counter, Gauge, Histogram, start_http_server

# Task metrics
tasks_active = Gauge('tasks_active', 'Number of currently active tasks')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will always be 1 or 0 right?

request: Request describing the task to be executed.
"""
task_start_time = time.time()
task_status_str = 'failed'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could use a TaskStatus(StrEnum) for this.

safely_delete = False

finally:
# Track metrics

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is really nice -- we should move all metrics (e.g., system metrics) to Prometheus

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