Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions wait-for-grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ The time to wait between each check, in seconds. Default is `0.5`.

### `startupTimeout` (optional)

The maximum time to wait for the server's TCP port to bind, in seconds. Default is `300`.
The maximum time to wait for the server's TCP port to bind, in seconds. Default is `60`.

This covers the window between the container starting and Grafana's HTTP listener becoming active. During this phase the action polls every 5 seconds. Once the port responds (with any status other than `000`), normal health polling begins using the `timeout` and `interval` values above.

On contested CI runners, Grafana's HTTP listener can take longer to bind than the default health-check window allows, regardless of Grafana version. Increasing this value gives the process more time to start without affecting the health-check phase.
Raise this value only if Grafana genuinely takes longer than the default to start. A long default delays diagnosis of startup *crashes* (for example, a provisioning deadlock that prevents the HTTP listener from ever binding), since the action can only observe `000` and cannot distinguish "still booting" from "dead before booting." Pair this action with a separate diagnostic step that dumps container logs on failure to recover the real signal.

## How to use?

Expand Down
4 changes: 2 additions & 2 deletions wait-for-grafana/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ inputs:
required: true
default: "0.5"
startupTimeout:
description: "Seconds to wait for the TCP port to bind before health polling begins. On contested CI runners, Grafana's HTTP listener can take longer to start than the default health-check window allows."
description: "Seconds to wait for the TCP port to bind before health polling begins. Raise this only if Grafana genuinely takes longer than the default to start — a long default delays diagnosis of startup crashes (e.g. provisioning deadlocks), which never recover no matter how long we wait."
required: true
default: "300"
default: "60"
runs:
using: "composite"
steps:
Expand Down
2 changes: 1 addition & 1 deletion wait-for-grafana/wait-for-grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ url="$1"
expected_response_code="$2"
timeout="$3"
interval="$4"
startup_timeout="${5:-300}"
startup_timeout="${5:-60}"

echo "Checking URL: $url"
echo "Expected response code: $expected_response_code"
Expand Down
Loading