Skip to content

Instantly share code, notes, and snippets.

@levinol
levinol / PromQL_health_check.md
Created September 4, 2025 12:22
PromQL for monitoring Liveness/Readiness Probes

PromQL for monitoring Liveness/Readiness Probes based on prober_probe_total metric

The query below considers a microservice (deployment) available if at least one pod returns 200 on liveness probe.

For value mappings or Thresholds:

  • 1 - Healthy
  • 0 - Unhealthy
sum by(Service) (label_replace(increase(prober_probe_total{kubernetes_namespace="$namespace", kubernetes_pod=~"$service-[a-z0-9]+-[a-z0-9]+$", probe_type="Liveness", result="successful", container="main"}[5m]), "Service", "$1", "kubernetes_pod", "(.+)-[a-z0-9]{8,10}-[a-z0-9]{5}$")) > bool 0
@levinol
levinol / channel_restriction.md
Last active November 4, 2021 02:40
Discord slash commands: restrict usage [not visability]

Discord slash commands: restrict usage [not visability]

Since there is no solution from the discord developers yet, this method will limit the use of slash commands in other channels.

Solution for limiting commands to one channel:

botgate_id = CHANNEL_ID
@slash.slash(
    name="hello",