You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "vamsikarnika (via GitHub)" <gi...@apache.org> on 2024/06/24 08:08:05 UTC
[PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
vamsikarnika opened a new pull request, #11498:
URL: https://github.com/apache/hudi/pull/11498
### Change Logs
Added latency and failure metrics for recreate table on meta sync failure.
### Impact
- Results in pushing new metrics to prometheus which helps in monitoring the performance of recreating table.
### Risk level (write none, low medium or high below)
None
### Documentation Update
_Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none"._
- _The config description must be updated if new configs are added or the default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11498:
URL: https://github.com/apache/hudi/pull/11498#issuecomment-2185937360
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b95c4726bcf60bcf68bee0480069f24b1fb9ed15",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b95c4726bcf60bcf68bee0480069f24b1fb9ed15",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b95c4726bcf60bcf68bee0480069f24b1fb9ed15 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "codope (via GitHub)" <gi...@apache.org>.
codope commented on code in PR #11498:
URL: https://github.com/apache/hudi/pull/11498#discussion_r1657082048
##########
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/metrics/HoodieMetaSyncMetrics.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.sync.common.metrics;
+
+import org.apache.hudi.common.util.StringUtils;
+import org.apache.hudi.common.util.VisibleForTesting;
+import org.apache.hudi.config.metrics.HoodieMetricsConfig;
+import org.apache.hudi.hadoop.fs.HadoopFSUtils;
+import org.apache.hudi.metrics.Metrics;
+import org.apache.hudi.storage.HoodieStorage;
+import org.apache.hudi.storage.HoodieStorageUtils;
+import org.apache.hudi.sync.common.HoodieSyncConfig;
+
+import com.codahale.metrics.Counter;
+import com.codahale.metrics.Timer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HoodieMetaSyncMetrics {
+
+ private static final Logger LOG = LoggerFactory.getLogger(HoodieMetaSyncMetrics.class);
+ // Metrics are shut down by the shutdown hook added in the Metrics class
+ private Metrics metrics;
+ private HoodieMetricsConfig metricsConfig;
+ private transient HoodieStorage storage;
+
+ private final String syncToolName;
+
+ private static String recreateAndSyncFailureCounterName;
+ private static String recreateAndSyncTimerName;
+
+ private Timer recreateAndSyncTimer;
+ private Counter recreateAndSyncFailureCounter;
+
+ public HoodieMetaSyncMetrics(HoodieSyncConfig config, String syncToolName) {
+ this.metricsConfig = config.getMetricsConfig();
+ this.syncToolName = syncToolName;
+ if (metricsConfig.isMetricsOn()) {
+ this.storage = HoodieStorageUtils.getStorage(config.getBasePath(), HadoopFSUtils.getStorageConf(config.getHadoopConf()));
+ metrics = Metrics.getInstance(metricsConfig, storage);
+ recreateAndSyncTimerName = getMetricsName("timer", "meta_sync.recreate_table");
Review Comment:
I think this comment - https://github.com/apache/hudi/pull/11498#discussion_r1655435551 - is misunderstood. The strings such as "timer", "meta_sync.recreate_table", etc should be defined at static final strings, and not the `recreateAndSyncTimerName` variable itself. While you're at it, please also rename the strings as suggested in https://github.com/apache/hudi/pull/11498#discussion_r1655436437 for all duration metrics.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11498:
URL: https://github.com/apache/hudi/pull/11498#issuecomment-2194749783
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "afd8191d90f8003f3b52bdac79fd91554b6f5fb1",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24609",
"triggerID" : "afd8191d90f8003f3b52bdac79fd91554b6f5fb1",
"triggerType" : "PUSH"
}, {
"hash" : "fda593248aeabafdbe89c969dea4a00af7ca7742",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "fda593248aeabafdbe89c969dea4a00af7ca7742",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* afd8191d90f8003f3b52bdac79fd91554b6f5fb1 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24609)
* fda593248aeabafdbe89c969dea4a00af7ca7742 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11498:
URL: https://github.com/apache/hudi/pull/11498#issuecomment-2186045558
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b95c4726bcf60bcf68bee0480069f24b1fb9ed15",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24539",
"triggerID" : "b95c4726bcf60bcf68bee0480069f24b1fb9ed15",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b95c4726bcf60bcf68bee0480069f24b1fb9ed15 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24539)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "vamsikarnika (via GitHub)" <gi...@apache.org>.
vamsikarnika commented on code in PR #11498:
URL: https://github.com/apache/hudi/pull/11498#discussion_r1657142902
##########
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/metrics/HoodieMetaSyncMetrics.java:
##########
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.sync.common.metrics;
+
+import org.apache.hudi.common.util.StringUtils;
+import org.apache.hudi.common.util.VisibleForTesting;
+import org.apache.hudi.config.metrics.HoodieMetricsConfig;
+import org.apache.hudi.hadoop.fs.HadoopFSUtils;
+import org.apache.hudi.metrics.Metrics;
+import org.apache.hudi.storage.HoodieStorage;
+import org.apache.hudi.storage.HoodieStorageUtils;
+import org.apache.hudi.sync.common.HoodieSyncConfig;
+
+import com.codahale.metrics.Counter;
+import com.codahale.metrics.Timer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HoodieMetaSyncMetrics {
+
+ private static final Logger LOG = LoggerFactory.getLogger(HoodieMetaSyncMetrics.class);
+ // Metrics are shut down by the shutdown hook added in the Metrics class
+ private Metrics metrics;
+ private HoodieMetricsConfig metricsConfig;
+ private transient HoodieStorage storage;
+
+ private final String syncToolName;
+
+ private static String recreateAndSyncFailureCounterName;
+ private static String recreateAndSyncTimerName;
+
+ private Timer recreateAndSyncTimer;
+ private Counter recreateAndSyncFailureCounter;
+
+ public HoodieMetaSyncMetrics(HoodieSyncConfig config, String syncToolName) {
+ this.metricsConfig = config.getMetricsConfig();
+ this.syncToolName = syncToolName;
+ if (metricsConfig.isMetricsOn()) {
+ this.storage = HoodieStorageUtils.getStorage(config.getBasePath(), HadoopFSUtils.getStorageConf(config.getHadoopConf()));
+ metrics = Metrics.getInstance(metricsConfig, storage);
+ recreateAndSyncTimerName = getMetricsName("timer", "meta_sync.recreate_table");
Review Comment:
Yeah, I have fixed it now.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11498:
URL: https://github.com/apache/hudi/pull/11498#issuecomment-2185951989
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b95c4726bcf60bcf68bee0480069f24b1fb9ed15",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24539",
"triggerID" : "b95c4726bcf60bcf68bee0480069f24b1fb9ed15",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b95c4726bcf60bcf68bee0480069f24b1fb9ed15 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24539)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11498:
URL: https://github.com/apache/hudi/pull/11498#issuecomment-2194600653
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "afd8191d90f8003f3b52bdac79fd91554b6f5fb1",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24609",
"triggerID" : "afd8191d90f8003f3b52bdac79fd91554b6f5fb1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* afd8191d90f8003f3b52bdac79fd91554b6f5fb1 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=24609)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-7924] Capture Latency and Failure Metrics For Hive Table recreation [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11498:
URL: https://github.com/apache/hudi/pull/11498#issuecomment-2194585714
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "afd8191d90f8003f3b52bdac79fd91554b6f5fb1",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "afd8191d90f8003f3b52bdac79fd91554b6f5fb1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* afd8191d90f8003f3b52bdac79fd91554b6f5fb1 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org