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

Adds HELP and TYPE to prometheus metrics #311

Merged
merged 3 commits into from
Jun 7, 2024
Merged

Adds HELP and TYPE to prometheus metrics #311

merged 3 commits into from
Jun 7, 2024

Conversation

djperrefort
Copy link
Member

Resolves #308 by adding HELP and TYPE comments to the Prometheus outputs. An example is included below.

There is no help text provided by the health check framework. I considered using the instance docstrings, but no luck there either. I added the fully qualified plugin name as an alternative. This way we at least know where to go digging when there is a problem. I don't love this solution, so I could be easily convinced to do something else.

# HELP CeleryHealthCheckCelery health_check.contrib.celery.appsCeleryHealthCheckCelery
# TYPE CeleryHealthCheckCelery gauge
CeleryHealthCheckCelery{critical_service="True",message="unavailable: TimeoutError: The task took too long to return a result"} 500.0

# HELP CeleryPingHealthCheck health_check.contrib.celery_ping.backendsCeleryPingHealthCheck
# TYPE CeleryPingHealthCheck gauge
CeleryPingHealthCheck{critical_service="True",message="unavailable: Celery workers unavailable"} 500.0

# HELP DatabaseBackend health_check.db.backendsDatabaseBackend
# TYPE DatabaseBackend gauge
DatabaseBackend{critical_service="True",message="working"} 200.0

# HELP DefaultFileStorageHealthCheck health_check.storage.backendsDefaultFileStorageHealthCheck
# TYPE DefaultFileStorageHealthCheck gauge
DefaultFileStorageHealthCheck{critical_service="True",message="working"} 200.0

# HELP MigrationsHealthCheck health_check.contrib.migrations.backendsMigrationsHealthCheck
# TYPE MigrationsHealthCheck gauge
MigrationsHealthCheck{critical_service="True",message="working"} 200.0

# HELP RedisHealthCheck health_check.contrib.redis.backendsRedisHealthCheck
# TYPE RedisHealthCheck gauge
RedisHealthCheck{critical_service="True",message="working"} 200.0

Copy link

@buttermutter buttermutter left a comment

Choose a reason for hiding this comment

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

lgtm

@djperrefort djperrefort merged commit 0424d31 into main Jun 7, 2024
13 checks passed
@djperrefort djperrefort deleted the prom_help branch June 7, 2024 15:14
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.

Prometheus health endpoint missing help text
2 participants