You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "okumin (via GitHub)" <gi...@apache.org> on 2026/05/04 08:56:11 UTC
[PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
okumin opened a new pull request, #6461:
URL: https://github.com/apache/hive/pull/6461
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
3. Ensure you have added or run the appropriate tests for your PR:
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX: Your PR title ...'.
5. Be sure to keep the PR description updated to reflect all changes.
6. Please write your PR title to summarize what this PR proposes.
7. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
Complete implementing `/v1/{prefix}/namespaces/{namespace}/tables/{table}/metrics`.
https://issues.apache.org/jira/browse/HIVE-29593
### Why are the changes needed?
The current endpoint is NOOP, meaning we can't leverage the reported metrics for further optimization.
### Does this PR introduce _any_ user-facing change?
No. By default, HMS administrators can see more logs.
### How was this patch tested?
1. Launch HMS.
```sh
$ docker run --rm -p 9001:9001 apache/hive:standalone-metastore-4.3.0-SNAPSHOT
```
2. Send events.
```sh
$ curl -i -X POST \
"http://localhost:9001/iceberg/v1/namespaces/default/tables/test/metrics" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"report-type": "scan-report",
"table-name": "default.test",
"snapshot-id": 1000000000001,
"filter": true,
"schema-id": 0,
"projected-field-ids": [1],
"projected-field-names": ["id"],
"metrics": {
"total-planning-duration": {
"count": 1,
"time-unit": "nanoseconds",
"total-duration": 2644235116
},
"result-data-files": {
"unit": "count",
"value": 3
},
"result-delete-files": {
"unit": "count",
"value": 0
},
"total-data-manifests": {
"unit": "count",
"value": 1
},
"total-delete-manifests": {
"unit": "count",
"value": 0
},
"scanned-data-manifests": {
"unit": "count",
"value": 1
},
"skipped-data-manifests": {
"unit": "count",
"value": 0
},
"total-file-size-bytes": {
"unit": "bytes",
"value": 1048576
},
"total-delete-file-size-bytes": {
"unit": "bytes",
"value": 0
}
},
"metadata": {
"source": "dummy-curl",
"user": "test-user",
"trace-id": "dummy-trace-001"
}
}
JSON
$ curl -i -X POST \
"http://localhost:9001/iceberg/v1/namespaces/default/tables/test/metrics" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"report-type": "commit-report",
"table-name": "default.test",
"snapshot-id": 1000000000002,
"sequence-number": 1,
"operation": "append",
"metrics": {
"total-duration": {
"count": 1,
"time-unit": "nanoseconds",
"total-duration": 1234567890
},
"attempts": {
"unit": "count",
"value": 1
},
"added-data-files": {
"unit": "count",
"value": 1
},
"removed-data-files": {
"unit": "count",
"value": 0
},
"added-records": {
"unit": "count",
"value": 100
},
"added-files-size-bytes": {
"unit": "bytes",
"value": 4096
}
},
"metadata": {
"source": "dummy-curl",
"user": "test-user",
"trace-id": "dummy-trace-002"
}
}
JSON
```
3. I can see the logs
```
2026-05-04T08:54:27,327 INFO [qtp1859459396-63] metrics.LoggingMetricsReporter: Event reported at 2026-05-04T08:54:27.327327085Z: catalog=hive, report=ScanReport{tableName=default.test, snapshotId=1000000000001, filter=true, schemaId=0, projectedFieldIds=[1], projectedFieldNames=[id], scanMetrics=ScanMetricsResult{totalPlanningDuration=TimerResult{timeUnit=NANOSECONDS, totalDuration=PT2.644235116S, count=1}, resultDataFiles=CounterResult{unit=COUNT, value=3}, resultDeleteFiles=CounterResult{unit=COUNT, value=0}, totalDataManifests=CounterResult{unit=COUNT, value=1}, totalDeleteManifests=CounterResult{unit=COUNT, value=0}, scannedDataManifests=CounterResult{unit=COUNT, value=1}, skippedDataManifests=CounterResult{unit=COUNT, value=0}, totalFileSizeInBytes=null, totalDeleteFileSizeInBytes=null, skippedDataFiles=null, skippedDeleteFiles=null, scannedDeleteManifests=null, skippedDeleteManifests=null, indexedDeleteFiles=null, equalityDeleteFiles=null, positionalDeleteFiles=null, dvs=n
ull}, metadata={source=dummy-curl, user=test-user, trace-id=dummy-trace-001}}
...
2026-05-04T08:54:59,442 INFO [qtp1859459396-59] metrics.LoggingMetricsReporter: Event reported at 2026-05-04T08:54:59.442439794Z: catalog=hive, report=CommitReport{tableName=default.test, snapshotId=1000000000002, sequenceNumber=1, operation=append, commitMetrics=CommitMetricsResult{totalDuration=TimerResult{timeUnit=NANOSECONDS, totalDuration=PT1.23456789S, count=1}, attempts=CounterResult{unit=COUNT, value=1}, addedDataFiles=CounterResult{unit=COUNT, value=1}, removedDataFiles=CounterResult{unit=COUNT, value=0}, totalDataFiles=null, addedDeleteFiles=null, addedEqualityDeleteFiles=null, addedPositionalDeleteFiles=null, addedDVs=null, removedDeleteFiles=null, removedEqualityDeleteFiles=null, removedPositionalDeleteFiles=null, removedDVs=null, totalDeleteFiles=null, addedRecords=CounterResult{unit=COUNT, value=100}, removedRecords=null, totalRecords=null, addedFilesSizeInBytes=CounterResult{unit=BYTES, value=4096}, removedFilesSizeInBytes=null, totalFilesSizeInBytes=null, addedPos
itionalDeletes=null, removedPositionalDeletes=null, totalPositionalDeletes=null, addedEqualityDeletes=null, removedEqualityDeletes=null, totalEqualityDeletes=null, manifestsCreated=null, manifestsReplaced=null, manifestsKept=null, manifestEntriesProcessed=null}, metadata={source=dummy-curl, user=test-user, trace-id=dummy-trace-002}}
```
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3187803917
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -109,7 +116,24 @@ private HttpServlet createServlet(Catalog catalog) {
// Iceberg REST client uses "catalog" by default
List<String> scopes = Collections.singletonList("catalog");
ServletSecurity security = new ServletSecurity(AuthType.fromString(authType), configuration, req -> scopes);
- return security.proxy(new HMSCatalogServlet(new HMSCatalogAdapter(catalog)));
+ String catalogName = MetastoreConf.getVar(configuration, ConfVars.CATALOG_DEFAULT);
+ List<IcebergMetricsReporter> reporters = createReporters();
+ return security.proxy(new HMSCatalogServlet(new HMSCatalogAdapter(catalogName, catalog, reporters)));
+ }
+
+ private List<IcebergMetricsReporter> createReporters() {
+ final var classes = configuration.getClasses(
+ ConfVars.ICEBERG_CATALOG_METRICS_REPORTERS.getVarname(),
+ LoggingMetricsReporter.class
+ );
+ return Arrays.stream(classes).map(clazz -> {
+ try {
+ final var constructor = clazz.getDeclaredConstructor(Configuration.class);
+ return (IcebergMetricsReporter) constructor.newInstance(configuration);
+ } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
+ throw new IllegalArgumentException("Failed to instantiate IcebergMetricsReporter: {}" + clazz.getName(), e);
Review Comment:
Thank you. I addressed and tested it.
https://github.com/apache/hive/pull/6461/changes/49704bf4fc862348037d1d598bcb3a012fe75b07
```
$ docker run --rm -p 9001:9001 --env SERVICE_OPTS='-Dmetastore.iceberg.catalog.metrics.reporters=java.lang.String' apache/hive:standalone-metastore-4.3.0-SNAPSHOT
...
Caused by: java.lang.IllegalArgumentException: Failed to instantiate IcebergMetricsReporter: java.lang.String
```
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "Aggarwal-Raghav (via GitHub)" <gi...@apache.org>.
Aggarwal-Raghav commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3186280052
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogFactory.java:
##########
@@ -109,7 +116,24 @@ private HttpServlet createServlet(Catalog catalog) {
// Iceberg REST client uses "catalog" by default
List<String> scopes = Collections.singletonList("catalog");
ServletSecurity security = new ServletSecurity(AuthType.fromString(authType), configuration, req -> scopes);
- return security.proxy(new HMSCatalogServlet(new HMSCatalogAdapter(catalog)));
+ String catalogName = MetastoreConf.getVar(configuration, ConfVars.CATALOG_DEFAULT);
+ List<IcebergMetricsReporter> reporters = createReporters();
+ return security.proxy(new HMSCatalogServlet(new HMSCatalogAdapter(catalogName, catalog, reporters)));
+ }
+
+ private List<IcebergMetricsReporter> createReporters() {
+ final var classes = configuration.getClasses(
+ ConfVars.ICEBERG_CATALOG_METRICS_REPORTERS.getVarname(),
+ LoggingMetricsReporter.class
+ );
+ return Arrays.stream(classes).map(clazz -> {
+ try {
+ final var constructor = clazz.getDeclaredConstructor(Configuration.class);
+ return (IcebergMetricsReporter) constructor.newInstance(configuration);
+ } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
+ throw new IllegalArgumentException("Failed to instantiate IcebergMetricsReporter: {}" + clazz.getName(), e);
Review Comment:
Remove the `{}`
```throw new IllegalArgumentException("Failed to instantiate IcebergMetricsReporter: " + clazz.getName(), e);```
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "Aggarwal-Raghav (via GitHub)" <gi...@apache.org>.
Aggarwal-Raghav commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3186330789
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -574,8 +584,11 @@ public <T extends RESTResponse> T postForm(
}
@Override
- public void close() {
+ public void close() throws IOException {
// The caller is responsible for closing the underlying catalog backing this REST catalog.
+ for (IcebergMetricsReporter reporter : metricsReporters) {
Review Comment:
In case if multiple reported are present and there is exception in closing 1 reporter, rest all will not be closed. Can we do something like this ?
https://github.com/apache/hive/blob/cff3c626e201f1ab6efb2fd58a28fa80ccd83104/ql/src/java/org/apache/hadoop/hive/ql/util/CloseableThreadLocal.java#L48-L58
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6461:
URL: https://github.com/apache/hive/pull/6461#issuecomment-4372199791
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461) **Quality Gate passed**
Issues
 [3 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3187827040
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -574,8 +584,11 @@ public <T extends RESTResponse> T postForm(
}
@Override
- public void close() {
+ public void close() throws IOException {
// The caller is responsible for closing the underlying catalog backing this REST catalog.
+ for (IcebergMetricsReporter reporter : metricsReporters) {
Review Comment:
True. I found the close method would not be invoked, so I added a Servlet lifecycle method and logging for safety.
https://github.com/apache/hive/pull/6461/commits/69c2efd90e4607a9d21dc1ebf6c4a0c811779d23
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3187840777
##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java:
##########
@@ -2516,6 +2520,24 @@ public static <I> Class<? extends I> getClass(Configuration conf, ConfVars var,
conf.getClass(var.varname, defaultValue, xface);
}
+ /**
+ * Get class instances based on a configuration value
+ * @param conf configuration file to retrieve it from
+ * @param var variable to retrieve
+ * @return instances of the classes
+ */
+ public static Class<?>[] getClasses(Configuration conf, ConfVars var) {
+ assert var.defaultVal.getClass() == String.class;
+ Class<?> defaultClass;
+ try {
+ defaultClass = Class.forName((String) var.defaultVal);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("The default class " + var.defaultVal + " does not exist");
+ }
+ String val = conf.get(var.varname);
+ return val == null ? conf.getClasses(var.hiveName, defaultClass) : conf.getClasses(var.varname, defaultClass);
Review Comment:
Added this method so that HMS can pick up fallback variables.
```
% docker run --rm -p 9001:9001 --env SERVICE_OPTS='-Dmetastore.iceberg.catalog.metrics.reporters=org.apache.iceberg.rest.metrics.LoggingMetricsReporter,org.apache.iceberg.rest.metrics.LoggingMetricsReporter' apache/hive:standalone-metastore-4.3.0-SNAPSHOT
...
2026-05-05T10:41:32,238 INFO [qtp515442419-63] metrics.LoggingMetricsReporter: Event reported at 2026-05-05T10:41:32.238290053Z: catalog=hive, table=default.test, report=ScanReport{tableName=default.test, snapshotId=1000000000001, filter=true, schemaId=0, projectedFieldIds=[1], projectedFieldNames=[id], scanMetrics=ScanMetricsResult{totalPlanningDuration=TimerResult{timeUnit=NANOSECONDS, totalDuration=PT2.644235116S, count=1}, resultDataFiles=CounterResult{unit=COUNT, value=3}, resultDeleteFiles=CounterResult{unit=COUNT, value=0}, totalDataManifests=CounterResult{unit=COUNT, value=1}, totalDeleteManifests=CounterResult{unit=COUNT, value=0}, scannedDataManifests=CounterResult{unit=COUNT, value=1}, skippedDataManifests=CounterResult{unit=COUNT, value=0}, totalFileSizeInBytes=null, totalDeleteFileSizeInBytes=null, skippedDataFiles=null, skippedDeleteFiles=null, scannedDeleteManifests=null, skippedDeleteManifests=null, indexedDeleteFiles=null, equalityDeleteFiles=null, positionalDele
teFiles=null, dvs=null}, metadata={source=dummy-curl, user=test-user, trace-id=dummy-trace-001}}
2026-05-05T10:41:32,244 INFO [qtp515442419-63] metrics.LoggingMetricsReporter: Event reported at 2026-05-05T10:41:32.238290053Z: catalog=hive, table=default.test, report=ScanReport{tableName=default.test, snapshotId=1000000000001, filter=true, schemaId=0, projectedFieldIds=[1], projectedFieldNames=[id], scanMetrics=ScanMetricsResult{totalPlanningDuration=TimerResult{timeUnit=NANOSECONDS, totalDuration=PT2.644235116S, count=1}, resultDataFiles=CounterResult{unit=COUNT, value=3}, resultDeleteFiles=CounterResult{unit=COUNT, value=0}, totalDataManifests=CounterResult{unit=COUNT, value=1}, totalDeleteManifests=CounterResult{unit=COUNT, value=0}, scannedDataManifests=CounterResult{unit=COUNT, value=1}, skippedDataManifests=CounterResult{unit=COUNT, value=0}, totalFileSizeInBytes=null, totalDeleteFileSizeInBytes=null, skippedDataFiles=null, skippedDeleteFiles=null, scannedDeleteManifests=null, skippedDeleteManifests=null, indexedDeleteFiles=null, equalityDeleteFiles=null, positionalDele
teFiles=null, dvs=null}, metadata={source=dummy-curl, user=test-user, trace-id=dummy-trace-001}}
...
2026-05-05T10:41:36,132 INFO [JettyShutdownThread] metrics.LoggingMetricsReporter: Closing org.apache.iceberg.rest.metrics.LoggingMetricsReporter
2026-05-05T10:41:36,133 INFO [JettyShutdownThread] metrics.LoggingMetricsReporter: Closing org.apache.iceberg.rest.metrics.LoggingMetricsReporter
```
```
$ docker run --rm -p 9001:9001 --env SERVICE_OPTS='-Dhive.metastore.iceberg.catalog.metrics.reporters=org.apache.iceberg.rest.metrics.LoggingMetricsReporter,org.apache.iceberg.rest.metrics.LoggingMetricsReporter' apache/hive:standalone-metastore-4.3.0-SNAPSHOT
...
2026-05-05T10:50:10,614 INFO [qtp515442419-63] metrics.LoggingMetricsReporter: Event reported at 2026-05-05T10:50:10.614012292Z: catalog=hive, table=default.test, report=ScanReport{tableName=default.test, snapshotId=1000000000001, filter=true, schemaId=0, projectedFieldIds=[1], projectedFieldNames=[id], scanMetrics=ScanMetricsResult{totalPlanningDuration=TimerResult{timeUnit=NANOSECONDS, totalDuration=PT2.644235116S, count=1}, resultDataFiles=CounterResult{unit=COUNT, value=3}, resultDeleteFiles=CounterResult{unit=COUNT, value=0}, totalDataManifests=CounterResult{unit=COUNT, value=1}, totalDeleteManifests=CounterResult{unit=COUNT, value=0}, scannedDataManifests=CounterResult{unit=COUNT, value=1}, skippedDataManifests=CounterResult{unit=COUNT, value=0}, totalFileSizeInBytes=null, totalDeleteFileSizeInBytes=null, skippedDataFiles=null, skippedDeleteFiles=null, scannedDeleteManifests=null, skippedDeleteManifests=null, indexedDeleteFiles=null, equalityDeleteFiles=null, positionalDele
teFiles=null, dvs=null}, metadata={source=dummy-curl, user=test-user, trace-id=dummy-trace-001}}
2026-05-05T10:50:10,619 INFO [qtp515442419-63] metrics.LoggingMetricsReporter: Event reported at 2026-05-05T10:50:10.614012292Z: catalog=hive, table=default.test, report=ScanReport{tableName=default.test, snapshotId=1000000000001, filter=true, schemaId=0, projectedFieldIds=[1], projectedFieldNames=[id], scanMetrics=ScanMetricsResult{totalPlanningDuration=TimerResult{timeUnit=NANOSECONDS, totalDuration=PT2.644235116S, count=1}, resultDataFiles=CounterResult{unit=COUNT, value=3}, resultDeleteFiles=CounterResult{unit=COUNT, value=0}, totalDataManifests=CounterResult{unit=COUNT, value=1}, totalDeleteManifests=CounterResult{unit=COUNT, value=0}, scannedDataManifests=CounterResult{unit=COUNT, value=1}, skippedDataManifests=CounterResult{unit=COUNT, value=0}, totalFileSizeInBytes=null, totalDeleteFileSizeInBytes=null, skippedDataFiles=null, skippedDeleteFiles=null, scannedDeleteManifests=null, skippedDeleteManifests=null, indexedDeleteFiles=null, equalityDeleteFiles=null, positionalDele
teFiles=null, dvs=null}, metadata={source=dummy-curl, user=test-user, trace-id=dummy-trace-001}}
...
2026-05-05T10:50:13,075 INFO [JettyShutdownThread] metrics.LoggingMetricsReporter: Closing org.apache.iceberg.rest.metrics.LoggingMetricsReporter
2026-05-05T10:50:13,075 INFO [JettyShutdownThread] metrics.LoggingMetricsReporter: Closing org.apache.iceberg.rest.metrics.LoggingMetricsReporter
```
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6461:
URL: https://github.com/apache/hive/pull/6461#issuecomment-4376392689
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on PR #6461:
URL: https://github.com/apache/hive/pull/6461#issuecomment-4384886703
Merged. @deniskuzZ @Aggarwal-Raghav Thanks for your reviews!
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6461:
URL: https://github.com/apache/hive/pull/6461#issuecomment-4381360252
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "Aggarwal-Raghav (via GitHub)" <gi...@apache.org>.
Aggarwal-Raghav commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3186362052
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -315,9 +323,11 @@ private RESTResponse renameTable(Object body) {
return null;
}
- private RESTResponse reportMetrics(Object body) {
- // nothing to do here other than checking that we're getting the correct request
- castRequest(ReportMetricsRequest.class, body);
+ private RESTResponse reportMetrics(Map<String, String> vars, Object body) {
+ final var ident = identFromPathVars(vars);
Review Comment:
Just nitpicking, can we provide explicit type instead of `var` here? In reflection code below that is totally understandable but what `identFromPathVars` returns makes it difficult for me to infer without IDE
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "Aggarwal-Raghav (via GitHub)" <gi...@apache.org>.
Aggarwal-Raghav commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3186362052
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -315,9 +323,11 @@ private RESTResponse renameTable(Object body) {
return null;
}
- private RESTResponse reportMetrics(Object body) {
- // nothing to do here other than checking that we're getting the correct request
- castRequest(ReportMetricsRequest.class, body);
+ private RESTResponse reportMetrics(Map<String, String> vars, Object body) {
+ final var ident = identFromPathVars(vars);
Review Comment:
Just nitpicking, can we provide explicit type instead of `var` here? In reflection code below that is totally understandable but what `identFromPathVars` returns makes it difficult for me to infer.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin merged PR #6461:
URL: https://github.com/apache/hive/pull/6461
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3187829331
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogAdapter.java:
##########
@@ -315,9 +323,11 @@ private RESTResponse renameTable(Object body) {
return null;
}
- private RESTResponse reportMetrics(Object body) {
- // nothing to do here other than checking that we're getting the correct request
- castRequest(ReportMetricsRequest.class, body);
+ private RESTResponse reportMetrics(Map<String, String> vars, Object body) {
+ final var ident = identFromPathVars(vars);
Review Comment:
It is a fair opinion: https://github.com/apache/hive/pull/6461/changes/d896dfad835f8a718a4f5dbb6ceb7e7299b47b77
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #6461:
URL: https://github.com/apache/hive/pull/6461#issuecomment-4378883696
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461) **Quality Gate passed**
Issues
 [5 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6461&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=6461&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=6461&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=6461)
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
Re: [PR] HIVE-29593: Server-side Metrics Reporting for Iceberg operations [hive]
Posted by "okumin (via GitHub)" <gi...@apache.org>.
okumin commented on code in PR #6461:
URL: https://github.com/apache/hive/pull/6461#discussion_r3180537912
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/metrics/IcebergMetricsReporter.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.iceberg.rest.metrics;
+
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.metrics.MetricsReport;
+
+import java.time.Instant;
+
+/**
+ * An event reporter for Iceberg metrics.
+ */
+public interface IcebergMetricsReporter {
+ /**
+ * Report an event.
+ *
+ * @param catalog the catalog name
+ * @param identifier the table identifier
+ * @param report the event
+ * @param receivedAt the timestamp when the Iceberg REST Catalog received the event
+ */
+ void report(String catalog, TableIdentifier identifier, MetricsReport report, Instant receivedAt);
Review Comment:
FYI: Polaris and Gravitino's SPI
- https://github.com/apache/polaris/blob/apache-polaris-1.4.1/runtime/service/src/main/java/org/apache/polaris/service/reporting/PolarisMetricsReporter.java
- https://github.com/apache/gravitino/blob/v1.2.0/iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/metrics/IcebergMetricsStore.java#L38-L47
##########
standalone-metastore/metastore-rest-catalog/src/main/java/org/apache/iceberg/rest/HMSCatalogServlet.java:
##########
@@ -147,8 +147,15 @@ static ServletRequestContext from(HttpServletRequest request) throws IOException
Route route = routeContext.first();
Object requestBody = null;
if (route.requestClass() != null) {
- requestBody =
- RESTObjectMapper.mapper().readValue(request.getReader(), route.requestClass());
+ try {
+ requestBody = RESTObjectMapper.mapper().readValue(request.getReader(), route.requestClass());
+ } catch (Exception e) {
+ return new ServletRequestContext(ErrorResponse.builder()
+ .responseCode(400)
+ .withType(e.getClass().getSimpleName())
+ .withMessage(e.getMessage())
+ .build());
Review Comment:
I happened to find an invalid body throws a 500 error
##########
standalone-metastore/metastore-rest-catalog/src/test/java/org/apache/iceberg/rest/extension/RESTCatalogServer.java:
##########
@@ -60,6 +61,9 @@ public void start(Configuration conf) throws Exception {
String uniqueTestKey = String.format("RESTCatalogServer_%s", UUID.randomUUID());
warehouseDir = Path.of(MetaStoreTestUtils.getTestWarehouseDir(uniqueTestKey));
+ Files.createDirectories(warehouseDir);
+ System.setProperty("derby.stream.error.file",
+ warehouseDir.resolve("derby.log").toAbsolutePath().toString());
Review Comment:
This log was generated in `standalone-metastore/metastore-rest-catalog/derby.log` originally, which is not git-ignored.
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org