zenhub_exporter
This is a simple server that scrapes ZenHub stats and exports them via HTTP for Prometheus consumption.
Installation
The zenhub_exporter
listens on HTTP port 9861 by default. See the --help
output for more options.
You must pass below items on to zenhub_exporter:
- pass zenhub api key via
--zenhub.api-token
command flag or ZENHUB_API_TOKEN
environemnt variables
- pass zenhub workspace name via
--zenhub.workspace-id
command flag or ZENHUB_WORKSPACE_NAME
environment variables
- pass zenhub repository id bound with board via
--zenhub.repository-id
command flag or ZENHUB_REPO_ID
environment variables
Executing below command, your repository-id
will be found.
# replace org and repo with yours
$ gh api /repos/{org}/{repo} --jq '.id'
# for example
$ gh api /repos/44smkn/zenhub_exporter --jq '.id'
404765867
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: zenhub-exporter
labels:
app: zenhub-exporter
spec:
replicas: 1
selector:
matchLabels:
app: zenhub-exporter
template:
metadata:
labels:
app: zenhub-exporter
spec:
containers:
- name: zenhub-exporter
image: ghcr.io/44smkn/zenhub_exporter:latest
ports:
- containerPort: 9861
env:
- name: ZENHUB_API_TOKEN
valueFrom:
secretKeyRef:
name: zenhub-secret
key: api-token
- name: ZENHUB_WORKSPACE_NAME
value: Test
- name: ZEBNHUB_REPO_ID
value: 404765867
---
apiVersion: v1
kind: Secret
metadata:
name: zenhub-secret
type: Opaque
data:
api-token: YWRtaW4=
Collectors
Metric Name |
Metric type |
Description |
Labels |
zenhub_workspace_issue_info |
Gauge |
Information about issue managed by board |
workspace =<workspace-name>
issue_number =<issue-number>
repository_id =<repository-id>
pipeline =<pipeline-name>
is_epic =<is_epic> |
zenhub_workspace_issue_estimated_story_points |
Gauge |
Estimated story point of each issue |
workspace =<workspace-name>
issue_number =<issue-number>
repository_id =<repository-id> |