Merge pull request #140 from trails-cool/fix/deploy-annotations-curl-dashboards
Fix deploy annotations: wget→curl + dashboard queries
This commit is contained in:
commit
af12837772
8 changed files with 67 additions and 12 deletions
8
.github/workflows/cd-apps.yml
vendored
8
.github/workflows/cd-apps.yml
vendored
|
|
@ -114,9 +114,9 @@ jobs:
|
|||
# Annotate deploy in Grafana
|
||||
GRAFANA_TOKEN=$(grep GRAFANA_SERVICE_TOKEN .env | cut -d= -f2- 2>/dev/null)
|
||||
if [ -n "$GRAFANA_TOKEN" ]; then
|
||||
docker compose exec -T grafana wget -q -O /dev/null \
|
||||
--header="Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
--header="Content-Type: application/json" \
|
||||
--post-data='{"text":"Deploy '${{ github.sha }}'","tags":["deploy","apps"]}' \
|
||||
docker compose exec -T grafana curl -sf -X POST \
|
||||
-H "Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text":"Deploy ${{ github.sha }}","tags":["deploy","apps"]}' \
|
||||
http://localhost:3000/api/annotations || true
|
||||
fi
|
||||
|
|
|
|||
8
.github/workflows/cd-brouter.yml
vendored
8
.github/workflows/cd-brouter.yml
vendored
|
|
@ -68,9 +68,9 @@ jobs:
|
|||
# Annotate deploy in Grafana
|
||||
GRAFANA_TOKEN=$(grep GRAFANA_SERVICE_TOKEN .env | cut -d= -f2- 2>/dev/null)
|
||||
if [ -n "$GRAFANA_TOKEN" ]; then
|
||||
docker compose exec -T grafana wget -q -O /dev/null \
|
||||
--header="Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
--header="Content-Type: application/json" \
|
||||
--post-data='{"text":"Deploy brouter ${{ github.sha }}","tags":["deploy","brouter"]}' \
|
||||
docker compose exec -T grafana curl -sf -X POST \
|
||||
-H "Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text":"Deploy brouter ${{ github.sha }}","tags":["deploy","brouter"]}' \
|
||||
http://localhost:3000/api/annotations || true
|
||||
fi
|
||||
|
|
|
|||
8
.github/workflows/cd-infra.yml
vendored
8
.github/workflows/cd-infra.yml
vendored
|
|
@ -89,9 +89,9 @@ jobs:
|
|||
# Annotate deploy in Grafana
|
||||
GRAFANA_TOKEN=$(grep GRAFANA_SERVICE_TOKEN .env | cut -d= -f2-)
|
||||
if [ -n "$GRAFANA_TOKEN" ]; then
|
||||
docker compose exec -T grafana wget -q -O /dev/null \
|
||||
--header="Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
--header="Content-Type: application/json" \
|
||||
--post-data='{"text":"Deploy infra ${{ github.sha }}","tags":["deploy","infra"]}' \
|
||||
docker compose exec -T grafana curl -sf -X POST \
|
||||
-H "Authorization: Bearer $GRAFANA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text":"Deploy infra ${{ github.sha }}","tags":["deploy","infra"]}' \
|
||||
http://localhost:3000/api/annotations || true
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,6 +1,17 @@
|
|||
{
|
||||
"title": "Business Metrics",
|
||||
"uid": "trails-business",
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"name": "Deploys",
|
||||
"enable": true,
|
||||
"datasource": { "type": "grafana", "uid": "-- Grafana --" },
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"tags": ["deploy"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "browser",
|
||||
"refresh": "5m",
|
||||
"panels": [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@
|
|||
"dashboard": {
|
||||
"title": "Infrastructure",
|
||||
"uid": "trails-infra",
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"name": "Deploys",
|
||||
"enable": true,
|
||||
"datasource": { "type": "grafana", "uid": "-- Grafana --" },
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"tags": ["deploy"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "browser",
|
||||
"refresh": "30s",
|
||||
"panels": [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@
|
|||
"dashboard": {
|
||||
"title": "trails.cool Overview",
|
||||
"uid": "trails-overview",
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"name": "Deploys",
|
||||
"enable": true,
|
||||
"datasource": { "type": "grafana", "uid": "-- Grafana --" },
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"tags": ["deploy"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "browser",
|
||||
"refresh": "30s",
|
||||
"panels": [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@
|
|||
"dashboard": {
|
||||
"title": "Planner",
|
||||
"uid": "trails-planner",
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"name": "Deploys",
|
||||
"enable": true,
|
||||
"datasource": { "type": "grafana", "uid": "-- Grafana --" },
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"tags": ["deploy"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "browser",
|
||||
"refresh": "30s",
|
||||
"panels": [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@
|
|||
"dashboard": {
|
||||
"title": "Service Health",
|
||||
"uid": "trails-service-health",
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"name": "Deploys",
|
||||
"enable": true,
|
||||
"datasource": { "type": "grafana", "uid": "-- Grafana --" },
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"tags": ["deploy"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "browser",
|
||||
"refresh": "30s",
|
||||
"panels": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue