Skip to content

Conversation

@subkanthi
Copy link
Collaborator

No description provided.

@subkanthi
Copy link
Collaborator Author

Screenshot 2025-12-11 at 11 15 21 AM

@subkanthi
Copy link
Collaborator Author

subkanthi commented Dec 16, 2025

There are some metrics that ice is not currently tracking

CommitMetrics
totalFilesSizeInBytes
iceberg_commit_added_delete_files_total

@subkanthi subkanthi marked this pull request as ready for review December 17, 2025 13:54
Copy link
Collaborator

@shyiko shyiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Thank you!

<!-- hide "Unable to load metrics class: 'org.apache.iceberg.hadoop.HadoopMetricsContext', falling back to null metrics" -->
<logger name="org.apache.iceberg.aws.s3.S3FileIO" level="ERROR"/>
<!-- hide "Unclosed input stream" warnings from Iceberg's S3InputStream finalizer -->
<logger name="org.apache.iceberg.aws.s3.S3InputStream" level="ERROR"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this an indicator that we're not doing a good job at closing input streams and need to fix that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was coming from iceberg API and it was flooding the logs in a loop, I will get the exception

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, not able to reproduce it, will add in a separate PR.


// ==========================================================================
// Public methods
// ==========================================================================
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comments like these should be avoided

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

private final Counter messageParseErrorsTotal;

/** Returns the singleton instance of the metrics reporter. */
public static InsertWatchMetrics getInstance() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why not use IoDH for instance lazy loading (and avoid the lock?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to IoDH

"Total number of retry attempts due to failures";

// SQS errors
private static final String SQS_RECEIVE_ERRORS_TOTAL_NAME = "ice_watch_sqs_receive_errors_total";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we perhaps drop sqs from metric names here and below for consistency with metrics above + in case we decide to add support for other message queue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-12-22 at 8 10 31 AM Screenshot 2025-12-22 at 8 11 29 AM

Updated to include queue as a filter for grafana dashboard.



# delete partition
ice delete nyc.taxis_p_by_day --partition '[{"name": "tpep_pickup_datetime", "values": ["2024-12-31T23:51:20"]}]' --dry-run=false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\ like the rest

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

// Record deletion metrics
metrics.recordOrphanFilesDeleted(tableName, deletedCount.get());
for (int i = 0; i < failedCount.get(); i++) {
metrics.recordOrphanDeleteFailure(tableName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason it's not metrics.recordOrphanDeleteFailure(tableName, failedCount.get())?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

}

// Initialize Iceberg metrics reporter for Prometheus (singleton)
PrometheusMetricsReporter metricsReporter = PrometheusMetricsReporter.getInstance();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some Metrics objects are passed around (like here), others are not (like MaintenanceMetrics.getInstance()). Let's settle on one approach

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the ones passed to RestCatalogAdapter to use singleton and tested the changes.
Screenshot 2025-12-22 at 12 01 19 PM

builder.endpointOverride(endpoint);
}
} catch (Exception e) {
logger.warn("Failed to parse SQS queue URL for endpoint extraction: {}", e.getMessage());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw instead of ignore-logging, perhaps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

if (host != null && !host.endsWith(".amazonaws.com")) {
URI endpoint = new URI(uri.getScheme(), null, host, uri.getPort(), null, null, null);
logger.info("Using custom SQS endpoint: {}", endpoint);
builder.endpointOverride(endpoint);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest introducing cli option (e.g. --watch-endpoint) that allow to specify a different value from --watch as proposed approach falls apart when using localstack, etc. This way things also can continue to use AWS_ENDPOINT_URL_SQS env var when needed.

*/
package com.altinity.ice.rest.catalog.internal.metrics;

import static com.altinity.ice.rest.catalog.internal.metrics.IcebergMetricNames.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

`docker compose up`

Start ice in insert mode.
`insert flowers.iris -p --no-copy --skip-duplicates s3://bucket1/flowers/iris/external-data/ --watch="http://localhost:9324/000000000000/s3-events"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be updated, right?

@shyiko
Copy link
Collaborator

shyiko commented Dec 22, 2025

d8a655c should not be included in this PR as it's unrelated to the rest of the changes

@subkanthi
Copy link
Collaborator Author

d8a655c should not be included in this PR as it's unrelated to the rest of the changes

removed.

@subkanthi
Copy link
Collaborator Author

subkanthi commented Dec 22, 2025

Added

Catalog-level:
Screenshot 2025-12-22 at 4 40 56 PM

iceberg_catalog_tables_total (gauge)
iceberg_catalog_namespaces_total (gauge)
iceberg_catalog_operations_total (counter: create/delete table)
S3 requests (for billing visibility, since S3 Tables charges per request too — pricing):
ice_watch_requests_total or similar

snapshots_count
schema_evolutions_count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants