Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce metrics for software stacks maintained by Kebechet #807

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions thoth/metrics_exporter/jobs/kebechet.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ def get_kebechet_current_rate_limit(cls) -> None:
remaining = gh_rate_limit.core.remaining
metrics.kebechet_current_rate_limit.set(remaining)
_LOGGER.debug("kebechet_current_rate_limit=%r", remaining)

@classmethod
@register_metric_job
def get_kebechet_maintained_software_stacks_count(cls) -> None:
"""Get number of software stacks maintained by Kebechet."""
count = cls.graph().get_kebechet_github_installations_software_stack_count_all(is_active=True)
metrics.kebechet_maintained_software_stacks_count.set(count)
_LOGGER.debug("kebechet_maintained_software_stacks_count=%r", count)
6 changes: 5 additions & 1 deletion thoth/metrics_exporter/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@

# Kebechet Metrics
kebechet_total_active_repo_count = Gauge(
"thoth_kebechet_total_active_repo_count", "Count of number of repo's supported by Kebechet.", []
"thoth_kebechet_total_active_repo_count", "Count of number of repositories supported by Kebechet.", []
)

kebechet_total_active_users_per_manager_count = Gauge(
Expand All @@ -251,3 +251,7 @@
"thoth_kebechet_current_rate_limit",
"Kebechet remaining rate limit.",
)

kebechet_maintained_software_stacks_count = Gauge(
"thoth_kebechet_maintained_software_stacks_count", "Count the number of software stacks maintained by Kebechet.", []
)