feat: 增加prometheus app (#638)

This commit is contained in:
刘瑞斌 2023-12-07 15:17:06 +08:00 committed by GitHub
parent 4b235e0326
commit 7bfe1297e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 93 additions and 0 deletions

14
apps/prometheus/README.md Normal file
View File

@ -0,0 +1,14 @@
# Prometheus
Prometheus 一个监控系统和时间序列数据库
## 主要功能:
- 多维数据模型,其中时间序列数据由指标名称和键/值对标识
- PromQL一种利用此维度的灵活查询语言
- 不依赖分布式存储;
- 单个服务器节点是自治的
- 时间序列收集通过 HTTP 上的拉模型进行
- 通过中间网关支持推送时间序列
- 通过服务发现或静态配置发现目标
- 多种图形和仪表板支持模式

19
apps/prometheus/data.yml Normal file
View File

@ -0,0 +1,19 @@
name: Prometheus
tags:
- 数据库
title: Prometheus 一个监控系统和时间序列数据库
type: 数据库
description: Prometheus 是一个监控系统和时间序列数据库
additionalProperties:
key: prometheus
name: Prometheus
tags:
- Database
shortDescZh: Prometheus 一个监控系统和时间序列数据库
shortDescEn: The Prometheus monitoring system and time series database.
type: runtime
crossVersionUpdate: false
limit: 0
website: https://prometheus.io
github: https://github.com/prometheus/prometheus
document: https://prometheus.io/docs/introduction/overview/

BIN
apps/prometheus/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -0,0 +1,25 @@
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
static_configs:
- targets: [ 'localhost:9090' ]

View File

@ -0,0 +1,10 @@
additionalProperties:
formFields:
- default: 9090
edit: true
envKey: PANEL_APP_PORT_HTTP
labelEn: Port
labelZh: Web 端口
required: true
rule: paramPort
type: number

View File

@ -0,0 +1,24 @@
version: '3'
services:
clickhouse:
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
ports:
- "${PANEL_APP_PORT_HTTP}:9090"
volumes:
- ./conf:/etc/prometheus/
- ./prometheus:/prometheus
image: prom/prometheus:v2.48.0
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention=200h'
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true

View File

@ -0,0 +1 @@
chmod -R 777 prometheus