zenhub_exporter

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

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>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
mocks
zenhub
Package mocks_zenhub is a generated GoMock package.
Package mocks_zenhub is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL