Nacos¶
Nacos performance Metrics display, including Nacos uptime, Nacos Config long connection count, Nacos Config configuration count, Service Count, HTTP request times, etc.
Installation Configuration¶
Version Support¶
- Operating system support: Linux / Windows
- Nacos version: >= 0.8.0
Note: The example Nacos version is 1.4.1.
( Same environment for Linux / Windows )
Metrics Collection (Required)¶
- Configure the
application.properties
file to expose metrics data
- Restart Nacos
There are differences in startup parameters for cluster mode and singleton mode; refer to the Nacos official documentation.
- Verification
Access {ip}:8848/nacos/actuator/prometheus
to check if metrics data can be accessed.
- Enable DataKit Prometheus plugin
- Modify the
nacos-prom.conf
configuration file
Main parameter descriptions:
- urls:
prometheus
Metrics address, fill in the exposed Metrics url of Nacos. - source: Collector alias, it is recommended to write as
nacos
. - interval: Collection interval.
- measurement_prefix: Metric prefix, convenient for metric classification queries.
- tls_open: TLS configuration.
- metric_types: Metric types, leaving it blank means collecting all Metrics.
[[inputs.prom]]
urls = ["http://192.168.0.189:8848/nacos/actuator/prometheus"]
## Ignore URL request errors
ignore_req_err = false
## Collector alias
source = "nacos"
metric_types = []
measurement_prefix = "nacos_"
## Collection interval "ns", "us" (or "µs"), "ms", "s", "m", "h"
interval = "10s"
## TLS configuration
tls_open = false
## Custom Tags
[inputs.prom.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
- Restart DataKit
Metrics Details¶
JVM Metrics¶
Metric | Meaning |
---|---|
system_cpu_usage | CPU usage rate |
system_load_average_1m | Load average |
jvm_memory_used_bytes | Memory used in bytes, includes various memory areas |
jvm_memory_max_bytes | Maximum memory in bytes, includes various memory areas |
jvm_gc_pause_seconds_count | GC count, includes various GC |
jvm_gc_pause_seconds_sum | GC time consumption, includes various GC |
jvm_threads_daemon | Number of threads |
Nacos Monitoring Metrics¶
Metric | Meaning |
---|---|
http_server_requests_seconds_count | HTTP request count, includes multiple (url, method, code) |
http_server_requests_seconds_sum | Total HTTP request time, includes multiple (url, method, code) |
nacos_timer_seconds_sum |
Nacos config level notification time consumption |
nacos_timer_seconds_count |
Nacos config level notification count |
nacos_monitor{name='longPolling'} |
Nacos config long connection count |
nacos_monitor{name='configCount'} |
Nacos config configuration count |
nacos_monitor{name='dumpTask'} |
Nacos config configuration disk task backlog count |
nacos_monitor{name='notifyTask'} |
Nacos config level notification task backlog count |
nacos_monitor{name='getConfig'} |
Nacos config read configuration statistics count |
nacos_monitor{name='publish'} |
Nacos config write configuration statistics count |
nacos_monitor{name='ipCount'} |
Nacos naming IP count |
nacos_monitor{name='domCount'} |
Nacos naming domain name count (1.x version) |
nacos_monitor{name='serviceCount'} |
Nacos naming domain name count (2.x version) |
nacos_monitor{name='failedPush'} |
Nacos naming push failure count |
nacos_monitor{name='avgPushCost'} |
Nacos naming average push time consumption |
nacos_monitor{name='leaderStatus'} |
Nacos naming role status |
nacos_monitor{name='maxPushCost'} |
Nacos naming maximum push time consumption |
nacos_monitor{name='mysqlhealthCheck'} |
Nacos naming MySQL health check count |
nacos_monitor{name='httpHealthCheck'} |
Nacos naming HTTP health check count |
nacos_monitor{name='tcpHealthCheck'} |
Nacos naming TCP health check count |
Nacos Exception Metrics¶
Metric | Meaning |
---|---|
nacos_exception_total{name='db'} |
Database exceptions |
nacos_exception_total{name='configNotify'} |
Nacos config level notification failure |
nacos_exception_total{name='unhealth'} |
Nacos config server health check exception between servers |
nacos_exception_total{name='disk'} |
Nacos naming disk write exception |
nacos_exception_total{name='leaderSendBeatFailed'} |
Nacos naming leader heartbeat sending exception |
nacos_exception_total{name='illegalArgument'} |
Invalid request parameters |
nacos_exception_total{name='nacos'} |
Nacos request response internal error exception (read/write failure, no permission, parameter error) |
For more Nacos Metrics, you can refer to the Nacos Official Website - Monitoring