Skip to content
项目

关于

Grafana Labs 的 Jsonnet 库

开发工具

这些数字如何统计

实测星标增长

24小时
-1
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Grafana Labs' Jsonnet libraries

This repository contains various Jsonnet libraries we use at Grafana Labs:

  • prometheus-ksonnet: A set of extensible configurations for running Prometheus on Kubernetes.
  • grafana-builder: A library for building Grafana dashboards with jsonnet, following the builder pattern.
  • ksonnet-util: An overlay and set of utilities aiming at making working with Kubernetes easier.
  • oauth2-proxy: A jsonnet configuration for deploying bitly's OAuth proxy to Kubernetes.

Monitoring mixins

Based on format described here:

  • consul-mixin: A set of reuseable and extensible dashboards and alerts for running Hashicorp's Consul.

  • memcached-mixin: A set of reuseable and extensible dashboards for Memcached.

  • nodejs-mixin: A set of reuseable and extensible dashboards for Node.js.

  • caddy-mixin: A set of reusable and extensible dashboards for Caddy.

  • jira-mixin: A set of reusable and extensible dashboards and alerts for JIRA.

You can find more in directories with -mixin suffix.

Linting

The monitoring mixins in this repository use two linting tools to ensure quality and consistency:

  • mixtool: Validates the structure and syntax of monitoring mixins, ensuring they follow the standard mixin format.
  • pint: Lints Prometheus rules and alerts to catch common mistakes and enforce best practices.

Observability libraries

Observability library is a flexible format to describe dashboards and alerts in a modular way so libraries can be imported into one another or into monitoring-mixins. Observability libraries can be found in folders with -observ-lib suffix. Common library is also used to apply consistent style options.

Observability libraries signal extention

Signal is the experimental extension to observability libraries format to declare metrics (signals) and then render them as different grafana panel types (timeseries, stat, table, etc), or alert rules.

Examples:

Prometheus rules testing for monitoring mixins and observability libraries

It is highly recommended to test prometheus alerts with promtool test rules command when complex PromQL queries are used or when additional queries are used in alerts' annotations.

promtool tests files should be placed in tests directory in the root of the library and should be named like prometheus_*.yaml. This will enable running tests ing Github Actions and with make test command.

A good example of promtool tests can be found in windows-observ-lib: prometheus_alerts_test.yaml

Contributing

Install mixin dependencies

Install tools required to format, lint and test mixins.

make

Updating a mixin

Change to the target mixin directory:

cd memcached-mixin/

Install jsonnet dependencies using jsonnet-bundler:

jb install

Edit the dashboard(s), alert(s) or other files:

vim dashboards.jsonnet

Format, lint and generate the updated mixin rendered files:

make

LICENSE

Apache-2.0

探索相关项目

加载中…