promgithub receives GitHub webhook events and exposes Prometheus metrics over HTTP.
It can be deployed:
- as a single instance with only the webhook secret configured
- as a multi-instance deployment with Redis configured for shared deduplication and state
The service supports the following environment variables:
PROMGITHUB_WEBHOOK_SECRET: Secret used to validate incoming GitHub webhook requests.PROMGITHUB_SERVICE_PORT(optional): HTTP port for the service, default8080.PROMGITHUB_REDIS_ADDR(optional): Redis address inhost:portform.PROMGITHUB_REDIS_PASSWORD(optional): Redis password.PROMGITHUB_REDIS_DB(optional): Redis database number, default0.PROMGITHUB_REDIS_KEY_PREFIX(optional): Prefix used for Redis keys, defaultpromgithub.PROMGITHUB_REDIS_DELIVERY_TTL(optional): TTL for webhook delivery dedupe keys, default24h.
If Redis is configured, the service stores delivery and run state in Redis.
PROMGITHUB_WEBHOOK_SECRET="<your webhook secret>" \
PROMGITHUB_SERVICE_PORT="8080" \
/path/to/binary/promgithubPROMGITHUB_WEBHOOK_SECRET="<your webhook secret>" \
PROMGITHUB_REDIS_ADDR="<redis-host:6379>" \
PROMGITHUB_REDIS_PASSWORD="<redis password>" \
PROMGITHUB_REDIS_DB="0" \
PROMGITHUB_REDIS_KEY_PREFIX="promgithub" \
PROMGITHUB_REDIS_DELIVERY_TTL="24h" \
PROMGITHUB_SERVICE_PORT="8080" \
/path/to/binary/promgithubdocker run \
-e PROMGITHUB_WEBHOOK_SECRET=<your webhook secret> \
-e PROMGITHUB_SERVICE_PORT=8080 \
-p 8080:8080 \
ghcr.io/darthfork/promgithub:<version>docker run \
-e PROMGITHUB_WEBHOOK_SECRET=<your webhook secret> \
-e PROMGITHUB_REDIS_ADDR=<redis-host:6379> \
-e PROMGITHUB_REDIS_PASSWORD=<redis password> \
-e PROMGITHUB_REDIS_DB=0 \
-e PROMGITHUB_REDIS_KEY_PREFIX=promgithub \
-e PROMGITHUB_REDIS_DELIVERY_TTL=24h \
-e PROMGITHUB_SERVICE_PORT=8080 \
-p 8080:8080 \
ghcr.io/darthfork/promgithub:<version>services:
redis:
image: redis:7
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
promgithub:
image: ghcr.io/darthfork/promgithub:<version>
environment:
PROMGITHUB_WEBHOOK_SECRET: <your webhook secret>
PROMGITHUB_REDIS_ADDR: redis:6379
PROMGITHUB_REDIS_PASSWORD: <redis password>
PROMGITHUB_REDIS_DB: 0
PROMGITHUB_REDIS_KEY_PREFIX: promgithub
PROMGITHUB_REDIS_DELIVERY_TTL: 24h
PROMGITHUB_SERVICE_PORT: 8080
ports:
- "8080:8080"
depends_on:
- redispromgithub includes a Helm chart.
apiVersion: v2
name: promgithub
description: Deployment of promgithub
type: application
version: <chart version>
dependencies:
- name: promgithub
version: "<promgithub-charts version>"
repository: "oci://ghcr.io/darthfork/promgithub-charts"promgithub:
secrets:
github_webhook_secret: <your webhook secret>
redis_password: <redis password>
redisConfig:
addr: redis.example.internal:6379
db: 0
keyPrefix: promgithub
deliveryTTL: 24hpromgithub:
secrets:
github_webhook_secret: <your webhook secret>
redis:
enabled: true
auth:
enabled: true
password: <redis password>
redisConfig:
db: 0
keyPrefix: promgithub
deliveryTTL: 24hWhen redis.enabled=true, the chart deploys Redis as a dependency and configures promgithub to connect to it automatically.
Expose the /webhook endpoint to GitHub using your preferred Kubernetes ingress setup.
- Navigate to your GitHub repository or organization settings.
- Under Settings, open Webhooks and click Add webhook.
- Set the payload URL to your
promgithubwebhook endpoint, for examplehttps://<your-service-url>/webhook. - Set Content type to
application/json. - Set the Secret to the value used for
PROMGITHUB_WEBHOOK_SECRET. - Subscribe to these events:
- push
- pull request
- workflow job
- workflow runs
- Save the webhook.
promgithub exposes Prometheus metrics on /metrics.
scrape_configs:
- job_name: 'promgithub'
scrape_interval: 15s
metrics_path: '/metrics'
static_configs:
- targets: ['promgithub:8080']
labels:
service: 'promgithub'apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: promgithub
namespace: promgithub
spec:
endpoints:
- path: /metrics
interval: 15s
port: http