Skip to content

Commit d1535b3

Browse files
author
あで
committed
Add docker compose infra, update deps, autoinfer full metrics url, prom push gateway support
1 parent aac0ee6 commit d1535b3

16 files changed

+418
-175
lines changed

.github/workflows/test.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test action
2+
3+
on:
4+
pull_request:
5+
branches: ["*"]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: isbang/[email protected]
13+
- name: Build
14+
run: npm run tsc
15+
- name: Test prometheus push gateway
16+
run: GITHUB_WORKFLOW=workflow GITHUB_JOB=job INPUT_PUSHGATEWAY='http://localhost:9091' INPUT_GATEWAYTYPE=prometheus node dist/test.js
17+
- name: Test zapier push gateway
18+
run: GITHUB_WORKFLOW=workflow GITHUB_JOB=job INPUT_PUSHGATEWAY='http://localhost' node dist/test.js
19+
- name: Test gravel push gateway
20+
run: GITHUB_WORKFLOW=workflow GITHUB_JOB=job INPUT_PUSHGATEWAY='http://localhost:4278' INPUT_GATEWAYTYPE=gravel node dist/test.js

action.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ branding:
77
inputs:
88
pushgateway:
99
required: true
10-
description: "Full URL to the aggregation gateway (like zapier's), including the /metrics suffix"
10+
description: "Full URL to the aggregation gateway, optionally including the /metrics suffix"
11+
gatewaytype:
12+
required: false
13+
description: "Type of the aggregation gateway, one of 'prometheus', 'gravel', or 'zapier'. Uses 'zapier' by default"
1114
buckets:
1215
required: false
1316
description: "Comma separated list of buckets for duration histogram, with or without the brackets []"
1417
runs:
15-
using: "node16"
18+
using: "node20"
1619
main: "main/index.js"
1720
post: "post/index.js"

docker-compose.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: "3.8"
2+
services:
3+
gravel:
4+
container_name: gravel
5+
image: sinkingpoint/prometheus-gravel-gateway
6+
ports:
7+
- "4278:4278"
8+
prom:
9+
container_name: prom
10+
image: prom/pushgateway
11+
ports:
12+
- "9091:9091"
13+
zapier:
14+
container_name: zapier
15+
image: ghcr.io/zapier/prom-aggregation-gateway:latest
16+
ports:
17+
- "80:80"

src/environment.d.ts env.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ declare global {
33
interface ProcessEnv {
44
GITHUB_WORKFLOW: string;
55
GITHUB_JOB: string;
6-
INPUT_PUSHGATEWAY: string;
7-
INPUT_BUCKETS?: string;
86
GITHUB_STATE: string;
7+
INPUT_BUCKETS?: string;
8+
INPUT_PUSHGATEWAY: string;
9+
INPUT_GATEWAYTYPE?: string;
910
}
1011
}
1112
}

0 commit comments

Comments
 (0)