kfaraz commented on code in PR #18103:
URL: https://github.com/apache/druid/pull/18103#discussion_r2154935183


##########
docs/configuration/index.md:
##########
@@ -2031,6 +1893,155 @@ See [cache configuration](#cache-configuration) for how 
to configure cache setti
 |`druid.broker.segment.watchRealtimeTasks`|Boolean|The Broker watches segment 
announcements from processes that serve segments to build a cache to relate 
each process to the segments it serves. When `watchRealtimeTasks` is true, the 
Broker watches for segment announcements from both Historicals and realtime 
processes. To configure a broker to exclude segments served by realtime 
processes, set `watchRealtimeTasks` to false. |true|
 |`druid.broker.segment.awaitInitializationOnStart`|Boolean|Whether the Broker 
will wait for its view of segments to fully initialize before starting up. If 
set to 'true', the Broker's HTTP server will not start up, and the Broker will 
not announce itself as available, until the server view is initialized. See 
also `druid.sql.planner.awaitInitializationOnStart`, a related setting.|true|
 
+## Metrics monitors
+
+You can configure Druid services to emit [metrics](../operations/metrics.md) 
regularly from a number of [monitors](#metrics-monitors-for-each-service) via 
[emitters](#metrics-emitters). The following table lists general configurations 
for metrics:
+
+|Property|Description|Default|
+|--------|-----------|-------|
+|`druid.monitoring.emissionPeriod`| Frequency that Druid emits metrics.|`PT1M`|
+|[`druid.monitoring.monitors`](#metrics-monitors-for-each-service)|Sets list 
of Druid monitors used by a service.|none (no monitors)|
+|[`druid.emitter`](#metrics-emitters)|Setting this value initializes one of 
the emitter modules.|`noop` (metric emission disabled by default)|
+
+### Metrics monitors for each service
+
+:::caution
+
+Because each monitor is meant for a specific service or services, make sure 
you configure them for the correct service unless it is meant for any service. 
For example, if a monitor is meant for the Historical service, configure it in 
`historical/runtime.properties` rather than `_common/common.runtime.properties`.
+
+:::
+
+Metric monitoring is an essential part of Druid operations. The following 
table lists the monitors that are available and which service you should 
configure the monitor for:
+
+|Name|Description|Service|
+|----|-----------|-|
+|`org.apache.druid.client.cache.CacheMonitor`|Emits metrics (to logs) about 
the segment results cache for Historical and Broker services. Reports typical 
cache statistics include hits, misses, rates, and size (bytes and number of 
entries), as well as timeouts and and errors.|Broker, Historical, Indexer, Peon|
+|`org.apache.druid.java.util.metrics.OshiSysMonitor`||`org.apache.druid.java.util.metrics.OshiSysMonitor`|Reports
 on various system activities and statuses using the 
[OSHI](https://github.com/oshi/oshi), a JNA-based (native) Operating System and 
Hardware Information library for Java.|Any|
+|`org.apache.druid.java.util.metrics.JvmMonitor`|Reports various JVM-related 
statistics.|Any|
+|`org.apache.druid.java.util.metrics.JvmCpuMonitor`|Reports statistics of CPU 
consumption by the JVM.|Any|
+|`org.apache.druid.java.util.metrics.CpuAcctDeltaMonitor`|Reports consumed CPU 
as per the cpuacct cgroup.|Any|
+|`org.apache.druid.java.util.metrics.JvmThreadsMonitor`|Reports Thread 
statistics in the JVM, like numbers of total, daemon, started, died 
threads.|Any|
+|`org.apache.druid.java.util.metrics.CgroupCpuMonitor`|Reports CPU shares and 
quotas as per the `cpu` cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupCpuSetMonitor`|Reports CPU core/HT 
and memory node allocations as per the `cpuset` cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupDiskMonitor`|Reports disk statistic 
as per the blkio cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupMemoryMonitor`|Reports memory 
statistic as per the memory cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2CpuMonitor`| **EXPERIMENTAL** 
Reports CPU usage from `cpu.stat` file. Only applicable to `cgroupv2`.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2DiskMonitor`| **EXPERIMENTAL** 
Reports disk usage from `io.stat` file. Only applicable to `cgroupv2`.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2MemoryMonitor`| **EXPERIMENTAL** 
Reports memory usage from `memory.current` and `memory.max` files. Only 
applicable to `cgroupv2`.|Any|
+|`org.apache.druid.server.metrics.HistoricalMetricsMonitor`|Reports statistics 
on Historical services. Available only on Historical services.|Historical|

Review Comment:
   ```suggestion
   |`org.apache.druid.server.metrics.HistoricalMetricsMonitor`|Reports 
statistics on Historical services.|Historical|
   ```



##########
docs/configuration/index.md:
##########
@@ -2031,6 +1893,155 @@ See [cache configuration](#cache-configuration) for how 
to configure cache setti
 |`druid.broker.segment.watchRealtimeTasks`|Boolean|The Broker watches segment 
announcements from processes that serve segments to build a cache to relate 
each process to the segments it serves. When `watchRealtimeTasks` is true, the 
Broker watches for segment announcements from both Historicals and realtime 
processes. To configure a broker to exclude segments served by realtime 
processes, set `watchRealtimeTasks` to false. |true|
 |`druid.broker.segment.awaitInitializationOnStart`|Boolean|Whether the Broker 
will wait for its view of segments to fully initialize before starting up. If 
set to 'true', the Broker's HTTP server will not start up, and the Broker will 
not announce itself as available, until the server view is initialized. See 
also `druid.sql.planner.awaitInitializationOnStart`, a related setting.|true|
 
+## Metrics monitors
+
+You can configure Druid services to emit [metrics](../operations/metrics.md) 
regularly from a number of [monitors](#metrics-monitors-for-each-service) via 
[emitters](#metrics-emitters). The following table lists general configurations 
for metrics:
+
+|Property|Description|Default|
+|--------|-----------|-------|
+|`druid.monitoring.emissionPeriod`| Frequency that Druid emits metrics.|`PT1M`|
+|[`druid.monitoring.monitors`](#metrics-monitors-for-each-service)|Sets list 
of Druid monitors used by a service.|none (no monitors)|
+|[`druid.emitter`](#metrics-emitters)|Setting this value initializes one of 
the emitter modules.|`noop` (metric emission disabled by default)|
+
+### Metrics monitors for each service
+
+:::caution
+
+Because each monitor is meant for a specific service or services, make sure 
you configure them for the correct service unless it is meant for any service. 
For example, if a monitor is meant for the Historical service, configure it in 
`historical/runtime.properties` rather than `_common/common.runtime.properties`.
+
+:::
+
+Metric monitoring is an essential part of Druid operations. The following 
table lists the monitors that are available and which service you should 
configure the monitor for:
+
+|Name|Description|Service|
+|----|-----------|-|
+|`org.apache.druid.client.cache.CacheMonitor`|Emits metrics (to logs) about 
the segment results cache for Historical and Broker services. Reports typical 
cache statistics include hits, misses, rates, and size (bytes and number of 
entries), as well as timeouts and and errors.|Broker, Historical, Indexer, Peon|
+|`org.apache.druid.java.util.metrics.OshiSysMonitor`||`org.apache.druid.java.util.metrics.OshiSysMonitor`|Reports
 on various system activities and statuses using the 
[OSHI](https://github.com/oshi/oshi), a JNA-based (native) Operating System and 
Hardware Information library for Java.|Any|
+|`org.apache.druid.java.util.metrics.JvmMonitor`|Reports various JVM-related 
statistics.|Any|
+|`org.apache.druid.java.util.metrics.JvmCpuMonitor`|Reports statistics of CPU 
consumption by the JVM.|Any|
+|`org.apache.druid.java.util.metrics.CpuAcctDeltaMonitor`|Reports consumed CPU 
as per the cpuacct cgroup.|Any|
+|`org.apache.druid.java.util.metrics.JvmThreadsMonitor`|Reports Thread 
statistics in the JVM, like numbers of total, daemon, started, died 
threads.|Any|
+|`org.apache.druid.java.util.metrics.CgroupCpuMonitor`|Reports CPU shares and 
quotas as per the `cpu` cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupCpuSetMonitor`|Reports CPU core/HT 
and memory node allocations as per the `cpuset` cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupDiskMonitor`|Reports disk statistic 
as per the blkio cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupMemoryMonitor`|Reports memory 
statistic as per the memory cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2CpuMonitor`| **EXPERIMENTAL** 
Reports CPU usage from `cpu.stat` file. Only applicable to `cgroupv2`.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2DiskMonitor`| **EXPERIMENTAL** 
Reports disk usage from `io.stat` file. Only applicable to `cgroupv2`.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2MemoryMonitor`| **EXPERIMENTAL** 
Reports memory usage from `memory.current` and `memory.max` files. Only 
applicable to `cgroupv2`.|Any|
+|`org.apache.druid.server.metrics.HistoricalMetricsMonitor`|Reports statistics 
on Historical services. Available only on Historical services.|Historical|
+|`org.apache.druid.server.metrics.SegmentStatsMonitor` | **EXPERIMENTAL** 
Reports statistics about segments on Historical services. Available only on 
Historical services. Not to be used when lazy loading is configured.|Historical|

Review Comment:
   ```suggestion
   |`org.apache.druid.server.metrics.SegmentStatsMonitor` | **EXPERIMENTAL** 
Reports statistics about segments on Historical services. Not to be used when 
lazy loading is configured.|Historical|
   ```



##########
docs/configuration/index.md:
##########
@@ -2031,6 +1893,155 @@ See [cache configuration](#cache-configuration) for how 
to configure cache setti
 |`druid.broker.segment.watchRealtimeTasks`|Boolean|The Broker watches segment 
announcements from processes that serve segments to build a cache to relate 
each process to the segments it serves. When `watchRealtimeTasks` is true, the 
Broker watches for segment announcements from both Historicals and realtime 
processes. To configure a broker to exclude segments served by realtime 
processes, set `watchRealtimeTasks` to false. |true|
 |`druid.broker.segment.awaitInitializationOnStart`|Boolean|Whether the Broker 
will wait for its view of segments to fully initialize before starting up. If 
set to 'true', the Broker's HTTP server will not start up, and the Broker will 
not announce itself as available, until the server view is initialized. See 
also `druid.sql.planner.awaitInitializationOnStart`, a related setting.|true|
 
+## Metrics monitors
+
+You can configure Druid services to emit [metrics](../operations/metrics.md) 
regularly from a number of [monitors](#metrics-monitors-for-each-service) via 
[emitters](#metrics-emitters). The following table lists general configurations 
for metrics:
+
+|Property|Description|Default|
+|--------|-----------|-------|
+|`druid.monitoring.emissionPeriod`| Frequency that Druid emits metrics.|`PT1M`|
+|[`druid.monitoring.monitors`](#metrics-monitors-for-each-service)|Sets list 
of Druid monitors used by a service.|none (no monitors)|
+|[`druid.emitter`](#metrics-emitters)|Setting this value initializes one of 
the emitter modules.|`noop` (metric emission disabled by default)|
+
+### Metrics monitors for each service
+
+:::caution
+
+Because each monitor is meant for a specific service or services, make sure 
you configure them for the correct service unless it is meant for any service. 
For example, if a monitor is meant for the Historical service, configure it in 
`historical/runtime.properties` rather than `_common/common.runtime.properties`.
+
+:::
+
+Metric monitoring is an essential part of Druid operations. The following 
table lists the monitors that are available and which service you should 
configure the monitor for:
+
+|Name|Description|Service|
+|----|-----------|-|

Review Comment:
   Nit:
   ```suggestion
   |----|-----------|-------|
   ```



##########
docs/configuration/index.md:
##########
@@ -2031,6 +1893,155 @@ See [cache configuration](#cache-configuration) for how 
to configure cache setti
 |`druid.broker.segment.watchRealtimeTasks`|Boolean|The Broker watches segment 
announcements from processes that serve segments to build a cache to relate 
each process to the segments it serves. When `watchRealtimeTasks` is true, the 
Broker watches for segment announcements from both Historicals and realtime 
processes. To configure a broker to exclude segments served by realtime 
processes, set `watchRealtimeTasks` to false. |true|
 |`druid.broker.segment.awaitInitializationOnStart`|Boolean|Whether the Broker 
will wait for its view of segments to fully initialize before starting up. If 
set to 'true', the Broker's HTTP server will not start up, and the Broker will 
not announce itself as available, until the server view is initialized. See 
also `druid.sql.planner.awaitInitializationOnStart`, a related setting.|true|
 
+## Metrics monitors
+
+You can configure Druid services to emit [metrics](../operations/metrics.md) 
regularly from a number of [monitors](#metrics-monitors-for-each-service) via 
[emitters](#metrics-emitters). The following table lists general configurations 
for metrics:
+
+|Property|Description|Default|
+|--------|-----------|-------|
+|`druid.monitoring.emissionPeriod`| Frequency that Druid emits metrics.|`PT1M`|
+|[`druid.monitoring.monitors`](#metrics-monitors-for-each-service)|Sets list 
of Druid monitors used by a service.|none (no monitors)|
+|[`druid.emitter`](#metrics-emitters)|Setting this value initializes one of 
the emitter modules.|`noop` (metric emission disabled by default)|
+
+### Metrics monitors for each service
+
+:::caution
+
+Because each monitor is meant for a specific service or services, make sure 
you configure them for the correct service unless it is meant for any service. 
For example, if a monitor is meant for the Historical service, configure it in 
`historical/runtime.properties` rather than `_common/common.runtime.properties`.
+
+:::
+
+Metric monitoring is an essential part of Druid operations. The following 
table lists the monitors that are available and which service you should 
configure the monitor for:
+
+|Name|Description|Service|
+|----|-----------|-|
+|`org.apache.druid.client.cache.CacheMonitor`|Emits metrics (to logs) about 
the segment results cache for Historical and Broker services. Reports typical 
cache statistics include hits, misses, rates, and size (bytes and number of 
entries), as well as timeouts and and errors.|Broker, Historical, Indexer, Peon|
+|`org.apache.druid.java.util.metrics.OshiSysMonitor`||`org.apache.druid.java.util.metrics.OshiSysMonitor`|Reports
 on various system activities and statuses using the 
[OSHI](https://github.com/oshi/oshi), a JNA-based (native) Operating System and 
Hardware Information library for Java.|Any|
+|`org.apache.druid.java.util.metrics.JvmMonitor`|Reports various JVM-related 
statistics.|Any|
+|`org.apache.druid.java.util.metrics.JvmCpuMonitor`|Reports statistics of CPU 
consumption by the JVM.|Any|
+|`org.apache.druid.java.util.metrics.CpuAcctDeltaMonitor`|Reports consumed CPU 
as per the cpuacct cgroup.|Any|
+|`org.apache.druid.java.util.metrics.JvmThreadsMonitor`|Reports Thread 
statistics in the JVM, like numbers of total, daemon, started, died 
threads.|Any|
+|`org.apache.druid.java.util.metrics.CgroupCpuMonitor`|Reports CPU shares and 
quotas as per the `cpu` cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupCpuSetMonitor`|Reports CPU core/HT 
and memory node allocations as per the `cpuset` cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupDiskMonitor`|Reports disk statistic 
as per the blkio cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupMemoryMonitor`|Reports memory 
statistic as per the memory cgroup.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2CpuMonitor`| **EXPERIMENTAL** 
Reports CPU usage from `cpu.stat` file. Only applicable to `cgroupv2`.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2DiskMonitor`| **EXPERIMENTAL** 
Reports disk usage from `io.stat` file. Only applicable to `cgroupv2`.|Any|
+|`org.apache.druid.java.util.metrics.CgroupV2MemoryMonitor`| **EXPERIMENTAL** 
Reports memory usage from `memory.current` and `memory.max` files. Only 
applicable to `cgroupv2`.|Any|
+|`org.apache.druid.server.metrics.HistoricalMetricsMonitor`|Reports statistics 
on Historical services. Available only on Historical services.|Historical|
+|`org.apache.druid.server.metrics.SegmentStatsMonitor` | **EXPERIMENTAL** 
Reports statistics about segments on Historical services. Available only on 
Historical services. Not to be used when lazy loading is configured.|Historical|
+|`org.apache.druid.server.metrics.QueryCountStatsMonitor`|Reports how many 
queries have been successful/failed/interrupted.|Broker, Historical, Router, 
Indexer, Peon|
+|`org.apache.druid.server.metrics.SubqueryCountStatsMonitor`|Reports how many 
subqueries have been materialized as rows or bytes and various other statistics 
related to the subquery execution|Broker|
+|`org.apache.druid.server.emitter.HttpEmittingMonitor`|Reports internal 
metrics of `http` or `parametrized` emitter (see below). Must not be used with 
another emitter type. See the description of the metrics here: 
https://github.com/apache/druid/pull/4973.|Any|
+|`org.apache.druid.server.metrics.TaskCountStatsMonitor`|Reports how many 
ingestion tasks are currently running/pending/waiting and also the number of 
successful/failed tasks per emission period.|Overlord|
+|`org.apache.druid.server.metrics.TaskSlotCountStatsMonitor`|Reports metrics 
about task slot usage per emission period.|Overlord|
+|`org.apache.druid.server.metrics.WorkerTaskCountStatsMonitor`|Reports how 
many ingestion tasks are currently running/pending/waiting, the number of 
successful/failed tasks, and metrics about task slot usage for the reporting 
worker, per emission period. |MiddleManager, Indexer|
+|`org.apache.druid.server.metrics.ServiceStatusMonitor`|Reports a heartbeat 
for the service.|Any|
+|`org.apache.druid.server.metrics.GroupByStatsMonitor`|Report metrics for 
groupBy queries like disk and merge buffer utilization. |Broker, Historical, 
Indexer, Peon|
+
+For example, you might configure monitors on all services for system and JVM 
information within `common.runtime.properties` as follows:
+
+```properties
+druid.monitoring.monitors=["org.apache.druid.java.util.metrics.OshiSysMonitor","org.apache.druid.java.util.metrics.JvmMonitor"]
+```
+
+On the otherhand, some monitors should only be configured for certain 
services. For these, update the `runtime.properties` of individual services. 
For example, to `TaskCountStatsMonitor` and `TaskSlotCountStatsMonitor` to the 
Overlord, add the following line to the 
`coordinator-overlord/runtime.properties` file:

Review Comment:
   ```suggestion
   On the other hand, some monitors should only be configured for certain 
services. For these, update the `runtime.properties` of individual services. 
For example, to `TaskCountStatsMonitor` and `TaskSlotCountStatsMonitor` to the 
Overlord, add the following line to the 
`coordinator-overlord/runtime.properties` file:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to