【基础篇】prometheus命令行参数详解
文章目录
- 本篇内容讲解
- 命令行参数详解
本篇内容讲解
prometheus高频修改命令行参数详解
命令行参数详解
- 在页面的/页面上能看到所有的命令行参数,如图所示:
- 使用shell命令查看
# ./prometheus --help
usage: prometheus [<flags>]The Prometheus monitoring serverFlags:-h, --help Show context-sensitive help (also try --help-long and --help-man).--version Show application version.--config.file="prometheus.yml"Prometheus configuration file path.--web.listen-address="0.0.0.0:9090"Address to listen on for UI, API, and telemetry.--web.config.file="" [EXPERIMENTAL] Path to configuration file that can enable TLS or authentication.--web.read-timeout=5m Maximum duration before timing out read of the request, and closing idle connections.--web.max-connections=512 Maximum number of simultaneous connections.--web.external-url=<URL> The URL under which Prometheus is externally reachable (for example, if Prometheus is served via a reverse proxy). Used for generating relative and absolute links back to Prometheus itself. If the URL has a path portion, it will be used toprefix all HTTP endpoints served by Prometheus. If omitted, relevant URL components will be derived automatically.--web.route-prefix=<path> Prefix for the internal routes of web endpoints. Defaults to path of --web.external-url.--web.user-assets=<path> Path to static asset directory, available at /user.--web.enable-lifecycle Enable shutdown and reload via HTTP request.--web.enable-admin-api Enable API endpoints for admin control actions.--web.console.templates="consoles"Path to the console template directory, available at /consoles.--web.console.libraries="console_libraries"Path to the console library directory.--web.page-title="Prometheus Time Series Collection and Processing Server"Document title of Prometheus instance.--web.cors.origin=".*" Regex for CORS origin. It is fully anchored. Example: 'https?://(domain1|domain2)\.com'--storage.tsdb.path="data/"Base path for metrics storage.--storage.tsdb.retention=STORAGE.TSDB.RETENTION[DEPRECATED] How long to retain samples in storage. This flag has been deprecated, use "storage.tsdb.retention.time" instead.--storage.tsdb.retention.time=STORAGE.TSDB.RETENTION.TIMEHow long to retain samples in storage. When this flag is set it overrides "storage.tsdb.retention". If neither this flag nor "storage.tsdb.retention" nor "storage.tsdb.retention.size" is set, the retention time defaults to 15d. UnitsSupported: y, w, d, h, m, s, ms.--storage.tsdb.retention.size=STORAGE.TSDB.RETENTION.SIZEMaximum number of bytes that can be stored for blocks. A unit is required, supported units: B, KB, MB, GB, TB, PB, EB. Ex: "512MB".--storage.tsdb.no-lockfileDo not create lockfile in data directory.--storage.tsdb.allow-overlapping-blocksAllow overlapping blocks, which in turn enables vertical compaction and vertical query merge.--storage.remote.flush-deadline=<duration>How long to wait flushing sample on shutdown or config reload.--storage.remote.read-sample-limit=5e7Maximum overall number of samples to return via the remote read interface, in a single query. 0 means no limit. This limit is ignored for streamed response types.--storage.remote.read-concurrent-limit=10Maximum number of concurrent remote read calls. 0 means no limit.--storage.remote.read-max-bytes-in-frame=1048576Maximum number of bytes in a single frame for streaming remote read response types before marshalling. Note that client might have limit on frame size as well. 1MB as recommended by protobuf by default.--rules.alert.for-outage-tolerance=1hMax time to tolerate prometheus outage for restoring "for" state of alert.--rules.alert.for-grace-period=10mMinimum duration between alert and restored "for" state. This is maintained only for alerts with configured "for" time greater than grace period.--rules.alert.resend-delay=1mMinimum amount of time to wait before resending an alert to Alertmanager.--alertmanager.notification-queue-capacity=10000The capacity of the queue for pending Alertmanager notifications.--query.lookback-delta=5m The maximum lookback duration for retrieving metrics during expression evaluations and federation.--query.timeout=2m Maximum time a query may take before being aborted.--query.max-concurrency=20Maximum number of queries executed concurrently.--query.max-samples=50000000Maximum number of samples a single query can load into memory. Note that queries will fail if they try to load more samples than this into memory, so this also limits the number of samples a query can return.--enable-feature= ... Comma separated feature names to enable. Valid options: promql-at-modifier, promql-negative-offset, remote-write-receiver, exemplar-storage, expand-external-labels. See https://prometheus.io/docs/prometheus/latest/feature_flags/ for moredetails.--log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error]--log.format=logfmt Output format of log messages. One of: [logfmt, json]
-
重要参数讲解
-
--web.listen-address=“0.0.0.0:9090” 代表prometheus监听的地址,多个prometheus实例在一起时候会争抢。
-
--storage.tsdb.path=“data/” 本地tsdb存储位置
-
--storage.tsdb.retention.time 代表数据保留时间 默认15天
-
--web.enable-lifecycle 代表开启热更新配置
-
热更新演示:
修改prometheus配置文件参数:
vim prometheus.yml
# my global config
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"scrape_interval: 10s # 添加本行# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ["localhost:9090"]
# 热更新:
curl -X POST -vvv localhost:9090/-/reload
* About to connect() to localhost port 9090 (#0)
* Trying ::1...
* Connected to localhost (::1) port 9090 (#0)
> POST /-/reload HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:9090
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 28 Apr 2025 10:42:50 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact
验证:
相关文章:
【基础篇】prometheus命令行参数详解
文章目录 本篇内容讲解命令行参数详解 本篇内容讲解 prometheus高频修改命令行参数详解 命令行参数详解 在页面的/页面上能看到所有的命令行参数,如图所示: 使用shell命令查看 # ./prometheus --help usage: prometheus [<flags>]The Promethe…...
SpringBoot实现接口防刷的5种高效方案详解
目录 前言:接口防刷的重要性 方案一:基于注解的访问频率限制 实现原理 核心代码实现 使用示例 优缺点分析 方案二:令牌桶算法实现限流 算法原理 核心实现 配置使用 适用场景分析 方案三:分布式限流(Redis …...
DeepSearch复现篇:QwQ-32B ToolCall功能初探,以Agentic RAG为例
DeepSearch复现篇:QwQ-32B ToolCall功能初探,以Agentic RAG为例 作者:CyPaul Space 原文地址:https://zhuanlan.zhihu.com/p/30289363967 全文阅读约3分钟~ 背景 今天看到 论文:Search-R1: Training LLMs to Reason …...
项目实战-贪吃蛇大作战【补档】
这其实算是一个补档,因为这个项目是我在大一完成的,但是当时没有存档的习惯,今天翻以前代码的时候翻到了,于是乎补个档,以此怀念和志同道合的网友一起做项目的日子 ₍ᐢ ›̥̥̥ ༝ ‹̥̥̥ ᐢ₎♡ 这里面我主要负责…...
power bi获取局域网内共享文件
power bi获取局域网内共享文件 需求: 数据源并不一定都是在本地,有可能在云端,也有可能在其他服务器,今天分享如果数据源在另外一台服务器,如何获取数据源的方法。 明确需求:需要通过PowerBI获取局域网中的…...
100%提升信号完整性:阻抗匹配在高速SerDes中的实践与影响
一个高速信号SerDes通道(例如PCIe、112G/224G-PAM4)包含了这些片段: 传输线连通孔(PTH or B/B via)连接器高速Cable锡球(Ball and Bump) 我们会希望所有的片段都可以有一致的阻抗,…...
第六章:Tool and LLM Integration
Chapter 6: Tool and LLM Integration 从执行流到工具集成:如何让AI“调用真实世界的技能”? 在上一章的执行流框架中,我们已经能让多个代理协作完成复杂任务。但你是否想过:如果用户要求“查询实时天气”或“打开网页搜索”&…...
prompt提示词编写技巧
为什么学习prompt编写 目的:通过prompt的编写,提升LLM输出相关性、准确性和多样性,并对模型输出的格式进行限制,满足我们的业务需求。 学过提示词工程的人:像“专业导演”,通过精准指令控制 AI 输出&#…...
Nginx配置SSL详解
文章目录 Nginx配置SSL详解1. SSL/TLS 基础知识2. 准备工作3. 获取SSL证书4. Nginx SSL配置步骤4.1 基础配置4.2 配置说明 5. 常见配置示例5.1 双向认证配置5.2 多域名SSL配置 6. 安全优化建议7. 故障排查总结参考资源下载验证的完整实例 Nginx配置SSL详解 1. SSL/TLS 基础知识…...
网络安全之红队LLM的大模型自动化越狱
前言 大型语言模型(LLMs)已成为现代机器学习的重要支柱,广泛应用于各个领域。通过对大规模数据的训练,这些模型掌握了多样化的技能,展现出强大的生成与理解能力。然而,由于训练数据中难以完全剔除有毒内容&…...
【技术笔记】通过Cadence Allegro创建一个PCB封装(以SOT23为例)
【技术笔记】通过Cadence Allegro创建一个PCB封装(以SOT23为例) 一、焊盘创建二、PCB封装设计三、丝印位号及标识添加 更多内容见专栏:【硬件设计遇到了不少问题】、【Cadence从原理图到PCB设计】 一、焊盘创建 首先要找到元器件的相关手册&…...
新环境注册为Jupyter 内核
1. 确认环境是否已注册为内核 在终端运行以下命令,查看所有已注册的内核: jupyter kernelspec list2. 为自定义环境注册内核 步骤 1:激活目标虚拟环境 conda activate your_env_name # 替换为你的环境名步骤 2:安装…...
[Spring] Seata详解
🌸个人主页:https://blog.csdn.net/2301_80050796?spm1000.2115.3001.5343 🏵️热门专栏: 🧊 Java基本语法(97平均质量分)https://blog.csdn.net/2301_80050796/category_12615970.html?spm1001.2014.3001.5482 🍕 Collection与…...
使用JDK的数据校验和Spring的自定义注解校验前端传递参数的两种方法
第一种:JDK的数据校验注解 PostMapping("/test")public String test(QueryParam param, RequestHeader(value "App_key") String App_key,RequestHeader(value "App_secret") String App_secret) throws IOException {param.setApp…...
JS错误处理的新方案 (不使用try-catch)
错误处理一直是JavaScript开发者需要认真对待的问题,传统的try-catch语法虽然简单直观,但在异步代码中使用时存在诸多限制。 try-catch的局限性 传统try-catch模式在现代JavaScript开发中面临的问题: 1. 异步错误捕获的缺陷 try-catch无法…...
前端实现商品放大镜效果(Vue3完整实现)
前端实现商品放大镜效果(Vue3完整实现) 前言 在电商类项目中,商品图片的细节展示至关重要。放大镜效果能显著提升用户体验,允许用户在不跳转页面的情况下查看高清细节。本文将基于Vue3实现一个高性能的放大镜组件,完整…...
redis未授权访问漏洞学习
一、Redis常见用途 1. Redis介绍 全称与起源: Redis全称Remote Dictionary Service(远程字典服务),最初由antirez在2009年开发,用于解决网站访问记录统计的性能问题。发展历程: 从最初仅支持列表功能的内存数据库,经过十余年发展已支持多种…...
阿里qiankun微服务搭建
主服务 chat vue3 ts vite 子服务 ppt react 18 vite 子服务 agent 主服务 npm i vite-plugin-qiankun mian.ts import ./style/base.scss import virtual:svg-icons-register import { createApp } from vue import { createPinia } from piniaimport App from ./App.vue im…...
【CodeSprint】第二章-2.1 简单模拟
第二章 2.1 简单模拟 ✏️ 关于专栏:专栏用于记录 prepare for the coding test。 1. 简单模拟 简单模拟题目不需要复杂算法,直接按照题意一步步模拟即可。 1.1 促销计算 题目描述 某百货公司为了促销,采用购物打折的优惠方法:…...
Golang实现函数默认参数
golang原生不支持默认参数 在日常开发中,我们有时候需要使用默认设置,但有时候需要提供自定义设置 结构体/类,在Java我们可以使用无参、有参构造函数来实现,在PHP中我们也可以实现(如 public function xxx($isCName false, $sec…...
【Python Web开发】03-HTTP协议
文章目录 1. HTTP协议基础1.1 请求-响应模型1.2 请求方法1.3 请求和响应结构1.4 状态码 2. Python 发送 HTTP 请求2.1 urllib库2.2 requests 库 3. Python 构建 HTTP 服务器3.1 http.server模块3.2 Flask 框架 4. HTTP 协议的安全问题5. 缓存和性能优化 HTTP(Hypert…...
提高营销活动ROI:大数据驱动的精准决策
提高营销活动ROI:大数据驱动的精准决策 大家好,我是Echo_Wish。今天我们来聊聊如何通过大数据来提高营销活动的ROI(投资回报率)。我们都知道,随着市场的日益竞争,营销的成本不断增加,如何在这片红海中脱颖而出,不仅需要精准的营销策略,还需要依靠先进的技术,尤其是大…...
前端excel导出
在数据可视化和管理日益重要的今天,前端实现 Excel 导出功能已经成为众多项目中的刚需。 一、Excel 导出的常见场景 数据报表导出:在企业管理系统、数据分析平台中,用户经常需要将系统中的数据以 Excel 表格的形式导出,便于离…...
pymsql(SQL注入与防SQL注入)
SQL注入: import pymysql# 创建数据库连接 返回一个对象 conn pymysql.connect(host"localhost", # MySQL服务器地址 本地地址 127.0.0.1user"root", # 用户名 (账号)password"155480", # 密码database&qu…...
基于Springboot + vue + 爬虫实现的高考志愿智能推荐系统
项目描述 本系统包含管理员和学生两个角色。 管理员角色: 个人中心管理:管理员可以管理自己的个人信息。 高校信息管理:管理员可以查询、添加或删除高校信息,并查看高校详细信息。 学生管理:管理员可以查询、添加或…...
delphi使用sqlite3
看了一下delphi调用sqlite3最新版本的调用,网上说的都很片面,也没有完整的资料了。 我自己研究了一下,分享出来。 在调用demo中,官方也给了一个demo但是功能很少,没有参考价值。 1.定义: 首先把sqlite3…...
高压开关柜局部放电信号分析系统
高压开关柜局部放电信号分析系统 - 开发笔记 1. 项目概述 这个项目是我在2025年实现的高压开关柜局部放电信号分析系统,目的是通过采集分析局部放电信号,判断设备的工作状态和潜在故障。系统包含从信号模拟生成、特征提取、到深度学习模型训练的全流程…...
ai环境conda带torch整体迁移。
conda打包好的GPU版torch环境,其实很简单,就是conda装好的torch环境env整体打包,然后到新机器上再解压到env路径。 打开搭建好的环境,找自己路径,我默认的是这个。 cd/root/anaconda3/envs/ 然后整个文件夹打包。tar -…...
电价单位解析与用电设备耗电成本计算
一、电价单位 元/kWh 的解析 定义: 元/kWh 表示每千瓦时电能的费用,即1度电的价格。例如,若电价为0.5元/kWh,则使用1千瓦的电器1小时需支付0.5元。 电价构成: 中国销售电价由四部分组成: 上网电价…...
辛格迪客户案例 | 华道生物细胞治疗生产及追溯项目(CGTS)
01 华道(上海)生物医药有限公司:细胞治疗领域的创新先锋 华道(上海)生物医药有限公司(以下简称“华道生物”)是一家专注于细胞治疗技术研发与应用的创新型企业,尤其在CAR-T细胞免疫…...
C++(初阶)(十三)——继承
继承 继承概念示例 定义格式 继承和访问方式继承方式访问方式实例 继承类模板基类和派生类之间的转换继承中的作用域隐藏规则选择题 派生类的默认成员函数默认成员函数派生类中的实现 实现一个不能被继承的类继承与友元继承与静态成员多继承及其菱形继承问题虚继承多继承指针偏…...
S09-电机运行时间
感谢粉丝网友的支持,也欢迎你们的讨论和分享。昨天我们简单讨论了一下标准功能块的重要性,仅仅是拿电机块举了一个例子,有粉丝问能否把电机运行时间做到块里面,完善一下功能呢?那是绝对当然的100%可以的啊!…...
大语言模型(LLMs)微调技术总结
文章目录 全面总结当前大语言模型(LLM)微调技术1. 引言2. 为什么需要微调?3. 微调技术分类概览4. 各种微调技术详细介绍4.1 基础微调方法4.1.1 有监督微调(Supervised Fine-Tuning, SFT)4.1.2 全参数微调(F…...
python练习:求数字的阶乘
求数字的阶乘 eg:5的阶乘 54321 """ 求数字的阶乘 eg:5的阶乘 5*4*3*2*1 """count 1 for i in range(1,6):count count * iprint(count)运行结果:...
综合练习一
背景 某银行监管系统,需要设计并实现用户登入记录功能,每个用户登入系统时,系统自动记录登入用户的账户、登入时间、登入失败成功与否信息等,普通用户只能登入登出,管理员可以登入后查看日志及分析统计信息等。 用户…...
List--链表
一、链表 1.1 什么是List? 在C语言中,我们需要使用结构体struct来进行List(链表)的实现: struct ListNode {DataType Data;//DataType是任意类型的变量定义struct ListNode* next;//指向下一个结点的指针变量 }; 与之前的vect…...
SpeedyAutoLoot
SpeedyAutoLoot自动拾取插件 SpeedyAutoLoot.lua local AutoLoot CreateFrame(Frame)SpeedyAutoLootDB SpeedyAutoLootDB or {} SpeedyAutoLootDB.global SpeedyAutoLootDB.global or {}local BACKPACK_CONTAINER BACKPACK_CONTAINER local LOOT_SLOT_CURRENCY LOOT_SLOT…...
编程日志4.23
栈的C顺序表实现 #include<iostream> #include<stdexcept> using namespace std; //模板声明,表明Stack类是一个通用的模板,可以用于存储任何类型的元素T template<typename T> //栈的声明 //Stack类的声明,表示一个栈的…...
打印所有字段
package com.volvo.midend.vehicle;import com.volvo.midend.vehicle.dto.out.vista.VistaDemoVO;import java.lang.reflect.Field;public class TestAllFiled {// 递归打印类的所有字段public static void printAllFields(Class<?> clazz, int indentLevel) {// 根据缩…...
4G FS800DTU上传图像至巴法云
目录 1 前言 2 准备工作 2.1 硬件准备 2.2 软件环境 2.3 硬件连接 3 实现方案 4 巴法云平台账号创建与设备联网配置 4.1 创建账号 4.2 进入巴法云 4.3 获取联网参数 4.4 连接巴法云 5 拍照上传至巴法云 6 ESP32-CAM程序 7 总结 1 前言 巴法云(Bemfa Cloud)是一个…...
一键叠图工具
写了个拼图小工具 供大家测试 APP安卓的 测试下载 点击下载 百度网盘: https://pan.baidu.com/s/17B5KVIMMZlOAsF7a16KNug?pwd1234 提取码: 1234 拼图步骤:选图--选择变亮或变暗--滤镜发色 在正式开始之前,我们来定义几条原则先(熟悉…...
【OSG学习笔记】Day 12: 回调机制——动态更新场景
UpdateCallback 在OpenSceneGraph(OSG)里,UpdateCallback是用来动态更新场景的关键机制。 借助UpdateCallback,你能够实现节点的动画效果,像旋转、位移等。 NodeCallback osg::NodeCallback 是一个更通用的回调类&…...
快速上手Prism WPF 工程
1、Prism 介绍 定位: Prism 是 微软推出的框架,专为构建 模块化、可维护的复合式应用程序 设计,主要支持 WPF、Xamarin.Forms、UWP 等平台。核心功能: 模块化开发:将应用拆分为独立模块,…...
Dockerfile讲解与示例汇总
容器化技术已经成为应用开发和部署的标准方式,而Docker作为其中的佼佼者,以其轻量、高效、可移植的特性,深受开发者和运维人员的喜爱。本文将从实用角度出发,分享各类常用服务的Docker部署脚本与最佳实践,希望能帮助各位在容器化之路上少走弯路。 无论你是刚接触Docker的…...
MATLAB Coder代码生成(工业部署)——MATLAB技巧
MATLAB Coder是MATLAB生态中用于将算法代码转换为C/C++代码的核心工具,其生成的代码可直接部署到嵌入式硬件、工业控制器或企业级应用中,尤其在智能制造、物联网和实时控制领域具有广泛应用。 通过 MATLAB Coder,可以轻松地将 MATLAB 代码转换为高效的 C/C++ 代码,适用于嵌…...
3、CMake语法:制作和使用动态库和静态库
动态库和静态库 1 动态库和静态库简介1.1 静态库静态库文件类型.lib 文件.pdb 文件 1.2 动态库动态库文件类型 1.3 总结 2. 制作和使用静态库2.1 CMake指定输出的路径 2.2 VS利用第三方库编译静态库 2.3 使用静态库CMake链接静态库VS链接静态库 3. 制作和使用动态库3.1 CMake指…...
使用双端队列deque模拟栈stack
使用双端队列deque模拟栈stack 今天的内容有点简单~ 众所周知🤓👆,栈作为一个先进后出的结构,在计算机的世界确实能够发挥很多的作用。 而我们C祖师爷本贾尼是第一批把这个结构作为实实在在的容器做进std的人~ 那为了更好的了解…...
Spring系列四:AOP切面编程第三部分
🐋AOP-JoinPoint 1.通过JoinPoint可以获取到调用方法的签名 2.其他常用方法 ●代码实现 1.com.zzw.spring.aop.aspectj.SmartAnimalAspect Aspect //表示是一个切面类 Component //会将SmartAnimalAspect注入到容器 public class SmartAnimalAspect {//给Car配置…...
为什么使用ThreadLocal后要调用remove()方法呢?
ThreadLocalMap中包含一个数组,每个节点对应的类名叫Entry,这个类继承WeakReference<ThreadLocal<?>>,entry中有两个属性:key和value。特别需要指出的是key来自于父类中的threadLocal对象。 为了避免内存泄露&#…...
如何在idea 中写spark程序
在 IntelliJ IDEA 中编写 Spark 程序可以通过以下步骤进行: 1. **安装 Scala 插件**:首先确保已经安装了 Scala 插件。在 IntelliJ IDEA 中选择 File -> Settings -> Plugins -> 搜索 Scala -> 安装插件。 2. **创建新项目**:在…...