nsqd is the daemon that receives, queues, and delivers messages to clients.

' nsqd '是一个守护进程,它接收、排队并向客户端发送消息。

It can be run standalone but is normally configured in a cluster with nsqlookupd instance(s) (in which case it will announce topics and channels for discovery).

它可以独立运行,但通常是在具有“nsqlookupd”实例的集群中配置的(在这种情况下,它将声明用于发现的主题和通道)。

It listens on two TCP ports, one for clients and another for the HTTP API. It can optionally listen on a third port for HTTPS.

它监听两个TCP端口,一个用于客户机,另一个用于HTTP API。它可以选择监听HTTPS的第三个端口。

Command Line Options

命令行选项

-auth-http-address value
    <addr>:<port> to query auth server (may be given multiple times) 
#   <addr>:<port> 查询授权服务器 (可能会给多次)

-broadcast-address string
    address that will be registered with lookupd (defaults to the OS hostname) (default "PROSNAKES.local")
#将使用lookupd注册的地址(默认为OS主机名)(默认为“prosnake .local”)

-config string
    path to config file
#配置文件路径

-data-path string
    path to store disk-backed messages
#存储磁盘支持的消息的路径

-deflate
    enable deflate feature negotiation (client compression) (default true)
#启用压缩功能协商(客户端压缩)(默认为true)   

-e2e-processing-latency-percentile value
    message processing time percentiles (as float (0, 1.0]) to track (can be specified multiple times or comma separated '1.0,0.99,0.95', default none)
#要跟踪的消息处理时间百分比(作为浮点数(0,1.0))(可以指定多次或逗号分隔'1.0,0.99,0.95',默认为none)

-e2e-processing-latency-window-time duration
    calculate end to end latency quantiles for this duration of time (ie: 60s would only show quantile calculations from the past 60 seconds) (default 10m0s)
#计算这段时间内的端到端延迟分位数(即:60s只显示过去60秒的分位数计算)(默认为10m0s)

-http-address string
    <addr>:<port> to listen on for HTTP clients (default "0.0.0.0:4151")
# <addr>:<port> 监听HTTP客户机(默认 "0.0.0.0:4151")

-http-client-connect-timeout duration
    timeout for HTTP connect (default 2s)
#HTTP连接超时(默认2s) 

-http-client-request-timeout duration
    timeout for HTTP request (default 5s)
#HTTP请求超时(默认5秒)  

-https-address string
    <addr>:<port> to listen on for HTTPS clients (default "0.0.0.0:4152")
# <addr>:<port> 监听HTTPS客户机(默认 "0.0.0.0:4151") 

-log-prefix string
    log message prefix (default "[nsqd] ")
# 日志消息前缀(默认为“[nsqd]”)
-lookupd-tcp-address value
    lookupd TCP address (may be given multiple times)
#查找TCP地址(可能给出多次)

-max-body-size int
    maximum size of a single command body (default 5242880)
#单个命令体的最大值(默认为5242880)

-max-bytes-per-file int
    number of bytes per diskqueue file before rolling (default 104857600)
#滚动前每个磁盘队列文件的字节数(默认为104857600)

-max-deflate-level int
    max deflate compression level a client can negotiate (> values == > nsqd CPU usage) (default 6)
#客户端可以协商的最大压缩级别(>值== > nsqd CPU使用量)(默认6)

-max-heartbeat-interval duration
    maximum client configurable duration of time between client heartbeats (default 1m0s)
#最大客户端可配置的心跳间隔时间(默认为1m0s)

-max-msg-size int
    maximum size of a single message in bytes (default 1048576)
#单个消息的最大大小(默认为1048576),单位为字节

-max-msg-timeout duration
    maximum duration before a message will timeout (default 15m0s)
#消息超时前的最大持续时间(默认为15m0s)

-max-output-buffer-size int
    maximum client configurable size (in bytes) for a client output buffer (default 65536)
#客户机输出缓冲区的最大客户机可配置大小(以字节为单位)(默认为65536)

-max-output-buffer-timeout duration
    maximum client configurable duration of time between flushing to a client (default 1s)
#从刷新到客户机的最大客户机可配置持续时间(默认为1)

-max-rdy-count int
    maximum RDY count for a client (default 2500)
#客户机的最大RDY计数(默认为2500)

-max-req-timeout duration
    maximum requeuing timeout for a message (default 1h0m0s)
#消息的最大请求超时(默认为1h0m0s)

-mem-queue-size int
    number of messages to keep in memory (per topic/channel) (default 10000)
#要保存在内存中的消息数量(每个主题/通道)(默认为10000条)

-msg-timeout string
    duration to wait before auto-requeing a message (default "1m0s")
#自动请求消息前等待的时间(默认为“1m0s”)

-node-id int
    unique part for message IDs, (int) in range [0,1024) (default is hash of hostname) (default 616)
#消息id的惟一部分(int),范围[0,1024](默认是主机名的散列)(默认是616)

-snappy
    enable snappy feature negotiation (client compression) (default true)
#启用快速特性协商(客户端压缩)(默认为true)

-statsd-address string
    UDP <addr>:<port> of a statsd daemon for pushing stats
#UDP <addr>:<port>用于推送统计信息的statsd守护进程

-statsd-interval string
    duration between pushing to statsd (default "1m0s")
#推送到statsd之间的持续时间(默认为“1m0s”)

-statsd-mem-stats
    toggle sending memory and GC stats to statsd (default true)
#切换向statsd发送内存和GC统计信息(默认为true)
-statsd-prefix string
    prefix used for keys sent to statsd (%s for host replacement) (default "nsq.%s")
#用于发送到statsd的密钥的前缀(%s用于主机替换)(默认为“nsq.%s”)

-sync-every int
    number of messages per diskqueue fsync (default 2500)
#每个磁盘队列fsync的消息数(默认为2500)

-sync-timeout duration
    duration of time per diskqueue fsync (default 2s)
#每个磁盘队列fsync的持续时间(默认2s)

-tcp-address string
    <addr>:<port> to listen on for TCP clients (default "0.0.0.0:4150")
# <addr>:<port>监听TCP客户机(默认值“0.0.0.0:4150”)

-tls-cert string
    path to certificate file
#tls证书文件路径

-tls-client-auth-policy string
    client certificate auth policy ('require' or 'require-verify')
#tls客户端证书验证策略(“require”或“requireverify”)

-tls-key string
    path to key file
#tls key 文件 路径
-tls-min-version value
    minimum SSL/TLS version acceptable ('ssl3.0', 'tls1.0', 'tls1.1', or 'tls1.2') (default 769)
#可接受的最小SSL/TLS版本(“ssl3.0”、“tls1.0”、“tls1.1”或“tls1.2”)(默认值769)

-tls-required
    require TLS for client connections (true, false, tcp-https)
#客户端连接需要TLS (true、false、tcp-https)

-tls-root-ca-file string
    path to certificate authority file
#证书授权文件的路径

-verbose
    enable verbose logging
#启用详细日志

-version
    print version string
#打印版本字符串

-worker-id
    do NOT use this, use --node-id
#不要使用这个,使用——node-id

HTTP API

活跃度

版本信息

  • /stats - comprehensive runtime telemetry

检查综合运行

  • /pub - publish a message to a topic

发布消息到话题(topic)

  • /mpub - publish multiple messages to a topic

发布多个消息到话题(topic)

nsqd的配置

pprof 调试入口

生成pprof CPU配置文件

生成pprof go程 配置文件

生成pprof 堆 配置文件

生成 pprof 块 配置文件

生成 pprof OS 线程配置文件

v1 namespace (as of nsqd v0.2.29+):

v1 命名空间 (as of nsqd v0.2.29+):

创建一个新的话题(topic)

删除一个话题(topic)

清空一个话题(topic)

暂停话题(topic)的消息流

恢复话题(topic)的消息流

创建一个新的通道(channel)

删除一个通道(channel)

清空一个通道(channel)

暂停通道(channel)的消息流

恢复通道(channel)的消息流

  • POST /pub

Publish a message

发布一条消息

Query Params:

查询参数

topic - the topic to publish to
#    要发布到的主题
defer - the time in ms to delay message delivery (optional)
#    ms中延迟消息传递的时间(可选)

Body:

主题

raw message bytes
#    未处理的二进制字节 消息    

Example:

案例

$ curl -d "<message>" http://127.0.0.1:4151/pub?topic=name
  • POST /mpub

Publish multiple messages in one roundtrip

在一次往返中发布多个消息

Query Params:

查询参数

topic - the topic to publish to
#    要发布到的主题
binary - bool ('true' or 'false') to enable binary mode
#布尔 ('true'或'false')启用二进制模式

Body

\n separated raw message bytes
# \n 分离原始消息字节

NOTE: by default /mpub expects messages to be delimited by \n, use the ?binary=true query parameter to enable binary mode where the POST body is expected to be in the following format (the HTTP Content-Length header should be sent as the total size of the POST body):

默认情况下 /mpub希望消息以 \n分隔,请使用?binary=true查询参数启用二进制模式,在这种模式下,POST主体应该是以下格式(HTTP Content-Length 报头应该作为“POST”主体的总大小发送):

[ 4-byte num messages ]
#[4字节数字消息]
[ 4-byte message #1 size ][ N-byte binary data ]
#[4字节消息#1大小][n字节二进制数据]
      ... (repeated <num_messages> times)
#      …(重复< num_messages >次)

Example:

案例

$ curl -d "<message>\n<message>\n<message>" http://127.0.0.1:4151/mpub?topic=name
  • POST /topic/create

Create a topic

创建一个主题

Query Params:

查询参数

topic - the topic to create
#    要创建的主题

Example:

案例

$ curl -X POST http://127.0.0.1:4151/topic/create?topic=name
  • POST /topic/delete

Delete an existing topic (and all channels)

删除现有主题(和所有通道)

Query Params:

查询参数

topic - the existing topic to delete
# 要删除的现有主题

Example:

​ 案例

$ curl -X POST http://127.0.0.1:4151/topic/delete?topic=name
  • POST /channel/create

Create a channel for an existing topic

为现有主题创建通道

Query Params:

查询参数

topic - the existing topic
#现有的主题
channel - the channel to create
#要创建的通道

Example:

案例

$ curl -X POST http://127.0.0.1:4151/channel/create?topic=name&channel=name
  • POST /channel/delete

Delete an existing channel on an existing topic

删除现有主题上的现有通道

Query Params:

查询条件

topic - the existing topic
#现有的主题
channel - the existing channel to delete
#要删除的现有通道

Example:

案例

$ curl -X POST http://127.0.0.1:4151/channel/delete?topic=name&channel=name
  • POST /topic/empty

Empty all the queued messages (in-memory and disk) for an existing topic

清空现有主题的所有排队消息(内存和磁盘中)

Query Params:

查询参数

topic - the existing topic to empty
#现有要清空的主题

Example:

案例

$ curl -X POST http://127.0.0.1:4151/topic/empty?topic=name
  • POST /channel/empty

Empty all the queued messages (in-memory and disk) for an existing channel

清空现有通道的所有排队消息(在内存和磁盘中)

Query Params:

查询参数

topic - the existing topic
# 现有主题
channel - the existing channel to empty
# 需要清空的通道

Example:

案例

$ curl -X POST http://127.0.0.1:4151/channel/empty?topic=name&channel=name
  • POST /topic/pause

Pause message flow to all channels on an existing topic (messages will queue at topic)

暂停到现有主题上的所有通道的消息流(消息将在topic处排队)

Query Params:

查询参数

topic - the existing topic
# 现有的主题

Example:

案例

$ curl -X POST http://127.0.0.1:4151/topic/pause?topic=name
  • POST /topic/unpause

Resume message flow to channels of an existing, paused, topic

恢复到已存在的、已暂停的主题的通道的消息流

Query Params:

查询参数

topic - the existing topic
#现有主题

Example:

案例

$ curl -X POST http://127.0.0.1:4151/topic/unpause?topic=name
  • POST /channel/pause

Pause message flow to consumers of an existing channel (messages will queue at channel)

暂停到现有通道的使用者的消息流(消息将在channel处排队)

Query Params:

查询参数

topic - the existing topic
#现有主题
channel - the existing channel to pause
#要暂停的现有通道

Example:

案例

$ curl -X POST http://127.0.0.1:4151/channel/pause?topic=name&channel=name
  • POST /channel/unpause

Resume message flow to consumers of an existing, paused, channel

恢复到现有的、已暂停的通道的使用者的消息流

Query Params:

查询参数

topic - the existing topic
#现有主题
channel - the existing channel to pause
#已经暂停的现有通道

Example:

案例

$ curl -X POST http://127.0.0.1:4151/channel/unpause?topic=name&channel=name
  • GET /stats

Return internal statistics

返回内部统计数据

Query Params

查询参数

format - (optional) `text` or `json` (default = `text`)
#格式 - (可选)' text '或' json '(默认= ' text ')
topic - (optional) filter to topic
#主题 - (可选)过滤到主题
channel - (optional) filter to channel
#通道 - (可选)通道过滤器

Example:

案例

$ curl http://127.0.0.1:4151/stats
  • GET /ping

Monitoring endpoint, should return 200 OK. It returns an HTTP 500 if it is not healthy.

监视端点,应该返回' 200 ' ' OK '。如果不健康,则返回HTTP ' 500 '。

NOTE: The only “unhealthy” state is if nsqd failed to write messages to disk when overflow occurred.

:唯一的“不健康”状态是当发生溢出时,“nsqd”无法将消息写入磁盘。

  • GET /info

Version information

版本信息

  • GET /debug/pprof

An index page of available debugging endpoints

可用的调试端点的索引页

  • GET /debug/pprof/profile

Starts a pprof CPU profile for 30s and returns the output via the request

启动30秒的“pprof”CPU配置文件,并通过请求返回输出

NOTE: this endpoint is not listed in the /debug/pprof index page because of its effect on runtime performance.

注意:这个端点在' /debug/pprof '索引页中没有列出,因为它对运行时性能有影响。

  • GET /debug/pprof/goroutine

Returns a stack trace for all running goroutines

返回所有运行goroutine的堆栈跟踪

  • GET /debug/pprof/heap

Returns a heap and memstats profile (top portion can be used as a pprof memory profile)

返回堆和memstats概要文件(顶部部分可以用作“pprof”内存概要文件)

  • GET /debug/pprof/block

Returns a goroutine blocking profile

返回goroutine阻塞配置文件

  • GET /debug/pprof/threadcreate

Returns goroutine stack traces that led to the creation of an OS thread

返回导致创建OS线程的goroutine堆栈跟踪

  • GET /config/nsqlookupd_tcp_addresses

List of nsqlookupd TCP addresses.

nsqlookupd TCP地址列表。

Example:

案例

$ curl http://127.0.0.1:4151/config/nsqlookupd_tcp_addresses
  • PUT /config/nsqlookupd_tcp_addresses

Update the nsqlookupd TCP addresses.

更新nsqlookupd TCP地址。

Body:

主体

JSON array of TCP addresses.
# TCP地址的JSON数组。

Example:

案例

$ curl -X PUT http://127.0.0.1:4151/config/nsqlookupd_tcp_addresses \
    -d '["127.0.0.1:4160", "127.0.0.2:4160"]'

Debugging and Profiling

调试和分析

nsqd provides a suite of profiling endpoints that integrate directly with Go’s pprof tool. If you have the go tool suite installed, simply run:

“nsqd”提供了一套与Go的pprof工具直接集成的分析端点。如果你已经安装了go工具套件,只需运行:

# memory profiling
# 内存分析
$ go tool pprof http://localhost:4151/debug/pprof/heap

# cpu profiling
# cpu分析
$ go tool pprof http://localhost:4151/debug/pprof/profile

TLS

When nsqd is configured with --tls-cert and --tls-key clients can negotiate upgrading their connection to TLS for enhanced security.

当“nsqd”配置为“—tl -cert”和“—tl -key”时,客户端可以协商将其连接升级到TLS,以增强安全性。

Additionally, you can require that clients negotiate TLS with --tls-required (as of nsqd v0.2.28+).

此外,您可以要求客户端与“--tls-required”协商TLS(从“nsqd”“v0.2.28+”开始)。

You can configure an nsqd client certificate policy via --tls-client-auth-policy (require or require-verify):

  • require - the client must offer a certificate, otherwise rejected
  • require-verify - the client must offer a valid certificate according to the default CA or the chain specified by --tls-root-ca-file, otherwise rejected

您可以通过 --tls-client-auth-policy(require or require-verify)配置一个“nsqd”客户端证书策略:

  • require-客户必须提供证书,否则拒绝
  • require-verify-客户端必须根据 --tls-client-auth-policy(require or require-verify)指定的默认CA或链提供有效的证书,否则将被拒绝

This can be used as a form of client authentication (as of nsqd v0.2.28+).

这可以用作客户机身份验证的一种形式(从“nsqd”“v0.2.28+”开始)。

If you want to generate a password-less self-signed certificate using openssl:

如果您想使用openssl生成无密码自签名证书:

$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

AUTH

NOTE: available in nsqd v0.2.29+

注:可用“nsqd”“v0.2.29+”

To configure nsqd to require authorization you need to specify the -auth-http-address=host:port flag with an Auth Server that conforms to the Auth HTTP protocol.

要将' nsqd '配置为需要授权,您需要指定' -auth-http-address=host:port '标志和一个符合Auth HTTP协议的Auth服务器。

NOTE: It is expected when using authorization that only the nsqd TCP protocol is exposed to external clients, not the HTTP(S) endpoints. See the note below about exposing stats and lookup to clients with auth.

注意:在使用授权时,只有“nsqd”TCP协议才会暴露给外部客户机,而不是HTTP端点。请参阅下面关于使用auth向客户端公开统计信息和查找的说明。

The Auth Server must accept an HTTP request on:

Auth服务器必须接受HTTP请求:

/auth?remote_ip=...&tls=...&auth_secret=...

And return a response in the following format:

按照以下格式回复:

{
  "ttl": 3600,
  "identity": "username",
  "identity_url": "http://....",
  "authorizations": [
    {
      "permissions": [
        "subscribe",
        "publish"
      ],
      "topic": ".*",
      "channels": [
        ".*"
      ]
    }
  ]
}

Note that topic and channel strings must be regexes for nsqd to apply permissions. nsqd will cache the response for up to the TTL duration and will re-request authorization on that interval.

注意,主题和通道字符串必须为' nsqd '应用权限的regexes。“nsqd”将缓存响应直至TTL持续时间,并在此期间重新请求授权。

It is expected that in most cases authorization will be used with TLS to secure sensitive information secrets passed from clients to nsqd. Communication between nsqd and the Auth Server is expected to be over a trusted network (and is not encrypted). If an Auth Server is making auth choices solely based on remote IP information, clients can use a placeholder string (like .) as the AUTH command body (which the Auth Server ignores).

预计在大多数情况下,TLS将使用授权来保护从客户端传递到“nsqd”的敏感信息机密。“nsqd”和Auth服务器之间的通信预计将通过一个受信任的网络进行(并且“没有”加密)。如果Auth服务器仅基于远程IP信息进行Auth选择,客户端可以使用占位符字符串(如' . ')作为' Auth '命令体(Auth服务器会忽略它)。

An example Auth Server is pynsqauthd.

Auth服务器的一个例子是pynsqauthd

A helper server to expose nsqlookupd and nsqd /stats data to clients, filtered by permissions from the Auth Server, can be found in nsqauthfilter

可以在nsqauthfilter中找到一个助手服务器,它将“nsqlookupd”和“nsqd”“/stats”数据公开给客户机,并根据来自Auth服务器的权限进行过滤。

When using the command line utilities, authorization can be used via the --reader-opt flag.

当使用命令行实用程序时,可以通过--reader-opt标志使用授权。

$ nsq_tail ... -reader-opt="tls_v1,true" -reader-opt="auth_secret,$SECRET"

End-to-End Processing Latency

端到端处理延迟

You can optionally configure nsqd to collect and emit end-to-end message processing latency for configurable percentiles using the --e2e-processing-latency-percentile flag.

您可以选择配置nsqd,使用--e2e-processing-latency-percentile 标志为可配置百分比收集和发出端到端消息处理延迟。

The values are calculated using a probabilistic percentile technique described in Effective Computation of Biased Quantiles over Data Streams. We use the perks package by bmizerany which implements this algorithm.

这些值是使用一种概率百分位数技术计算出来的,该技术描述在有效计算数据流上的偏置分位数中。我们使用 perks 包 依赖 bmizerany 实现了这个算法。

In order to bias the view toward more recent processing behavior we only keep quantile information for the past N minutes (configurable via --e2e-processing-latency-window-time). Internally we maintain two quantiles, per channel, that each store N/2 minutes worth of latency data. Every N/2 minutes we reset one quantile (and start inserting new data into it). Since quantiles can be merged, this results in a coarse rolling window.

为了使视图偏向于更近期的处理行为,我们只保留过去“N”分钟的分位数信息(可通过 --e2e-processing-latency-window-time配置)。在内部,我们为每个通道维护两个分位数,每个分位数存储“N/2”分钟的延迟数据。每N/2分钟我们重置一个分位数(并开始向其中插入新数据)。由于分位数可以合并,这导致粗滚动窗口。

Since we only collect data at the channel level, for a topic we aggregate and merge all channel quantiles. This technique can only be used if the data is on the same nsqd instance. However when data is being accumulated across nsqd (for instance via nsqlookupd), we take the average of the quantile values for each nsqd. In order to maintain some statistical accuracy regarding the distribution of latencies across nsqd, we also provide the min/max values in addition to the average.

因为我们只在channel级别收集数据,所以对于一个topic,我们聚合并合并所有channel分位数。此技术只能在数据位于相同的“nsqd”实例上时使用。然而,当数据通过nsqd(例如通过nsqlookupd)累积时,我们对每个nsqd取分位数值的平均值。为了在nsqd中保持延迟分布的统计准确性,我们还提供了最小/最大值和平均值。

NOTE: if there are no consumers connected the values cannot update despite there (obviously) being a slowly increasing end-to-end processing time for the queued messages. This is because end-to-end metrics are only calculated when nsqd receives a FIN for a given message from a client. When a consumer reconnects the values will adjust appropriately.

注意:如果没有连接消费者,这些值就不能更新,尽管(显然)队列消息的端到端处理时间在缓慢增加。这是因为端到端度量只在“nsqd”接收到来自客户机的给定消息的“FIN”时计算。当消费者重新连接时,这些值将进行适当的调整。

Statsd / Graphite Integration

When using --statsd-address to specify the UDP <addr>:<port> for statsd (or a port of statsd like statsdaemon), nsqd will push metrics to statsd periodically based on the interval specified in --statsd-interval (IMPORTANT: this interval should always be less than or equal to the interval at which statsd flushes to graphite). With this enabled nsqadmin can be configured to display charts directly from graphite.

当使用--statsd-address来指定 statsd (或者statsd的端口 statsdaemon)UPD <addr>:<port> 时,nsqd将根据 --statsd-interval中指定的间隔定期将度量数据推送到statsd(重要的是:这个间隔应该总是 小于或等于statsd流向graphite的间隔)。通过启用nsqadmin ,可以配置为直接从graphite中显示图表。

We recommend the following configuration for graphite (but these choices should be evaluated based on your available resources and requirements). Again, the important piece to remember is that statsd should flush at an interval less than or equal to the smallest time bucket in storage-schemas.conf and nsqd should be configured to flush at or below that same interval via --statsd-interval.

我们建议对graphite进行以下配置(但是这些选择应该根据您的可用资源和需求进行评估)。同样,需要记住的重要一点是statsd刷新的间隔应该小于或等于“存储模式”中最小的时间桶。storage-schemas.confnsqd 应该通过 --statsd-interval配置为在相同间隔处或以下刷新。

# storage-schemas.conf
[nsq]
pattern = ^nsq\..*
retentions = 1m:1d,5m:30d,15m:1y

# storage-aggregation.conf
[default_nsq]
pattern = ^nsq\..*
xFilesFactor = 0.2
aggregationMethod = average

The nsqd instance will push to the following statsd paths:

nsqd实例将推送到以下statsd路径:

nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.backend_depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.message_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.message_bytes
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.backend_depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.clients [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.deferred_count [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.in_flight_count [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.message_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.requeue_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.timeout_count

# if --statsd-mem-stats is enabled
nsq.<nsqd_host>_<nsqd_port>.mem.heap_objects [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.heap_idle_bytes [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.heap_in_use_bytes [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.heap_released_bytes [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.gc_pause_usec_100 [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.gc_pause_usec_99 [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.gc_pause_usec_95 [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.mem.next_gc_bytes [gauge]
nsq.<nsqd_host>_<nsqd_port>.mem.gc_runs

# if --e2e-processing-latency-percentile is specified, for each percentile
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.e2e_processing_latency_<percent> [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.e2e_processing_latency_<percent> [gauge]
最后修改:2021 年 02 月 22 日 11 : 06 PM
如果觉得我的文章对你有用,请随意赞赏