Skip to content

Conversation

@nastra
Copy link
Contributor

@nastra nastra commented Apr 13, 2023

depends on #7337

@github-actions github-actions bot added the core label Apr 13, 2023
}
}

private TableIdentifier identifierWithoutCatalog(String tableNameWithCatalog) {
Copy link
Contributor Author

@nastra nastra Apr 13, 2023

Choose a reason for hiding this comment

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

The table name in reports always carries the catalog name as the first part. I might have missed it, but I haven't found anything in the codebase that would give us the TableIdentifier from the fully-qualified table name (that also carries the catalog's name). Should this functionality maybe live somewhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like a bad idea to parse this. Can we add the identifier to the ScanReport instead? Then we could use the identifier that was loaded. Maybe we should add it to BaseTable as well, like the Python implementation does.

Copy link
Contributor Author

@nastra nastra Apr 24, 2023

Choose a reason for hiding this comment

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

I completely agree here. It would be great if the actual table would carry a TableIdentifier, then we could just use that. I'll open a separate issue to improve that.

Can we add the identifier to the ScanReport instead?

So I think the first step would be to add TableIdentifier to Table and then use that TableIdentifier for ScanReport/CommitReport.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've opened #7419

@nastra nastra force-pushed the extract-rest-metrics-reporter branch 2 times, most recently from 61558e2 to 35aa55a Compare April 13, 2023 13:53
@nastra nastra closed this Apr 13, 2023
@nastra nastra reopened this Apr 13, 2023
@nastra nastra force-pushed the extract-rest-metrics-reporter branch from 57284c5 to 75ecf6f Compare April 18, 2023 09:55
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RESTMetricsReporter implements MetricsReporter {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

making RESTMetricsReporter fully Serializable will be handled in a separate PR as it currently also requires #7144

@nastra nastra force-pushed the extract-rest-metrics-reporter branch from 75ecf6f to c48fd88 Compare April 20, 2023 08:12
@github-actions github-actions bot added the API label Apr 20, 2023
@nastra nastra force-pushed the extract-rest-metrics-reporter branch 2 times, most recently from 8cae49f to 335206a Compare April 21, 2023 06:27
@nastra nastra requested a review from rdblue April 21, 2023 15:36
@nastra nastra force-pushed the extract-rest-metrics-reporter branch from 335206a to 72148d7 Compare April 21, 2023 15:55
@github-actions github-actions bot removed the API label Apr 21, 2023
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class RESTMetricsReporter implements MetricsReporter {
Copy link
Contributor

Choose a reason for hiding this comment

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

Serializable? Or is this just to produce a separate one as a minimal refactor?

Copy link
Contributor Author

@nastra nastra Apr 24, 2023

Choose a reason for hiding this comment

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

for easier reviewing, the goal of this PR was to move REST metrics reporting into its own class before making it fully serializable (as that involves slightly more changes). I have a WIP PR (currently outdated) for this that also includes the required changes from #7144

// different method calls
if (!"v1/oauth/tokens".equals(path)) {
if ("v1/config".equals(path)) {
if ("v1/config".equals(path) || path.endsWith("/metrics")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this needed?

Copy link
Contributor Author

@nastra nastra Apr 24, 2023

Choose a reason for hiding this comment

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

this is because now we only instantiate a single metrics reporter and use the headers from the catalog's AuthSession.
In case that is a concern, we could instantiate a new reporter wherever we currently pass in the reporter and then use the headers from session::headers.

In fact that approach might be better as we wouldn't need to derive the TableIdentifier from the metrics report.

@nastra nastra force-pushed the extract-rest-metrics-reporter branch 2 times, most recently from 12b5f79 to a29d3b2 Compare April 24, 2023 10:13
@nastra nastra force-pushed the extract-rest-metrics-reporter branch from a29d3b2 to e047145 Compare April 24, 2023 10:14
}
} catch (Exception e) {
LOG.warn("Failed to report metrics to REST endpoint for table {}", tableIdentifier, e);
private MetricsReporter metricsReporter(
Copy link
Contributor Author

@nastra nastra Apr 24, 2023

Choose a reason for hiding this comment

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

rather than wrapping the combined reporter in a lambda for the purpose of reporting, we just return the combined reporter here.

@rdblue rdblue merged commit 8e73813 into apache:master Apr 25, 2023
@nastra nastra deleted the extract-rest-metrics-reporter branch April 25, 2023 18:00
manisin pushed a commit to Snowflake-Labs/iceberg that referenced this pull request May 9, 2023
zhongyujiang pushed a commit to zhongyujiang/iceberg that referenced this pull request Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants