• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

gitee-exporter: Prometheus exporter for gitee metrics

原作者: [db:作者] 来自: Gitee 收藏 邀请

Prometheus Gitee Exporter

Exposes basic metrics for your repositories from the Gitee API, to a Prometheus compatible endpoint.

( Most of the inspiration comes from github-exporter, thanks to the infinityworks team for bringing us such wonderful examples. )

Configuration

This exporter is setup to take input from environment variables:

Required

  • ORGS If supplied, the exporter will enumerate all repositories for that organization. Expected in the format "org1, org2".
  • REPOS If supplied, The repos you wish to monitor, expected in the format "user/repo1, user/repo2". Can be across different Gitee users/orgs.
  • USERS If supplied, the exporter will enumerate all repositories for that users. Expected inthe format "user1, user2".

At least one of those 3 options should be provided.

Optional

  • GITEE_TOKEN If supplied, enables the user to supply a gitee authentication token that allows the API to be queried more often. Optional, but recommended.
  • GITEE_TOKEN_FILE If supplied instead of GITEE_TOKEN, enables the user to supply a path to a file containing a gitee authentication token that allows the API to be queried more often. Optional, but recommended.
  • API_URL Gitee API URL, shouldn't need to change this. Defaults to https://gitee.com/api/v5
  • LISTEN_PORT The port you wish to run the container on, the Dockerfile defaults this to 9190
  • METRICS_PATH the metrics URL path you wish to use, defaults to /metrics
  • LOG_LEVEL The level of logging the exporter will run with, defaults to debug

Install and deploy

Run manually from Docker Hub:

docker run -d --restart=always -p 9190:9190 -e REPOS="oscstudio/gitee-exporter, atompitestorg/testrepo" oscstudio/gitee-exporter

Build a docker image:

docker build -t <image-name> .docker run -d --restart=always -p 9190:9190 -e REPOS="oscstudio/gitee-exporter, atompitestorg/testrepo" <image-name>

Docker compose

gitee-exporter:    tty: true    stdin_open: true    expose:      - 9190    ports:      - 9190:9190    image: oscstudio/gitee-exporter:latest    environment:      - REPOS=<REPOS you want to monitor>      - GITEE_TOKEN=<your gitee api token>

Metrics

Metrics will be made available on port 9190 by defaultAn example of these metrics can be found in the METRICS.md markdown file in the root of this repository

Tests

There is a set of blackbox behavioural tests which validate metrics endpoint in the test directory.Run as follows

make test

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap