kfaraz commented on code in PR #14743:
URL: https://github.com/apache/druid/pull/14743#discussion_r1282598735
##########
server/src/main/java/org/apache/druid/server/metrics/ServiceStatusMonitor.java:
##########
@@ -33,8 +33,12 @@
*/
public class ServiceStatusMonitor extends AbstractMonitor
{
+ /**
+ * The named binding for tags that should be reported with the
`service/heartbeat` metric.
+ */
+ public static final String TAGS_BINDING = "heartbeat";
Review Comment:
```suggestion
public static final String HEARTBEAT_TAGS = "heartbeat";
```
##########
docs/operations/metrics.md:
##########
@@ -336,9 +336,9 @@ These metrics are for the Druid Coordinator and are reset
each time the Coordina
### Service Health
-|Metric|Description|Dimensions|Normal value|
-|------|-----------|----------|------------|
-| `service/heartbeat` | Metric indicating the service is up.
`ServiceStatusMonitor` must be enabled. |`leader` on the Overlord and
Coordinator.|1|
+|Metric|Description| Dimensions
|Normal value|
+|------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|
Review Comment:
Nit: I am not sure if this is the format we follow in the docs. The original
one made more sense to me.
##########
services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:
##########
@@ -195,6 +202,18 @@ private void configureIntermediaryData(Binder binder)
biddy.addBinding("deepstore").to(DeepStorageIntermediaryDataManager.class).in(LazySingleton.class);
}
+ @Provides
+ @LazySingleton
+ @Named(ServiceStatusMonitor.TAGS_BINDING)
+ public Supplier<Map<String, Object>>
heartbeatDimensions(WorkerConfig workerConfig, WorkerTaskManager
workerTaskManager)
+ {
+ return () -> ImmutableMap.of(
+ "workerVersion", workerConfig.getVersion(),
+ "workerCapacity", workerConfig.getCapacity(),
Review Comment:
Not sure about this one. Should it be a separate metric of its own?
##########
services/src/main/java/org/apache/druid/cli/CliMiddleManager.java:
##########
@@ -195,6 +202,18 @@ private void configureIntermediaryData(Binder binder)
biddy.addBinding("deepstore").to(DeepStorageIntermediaryDataManager.class).in(LazySingleton.class);
}
+ @Provides
+ @LazySingleton
+ @Named(ServiceStatusMonitor.TAGS_BINDING)
+ public Supplier<Map<String, Object>>
heartbeatDimensions(WorkerConfig workerConfig, WorkerTaskManager
workerTaskManager)
+ {
+ return () -> ImmutableMap.of(
+ "workerVersion", workerConfig.getVersion(),
Review Comment:
Another useful dimension is workerCategory.
--
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]