Aggarwal-Raghav commented on code in PR #6666:
URL: https://github.com/apache/hive/pull/6666#discussion_r4025131381
##########
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java:
##########
@@ -3649,10 +3649,10 @@ public static enum ConfVars {
"Deprecated, use HIVE_CODAHALE_METRICS_REPORTER_CLASSES instead. This
configuration will be"
+ " overridden by HIVE_CODAHALE_METRICS_REPORTER_CLASSES if
present. " +
"Comma separated list of JMX, CONSOLE, JSON_FILE, HADOOP2"),
- HIVE_METRICS_JSON_FILE_LOCATION("hive.service.metrics.file.location",
"/tmp/report.json",
+ HIVE_METRICS_JSON_FILE_LOCATION("hive.service.metrics.file.location",
"/tmp/hs2-report.json",
"For metric class
org.apache.hadoop.hive.common.metrics.metrics2.CodahaleMetrics JSON_FILE
reporter, the location of local JSON metrics file. " +
"This file will get overwritten at every interval."),
- HIVE_METRICS_JSON_FILE_INTERVAL("hive.service.metrics.file.frequency",
"5000ms",
+ HIVE_METRICS_JSON_FILE_INTERVAL("hive.service.metrics.file.frequency",
"60000ms",
Review Comment:
@ramitg254 , what I understand from you question is "**how
`HIVE_METRICS_JSON_FILE_INTERVAL` from HiveConf.java is picked by HS2 jvm
process when its only present in `TestMetricsQueryLifeTimeHook.java`**"
Let me try to explain:
1. `hive.server2.metrics.enabled` only enables HS2 metrics,
`metastore.metrics.enabled` enables HMS metrics.
2. `HiveServer2#startHiveServer2()` cretead `new HiveConf()` and eventually
it calls `HiveConf#applyDefaultNonNullConfVars()` where this config is injected
in HS2 process.
3. To show frequency mismatch, check the below screenshot without this fix:
```
while true
if grep -q "hs2_open_sessions" /tmp/report.json
echo (date +'%T') "- Currently holding HS2 metrics"
else if grep -q "api_get_database" /tmp/report.json
echo (date +'%T') "- Currently holding HMS metrics"
end
sleep 1
end
```
<img width="442" height="421" alt="Screenshot 2026-09-16 at 4 12 29 PM"
src="https://github.com/user-attachments/assets/45d44d87-ac03-4bcd-8242-abb3c7c3cfed"
/>
--
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]