id: glitchtip-error-tracking-and-ingestion-sentinel
namespace: devops.monitoring
labels:
env: production
system: glitchtip
category: apm
inputs:
- id: glitchtip_url
type: STRING
displayName: GlitchTip Instance URL
description: Base URL of the GlitchTip error tracking instance.
defaults: http://localhost:8000
- id: glitchtip_token
type: STRING
displayName: GlitchTip API Token
description: Personal auth token for authenticated API endpoints.
defaults: ""
- id: slack_webhook_url
type: STRING
displayName: Slack Webhook URL
description: Slack incoming webhook URL for incident alerting.
defaults: ""
- id: latency_threshold_ms
type: INT
displayName: Latency Threshold (ms)
description: Maximum acceptable response latency in milliseconds before marking
the service as degraded.
defaults: 2000
- id: alert_on_warning
type: BOOL
displayName: Alert on Degraded Warning
description: Whether to send Slack alerts when status is DEGRADED in addition to
CRITICAL.
defaults: true
triggers:
- id: periodic_sentinel_schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: "*/15 * * * *"
tasks:
- id: probe_system_health
type: io.kestra.plugin.core.http.Request
description: Probe GlitchTip native health check endpoint for database and
worker readiness.
uri: "{{ inputs.glitchtip_url }}/_health/"
method: GET
timeout: PT10S
retry:
type: constant
interval: PT2S
maxAttempts: 2
options:
allowFailed: true
- id: probe_api_root
type: io.kestra.plugin.core.http.Request
description: Probe GlitchTip Sentry-compatible API root endpoint for gateway
responsiveness.
uri: "{{ inputs.glitchtip_url }}/api/0/"
method: GET
timeout: PT10S
headers: "{{ inputs.glitchtip_token != '' ? {'Authorization': 'Bearer ' ~
inputs.glitchtip_token} : {} }}"
options:
allowFailed: true
- id: probe_projects_catalog
type: io.kestra.plugin.core.http.Request
description: Probe GlitchTip projects endpoint to inspect active projects and
ingestion readiness.
uri: "{{ inputs.glitchtip_url }}/api/0/projects/"
method: GET
timeout: PT10S
headers: "{{ inputs.glitchtip_token != '' ? {'Authorization': 'Bearer ' ~
inputs.glitchtip_token} : {} }}"
options:
allowFailed: true
- id: classify_sentinel_status
type: io.kestra.plugin.core.log.Log
description: Evaluate service response codes and classify cluster operational status.
message: |
GlitchTip Sentinel Probe Evaluation:
- Health Status Code: {{ outputs.probe_system_health.code }}
- API Root Status Code: {{ outputs.probe_api_root.code }}
- Projects Status Code: {{ outputs.probe_projects_catalog.code }}
- id: route_operational_status
type: io.kestra.plugin.core.flow.Switch
description: Branch execution based on GlitchTip service health classification.
value: "{{ outputs.probe_system_health.code == 200 and
(outputs.probe_api_root.code == 200 or outputs.probe_api_root.code == 401
or outputs.probe_api_root.code == 403) ? 'OPERATIONAL' :
(outputs.probe_system_health.code == 200 ? 'DEGRADED' : 'CRITICAL') }}"
cases:
CRITICAL:
- id: log_critical_incident
type: io.kestra.plugin.core.log.Log
level: ERROR
message: "CRITICAL: GlitchTip instance at {{ inputs.glitchtip_url }} is DOWN or
failing health checks! Status Code: {{
outputs.probe_system_health.code }}."
- id: alert_slack_critical
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
description: Dispatch high-priority alert to Slack when GlitchTip is failing.
url: "{{ inputs.slack_webhook_url != '' ? inputs.slack_webhook_url :
secret('SLACK_WEBHOOK_URL') }}"
runIf: "{{ (inputs.slack_webhook_url != '' or secret('SLACK_WEBHOOK_URL') !=
null) }}"
payload: |
{
"text": "CRITICAL INCIDENT: GlitchTip Error Tracker at {{ inputs.glitchtip_url }} is unreachable or failing health checks!",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "GlitchTip Sentinel Alert: Service CRITICAL",
"emoji": false
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Instance:* {{ inputs.glitchtip_url }}"
},
{
"type": "mrkdwn",
"text": "*Health Code:* {{ outputs.probe_system_health.code }}"
},
{
"type": "mrkdwn",
"text": "*API Root Code:* {{ outputs.probe_api_root.code }}"
},
{
"type": "mrkdwn",
"text": "*Projects Code:* {{ outputs.probe_projects_catalog.code }}"
}
]
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Execution ID: {{ execution.id }} | Namespace: {{ flow.namespace }}"
}
]
}
]
}
DEGRADED:
- id: log_degraded_warning
type: io.kestra.plugin.core.log.Log
level: WARN
message: "WARNING: GlitchTip instance at {{ inputs.glitchtip_url }} is DEGRADED.
Sub-services or API endpoints returned unexpected status codes."
- id: alert_slack_degraded
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
description: Dispatch warning alert to Slack when GlitchTip is degraded.
url: "{{ inputs.slack_webhook_url != '' ? inputs.slack_webhook_url :
secret('SLACK_WEBHOOK_URL') }}"
runIf: "{{ inputs.alert_on_warning and (inputs.slack_webhook_url != '' or
secret('SLACK_WEBHOOK_URL') != null) }}"
payload: |
{
"text": "WARNING: GlitchTip Error Tracker at {{ inputs.glitchtip_url }} is reporting DEGRADED sub-services.",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "GlitchTip Sentinel Warning: Sub-system Degraded",
"emoji": false
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Instance:* {{ inputs.glitchtip_url }}"
},
{
"type": "mrkdwn",
"text": "*API Status:* {{ outputs.probe_api_root.code }}"
}
]
}
]
}
defaults:
- id: log_operational_confirmation
type: io.kestra.plugin.core.log.Log
message: "SUCCESS: GlitchTip instance at {{ inputs.glitchtip_url }} is fully
OPERATIONAL. Health checks and ingestion endpoints are healthy."
- id: record_sentinel_audit_telemetry
type: io.kestra.plugin.core.output.OutputValues
description: Record structured sentinel health telemetry for audit history and
downstream dashboards.
values:
instance_url: "{{ inputs.glitchtip_url }}"
status: "{{ outputs.probe_system_health.code == 200 and
(outputs.probe_api_root.code == 200 or outputs.probe_api_root.code ==
401 or outputs.probe_api_root.code == 403) ? 'OPERATIONAL' :
(outputs.probe_system_health.code == 200 ? 'DEGRADED' : 'CRITICAL') }}"
health_status_code: "{{ outputs.probe_system_health.code }}"
api_root_status_code: "{{ outputs.probe_api_root.code }}"
projects_status_code: "{{ outputs.probe_projects_catalog.code }}"
errors:
- id: handle_sentinel_failure
type: io.kestra.plugin.core.log.Log
level: ERROR
message: "SENTINEL UNEXPECTED FAILURE: Could not connect to GlitchTip at {{
inputs.glitchtip_url }}. Please verify network route and container state."
- id: alert_sentinel_fatal_exception
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
description: Dispatch notification when probe encounters fatal network error.
url: "{{ inputs.slack_webhook_url != '' ? inputs.slack_webhook_url :
secret('SLACK_WEBHOOK_URL') }}"
runIf: "{{ (inputs.slack_webhook_url != '' or secret('SLACK_WEBHOOK_URL') !=
null) }}"
payload: |
{
"text": "FATAL INCIDENT: GlitchTip sentinel flow execution {{ execution.id }} failed with network exception or unhandled error!"
}