id: dapr-sidecar-health-and-state-store-sentinel
namespace: company.platform
description: |
Continuously audits Dapr (Distributed Application Runtime) sidecar availability, validates runtime metadata and registered components, checks state store connectivity, and dispatches actionable Slack incident notifications upon runtime degradation.
inputs:
- id: dapr_http_endpoint
type: STRING
displayName: Dapr Sidecar Endpoint
defaults: "http://localhost:3500"
description: "Base HTTP URL of the Dapr sidecar runtime API."
- id: target_state_store
type: STRING
displayName: Target State Store Name
defaults: "statestore"
description: "Name of the configured Dapr state store component to evaluate."
- id: health_check_key
type: STRING
displayName: State Health Check Key
defaults: "health-canary"
description: "State store key queried to verify datastore read responsiveness."
- id: slack_channel
type: STRING
displayName: Operations Slack Channel
defaults: "#platform-alerts"
description: "Target Slack channel for Dapr sidecar and component alerts."
triggers:
- id: scheduled_sentinel_audit
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 */2 * * *"
disabled: true
inputs:
dapr_http_endpoint: "http://localhost:3500"
target_state_store: "statestore"
health_check_key: "health-canary"
tasks:
- id: probe_sidecar_health
type: io.kestra.plugin.core.http.Request
description: "Queries the Dapr sidecar healthz endpoint to verify core runtime
readiness."
uri: "{{ inputs.dapr_http_endpoint }}/v1.0/healthz"
method: GET
- id: probe_dapr_metadata
type: io.kestra.plugin.core.http.Request
description: "Retrieves runtime metadata to inspect loaded components,
subscriptions, and actor configurations."
uri: "{{ inputs.dapr_http_endpoint }}/v1.0/metadata"
method: GET
- id: probe_state_store
type: io.kestra.plugin.core.http.Request
description: "Probes the specified state store component to verify that the
backing datastore is responding to queries."
uri: "{{ inputs.dapr_http_endpoint }}/v1.0/state/{{ inputs.target_state_store
}}/{{ inputs.health_check_key }}"
method: GET
- id: evaluate_dapr_status
type: io.kestra.plugin.core.flow.Switch
description: "Evaluates Dapr probe results using Pebble conditionals and
branches to alert channels or compliance logging."
value: |
{% if outputs.probe_sidecar_health.code != 200 and outputs.probe_sidecar_health.code != 204 %}
SIDECAR_UNHEALTHY
{% elseif outputs.probe_dapr_metadata.code != 200 %}
METADATA_UNAVAILABLE
{% elseif outputs.probe_state_store.code != 200 and outputs.probe_state_store.code != 204 %}
STATE_STORE_ERROR
{% else %}
COMPLIANT
{% endif %}
cases:
COMPLIANT:
- id: log_compliant_state
type: io.kestra.plugin.core.log.Log
level: INFO
message: "Dapr sidecar at {{ inputs.dapr_http_endpoint }} is healthy, runtime
metadata is accessible, and state store '{{
inputs.target_state_store }}' is fully operational."
SIDECAR_UNHEALTHY:
- id: alert_sidecar_down
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"attachments": [
{
"color": "#D32F2F",
"title": "Dapr Sidecar Health Alert",
"text": "CRITICAL: Dapr sidecar at `{{ inputs.dapr_http_endpoint }}` returned non-healthy HTTP status `{{ outputs.probe_sidecar_health.code }}`.\nMicroservice state management and service invocation are at risk.",
"footer": "Kestra Sentinel | Platform Operations"
}
]
}
- id: log_sidecar_failure
type: io.kestra.plugin.core.log.Log
level: WARN
message: "CRITICAL: Dapr sidecar health probe failed with HTTP status code {{
outputs.probe_sidecar_health.code }}."
METADATA_UNAVAILABLE:
- id: alert_metadata_failure
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"attachments": [
{
"color": "#E65100",
"title": "Dapr Metadata API Failure",
"text": "WARNING: Unable to query Dapr runtime metadata from `{{ inputs.dapr_http_endpoint }}/v1.0/metadata` (HTTP `{{ outputs.probe_dapr_metadata.code }}`). Check sidecar configuration and endpoint access.",
"footer": "Kestra Sentinel | Platform Operations"
}
]
}
STATE_STORE_ERROR:
- id: alert_statestore_failure
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK_URL') }}"
payload: |
{
"attachments": [
{
"color": "#F57C00",
"title": "Dapr State Store Component Degradation",
"text": "WARNING: State store component `{{ inputs.target_state_store }}` responded with HTTP status `{{ outputs.probe_state_store.code }}` when querying key `{{ inputs.health_check_key }}`.\nBacking database connectivity or component credentials may have drifted.",
"footer": "Kestra Sentinel | Platform Operations"
}
]
}
- id: log_statestore_failure
type: io.kestra.plugin.core.log.Log
level: WARN
message: "State store component '{{ inputs.target_state_store }}' failed canary
probe with HTTP status {{ outputs.probe_state_store.code }}."
- id: record_audit_log
type: io.kestra.plugin.core.log.Log
description: "Emits a permanent execution audit log tracking Dapr runtime status."
level: INFO
message: "Completed Dapr sentinel audit on {{ inputs.dapr_http_endpoint }}.
Sidecar code={{ outputs.probe_sidecar_health.code }}, Metadata code={{
outputs.probe_dapr_metadata.code }}, StateStore code={{
outputs.probe_state_store.code }}."