Skip to content

Commit

Permalink
Merge pull request #807 from pacospace/add-metrics-software-stack-keb…
Browse files Browse the repository at this point in the history
…echet

introduce metrics for software stacks maintained by Kebechet
  • Loading branch information
sesheta authored Jan 12, 2022
2 parents ed18685 + e43a9c7 commit bbbbd06
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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.", []
)

0 comments on commit bbbbd06

Please sign in to comment.