File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,18 @@ docker run -d -p 9101:9101 ghcr.io/cpanato/github_actions_exporter-linux-amd64:v
6969make test
7070```
7171
72+ ### Manual testing
73+
74+ ``` bash
75+ cd example/
76+ export WEBHOOK_SECRET=" ..."
77+ export GITHUB_TOKEN=" ..."
78+ export GITHUB_ORG=" ..."
79+ docker-compose up --build
80+ ```
81+
82+ Open Prometheus at http://localhost:9090 and explore the available metrics.
83+
7284## Contributing
7385
7486Refer to [ CONTRIBUTING.md] ( https://github.com/cpanato/github_actions_exporter/blob/master/CONTRIBUTING.md ) .
Original file line number Diff line number Diff line change 1+ FROM golang:1.17-alpine as builder
2+
3+ ARG GOARCH="amd64"
4+ ARG GOOS="linux"
5+
6+ WORKDIR /code
7+ COPY . .
8+
9+ RUN go build -o github-actions-exporter .
10+
11+ FROM ghcr.io/distroless/busybox:latest
12+
13+ COPY --from=builder /code/github-actions-exporter /bin/github-actions-exporter
14+
15+ USER nobody
16+ ENTRYPOINT ["/bin/github-actions-exporter"]
17+ EXPOSE 9101
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ github-actions-exporter :
5+ build :
6+ context : ..
7+ dockerfile : example/Dockerfile.dev
8+ command :
9+ - " --gh.github-webhook-token=$WEBHOOK_SECRET"
10+ - " --gh.github-api-token=$GITHUB_TOKEN"
11+ - " --gh.github-org=$GITHUB_ORG"
12+ ports :
13+ - 9101:9101
14+ expose :
15+ - 9101
16+
17+ prometheus :
18+ image : prom/prometheus:v2.34.0
19+ volumes :
20+ - ./prometheus.yml:/etc/prometheus/prometheus.yml
21+ command :
22+ - ' --config.file=/etc/prometheus/prometheus.yml'
23+ ports :
24+ - 9090:9090
Original file line number Diff line number Diff line change 1+ global :
2+ scrape_interval : 15s
3+
4+ scrape_configs :
5+ - job_name : " prometheus"
6+ scrape_interval : 5s
7+ static_configs :
8+ - targets : ["localhost:9090"]
9+
10+ - job_name : " github-actions-exporter"
11+ static_configs :
12+ - targets : ["github-actions-exporter:9101"]
You can’t perform that action at this time.
0 commit comments