总目录索引:K8s从入门到放弃系列

Flags:

#帮助

  -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.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.


#可从外部访问Prometheus的URL(例如,如果Prometheus是通过反向代理提供的)。 用于生成返回到Prometheus本身的相对和绝对链接。 如果URL包含路径部分,它将被用作Prometheus服务的所有HTTP端点的前缀。 如果省略,则会自动派生相关的URL组件。

      --web.external-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 to prefix all HTTP endpoints served by Prometheus. If omitted, relevant URL components will be derived automatically.


#内部路由的前缀。 默认为--web.external-url的路径。

      --web.route-prefix=  Prefix for the internal routes of web endpoints. Defaults to path of --web.external-url.


#静态资源目录的路径,位于/ user

      --web.user-assets=   Path to static asset directory, available at /user.


#启用是否通过HTTP请求重新加载

      --web.enable-lifecycle     Enable shutdown and reload via HTTP request.


#管理控制操作启用API端点

      --web.enable-admin-api     Enable API endpoints for admin control actions.


#模板目录的路径,位于/consoles

      --web.console.templates="consoles"  

                                 Path to the console template directory, available at /consoles.


#控制台库目录的路径

      --web.console.libraries="console_libraries"  

                                 Path to the console library directory.


#Prometheus实例页面的文档标题

      --web.page-title="Prometheus Time Series Collection and Processing Server"  

                                 Document title of Prometheus instance.


#用于CORS来源的正则表达式。

      --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.time”。

      --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.


#将数据保留多长时间。默认15天

      --storage.tsdb.retention.time=STORAGE.TSDB.RETENTION.TIME  

                                 How 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.


#可以为块存储的最大字节数。 支持的单位:KB,MB,GB,TB,PB。

      --storage.tsdb.retention.size=STORAGE.TSDB.RETENTION.SIZE  

                                 [EXPERIMENTAL] Maximum number of bytes that can be stored for blocks. Units supported: KB, MB, GB, TB, PB. This flag is experimental and can be changed in future releases.


#不在数据目录中创建锁文件

      --storage.tsdb.no-lockfile  

                                 Do not create lockfile in data directory.


#允许重叠的块,从而启用垂直压缩和垂直查询合并。

      --storage.tsdb.allow-overlapping-blocks  

                                 [EXPERIMENTAL] Allow overlapping blocks, which in turn enables vertical compaction and vertical query merge.


#压缩tsdb WAL

      --storage.tsdb.wal-compression  

                                 Compress the tsdb WAL.


#关闭或配置重新加载时等待刷写数据的时间

      --storage.remote.flush-deadline=  

                                 How long to wait flushing sample on shutdown or config reload.


#在单个查询中通过远程读取接口返回的最大样本总数。 0表示没有限制。 对于流式响应类型,将忽略此限制。

      --storage.remote.read-sample-limit=5e7  

                                 Maximum 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.


#并发远程读取调用的最大数目。 0表示没有限制。

      --storage.remote.read-concurrent-limit=10  

                                 Maximum number of concurrent remote read calls. 0 means no limit.


#用于流式传输远程读取响应类型的单个帧中的最大字节数。 请注意,客户端也可能会限制帧大小。 1MB为默认情况下由protobuf推荐

--storage.remote.read-max-bytes-in-frame=1048576  

                                 Maximum 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.


#容忍中断以恢复警报“ for”状态的最长时间。

      --rules.alert.for-outage-tolerance=1h  

                                 Max time to tolerate prometheus outage for restoring "for" state of alert.


#警报和恢复的“ for”状态之间的最短持续时间。 仅对于配置的“ for”时间大于宽限期的警报,才保持此状态。

      --rules.alert.for-grace-period=10m  

                                 Minimum duration between alert and restored "for" state. This is maintained only for alerts with configured "for" time greater than grace period.


#将警报重新发送到Alertmanager之前等待的最短时间。

      --rules.alert.resend-delay=1m  

                                 Minimum amount of time to wait before resending an alert to Alertmanager.


#等待的Alertmanager通知的队列容量。

      --alertmanager.notification-queue-capacity=10000  

                                 The capacity of the queue for pending Alertmanager notifications.


#向Alertmanager发送警报的超时。

      --alertmanager.timeout=10s  

                                 Timeout for sending alerts to Alertmanager.


#在表达式求值期间检索指标的最大回溯持续时间。

      --query.lookback-delta=5m  The maximum lookback duration for retrieving metrics during expression evaluations.


#最大查询时间。

      --query.timeout=2m         Maximum time a query may take before being aborted.


#最大查询并发数

      --query.max-concurrency=20  

                                 Maximum number of queries executed concurrently.


#单个查询可以加载到内存中的最大样本数。 请注意,如果查询尝试将更多的样本加载到内存中,则查询将失败,因此这也限制了查询可以返回的样本数。

      --query.max-samples=50000000  

                                 Maximum 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.


#日志级别

      --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]


参考文章:https://www.cnblogs.com/zhoujinyi/p/11934062.html