定制 ujamii/prometheus-trello-exporter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ujamii/prometheus-trello-exporter

Composer 安装命令:

composer create-project ujamii/prometheus-trello-exporter

包简介

Metrics endpoint for trello data.

README 文档

README

This package uses the Trello REST API to query for some statistics and outputs them in OpenMetrics format, which can be scraped by Prometheus.

For easier deployment we also provide a Docker container.

API Keys

For authentication at the REST API this tool needs a pair of API keys, which you can create by signing into Trello and visiting trello.com/app-key

Usage

You can either include this library into you own code, or run it as a container.

with Composer

Installation

composer req ujamii/prometheus-trello-exporter

Usage in your custom file

require 'vendor/autoload.php';

$exporter = new \Ujamii\OpenMetrics\Trello\TrelloExporter('<TRELLO_API_KEY>', '<TRELLO_API_TOKEN>', '<TRELLO_ORG>');
$exporter->run();

with Docker

The image is based on php:8.1-apache and thus exposes data on port 80 by default. Assuming you fire this up with -p 80:80 on localhost, you can see the metrics at http://localhost/metrics.

Configuration is done with three environment variables: TRELLO_API_KEY and TRELLO_API_TOKEN for authentication and an optional TRELLO_ORG variable if you want to query the boards from an organization instead of the boards from the user.

docker run -d --name trello-prometheus -e TRELLO_API_KEY=verylongfoobarkey -e TRELLO_API_TOKEN=foobarlongtoken -p "80:80" ghcr.io/ujamii/prometheus-trello-exporter

Get the prebuild image from GitHub

with Docker Compose

cp docker-compose.example.yml docker-copose.yml
vim docker-compose.yml #add env variables
docker-compose up -d

Output

The script will generate something like:

# TYPE trello_cards_in_list_total gauge
# HELP trello_cards_in_list_total Number of cards per list.
trello_cards_in_list_total{board="FooBar Board", list="To Do"} 2.000000
trello_cards_in_list_total{board="FooBar Board", list="In Progress"} 0.000000
trello_cards_in_list_total{board="FooBar Board", list="Done"} 16.000000
# TYPE trello_labeled_cards_on_board gauge
# HELP trello_labeled_cards_on_board Number of cards per board and label.
trello_labeled_cards_on_board{board="FooBar Board", label="on hold"} 2.000000
trello_labeled_cards_on_board{board="FooBar Board", label="late"} 1.000000
trello_labeled_cards_on_board{board="FooBar Board", label="needs input"} 5.000000
# TYPE trello_cards_per_board_member gauge
# HELP trello_cards_per_board_member Number of cards per board and member.
trello_cards_per_board_member{board="FooBar Board", member="John Doe"} 3.000000
trello_cards_per_board_member{board="FooBar Board", member="Jane Doe"} 13.000000
...

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固