夜莺-Nightingale
夜莺V6
项目介绍 架构介绍
快速开始
黄埔营
安装部署
升级
采集器
使用手册
API
数据库表结构
FAQ
开源生态
Prometheus
版权声明
第1章:天降奇兵
第2章:探索PromQL
第3章:Prometheus告警处理
第4章:Exporter详解
第5章:数据与可视化
第6章:集群与高可用
第7章:Prometheus服务发现
第8章:监控Kubernetes
第9章:Prometheus Operator
参考资料

Deploying Prometheus Time-Series Database

# Install script
version=2.45.3
filename=prometheus-${version}.linux-amd64
mkdir -p /opt/prometheus
wget https://github.com/prometheus/prometheus/releases/download/v${version}/${filename}.tar.gz
tar xf ${filename}.tar.gz
cp -far ${filename}/*  /opt/prometheus/

# Download installation package
mkdir -p /opt/prometheus
cd /opt/prometheus
wget download.flashcat.cloud/prometheus-2.50.1.linux-amd64.tar.gz

# Create prometheus.service file
cat <<EOF >/etc/systemd/system/prometheus.service
[Unit]
Description="prometheus"
Documentation=https://prometheus.io/
After=network.target

[Service]
Type=simple

ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.enable-lifecycle --web.enable-remote-write-receiver

Restart=on-failure
SuccessExitStatus=0
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=prometheus


[Install]
WantedBy=multi-user.target
EOF

# Start the service
systemctl enable prometheus
systemctl restart prometheus
systemctl status prometheus

Note: To enable Prometheus to receive data using the remote write protocol, you need to add --enable-feature=remote-write-receiver in the startup parameters. Without this, Prometheus will not listen on the /api/v1/write endpoint, and Nightingale’s data forwarding will return a 404 error.

Prometheus Data Source Configuration

Configuration Parameters Description

Name: The display name of the Prometheus database

URL: The address of the Prometheus database, e.g., http://${server-ip}:9090/

Timeout (ms): Set the timeout for connecting to the Prometheus database

p01

Username & Password: If Prometheus access authentication is enabled, you need to enter the username and password here. The password should be the original one, not the hashed one.

p02

If Prometheus uses username and password authentication, this configuration needs to be enabled. By default, the username and password are specified in the basic_auth_users section of the web-config.yml file. For security, the password is encrypted using the bcrypt hashing algorithm, so the Prometheus administrator must configure it in advance.

p03

Header & Value: Configure the verification parameters for requesting the Prometheus interface;

p04

Remote Write: Use probing features: If using recording rules or probing features, the metrics collected by probing need to be written back to the default data source database address using Remote Write.

p05

Remote Read: Configure the edge module’s internal network time-series database; this is usually used in scenarios where the alert engine is deployed in an edge data center. If this field is not empty, n9e-edge will use this address to access the time-series database. If this field is empty, n9e-edge will use the URL above to access the time-series database; Edge Data Center Reference

Associate Alarm Engine Cluster: Configure the binding of the data source to a specified alarm engine;

Set as Default Data Source: Set whether this is the default database for network detection and pingmesh data storage. If there are multiple time-series databases, only one can be set as the network detection data storage database;

Time-Series Database Type: Select according to the type of data source being accessed; this configuration parameter primarily optimizes dashboard data queries;

p06

Query Data

Once configured, you can see the newly created Prometheus data source under the integrated data sources.

p07

In the time-series metrics—instant query—select Prometheus as the data source, and enter the metrics in the built-in metrics box to query time-series data normally. (Before querying, make sure that data has been written to this time-series database.)

p08

开源版
Flashcat
Flashduty