-
Notifications
You must be signed in to change notification settings - Fork 448
(feat) Implement metrics rest api #4115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
obelix74
wants to merge
19
commits into
apache:main
Choose a base branch
from
obelix74:implement_metrics_rest_api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
3d6714e
feat(metrics): implement Table Metrics REST API
1fc6b6f
docs: add changelog and documentation for Table Metrics REST API
a72e5f6
feat(metrics): adopt stable envelope design for metrics reports API
be0b82b
fix(metrics): harden error handling and test coverage in MetricsRepor…
7fccd77
fix(metrics): remove internal catalogId/tableId from metrics report r…
ac66c27
refactor(metrics): remove AtomicReference and columns param per revie…
8c74810
Spotless fixes
c19dd35
refactor(metrics): address PR review comments
c7d94ca
docs(metrics): mark Metrics Reports API as beta in changelog and spec
36e0f3d
merge main into implement_metrics_rest_api
c938de0
fix(metrics): add resteasy-reactive testRuntimeOnly to fix ClassNotFo…
6a8c791
fix(metrics): add @Beta to PolarisMetricsManager and PolarisMetricsRe…
1d54ecd
Review comments.
1695c73
Merge branch 'main' into implement_metrics_rest_api
442ccdc
Replace Map<String,Object> response with typed Jackson record classes
a1cbd18
Merge main into implement_metrics_rest_api
c6db37f
Apply spotless formatting after merge
0b6b91a
fix(core): replace jakarta.annotation with jspecify in metrics persis…
9e3c087
fix(jdbc): replace unresolved @Nonnull with @NonNull in JdbcBasePersi…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| import org.openapitools.generator.gradle.plugin.tasks.GenerateTask | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.openapi.generator) | ||
| id("polaris-client") | ||
| id("org.kordamp.gradle.jandex") | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(project(":polaris-core")) | ||
|
|
||
| compileOnly(platform(libs.jackson.bom)) | ||
| compileOnly("com.fasterxml.jackson.core:jackson-annotations") | ||
|
|
||
| compileOnly(libs.jakarta.annotation.api) | ||
| compileOnly(libs.jakarta.inject.api) | ||
| compileOnly(libs.jakarta.validation.api) | ||
| compileOnly(libs.microprofile.fault.tolerance.api) | ||
| compileOnly(libs.swagger.annotations) | ||
|
|
||
| implementation(libs.jakarta.servlet.api) | ||
| implementation(libs.jakarta.ws.rs.api) | ||
|
|
||
| compileOnly(platform(libs.micrometer.bom)) | ||
| compileOnly("io.micrometer:micrometer-core") | ||
|
|
||
| implementation(libs.slf4j.api) | ||
| } | ||
|
|
||
| val rootDir = rootProject.layout.projectDirectory | ||
| val specsDir = rootDir.dir("spec") | ||
| val templatesDir = rootDir.dir("server-templates") | ||
| val generatedDir = project.layout.buildDirectory.dir("generated-openapi") | ||
| val generatedOpenApiSrcDir = project.layout.buildDirectory.dir("generated-openapi/src/main/java") | ||
|
|
||
| openApiGenerate { | ||
| inputSpec = provider { specsDir.file("metrics-reports-service.yml").asFile.absolutePath } | ||
| generatorName = "jaxrs-resteasy" | ||
| outputDir = provider { generatedDir.get().asFile.absolutePath } | ||
| apiPackage = "org.apache.polaris.service.metrics.api" | ||
| modelPackage = "org.apache.polaris.core.metrics.api.model" | ||
| ignoreFileOverride.set(provider { rootDir.file(".openapi-generator-ignore").asFile.absolutePath }) | ||
| removeOperationIdPrefix.set(true) | ||
| templateDir.set(provider { templatesDir.asFile.absolutePath }) | ||
| globalProperties.put("apis", "") | ||
| globalProperties.put("models", "") | ||
| globalProperties.put("apiDocs", "false") | ||
| globalProperties.put("modelTests", "false") | ||
| configOptions.put("openApiNullable", "false") | ||
| configOptions.put("useBeanValidation", "true") | ||
| configOptions.put("sourceFolder", "src/main/java") | ||
| configOptions.put("useJakartaEe", "true") | ||
| configOptions.put("generateBuilders", "true") | ||
| configOptions.put("generateConstructorWithAllArgs", "true") | ||
| configOptions.put("hideGenerationTimestamp", "true") | ||
| additionalProperties.put("apiNamePrefix", "Polaris") | ||
| additionalProperties.put("apiNameSuffix", "Api") | ||
| additionalProperties.put("metricsPrefix", "polaris") | ||
| serverVariables.put("basePath", "api/metrics-reports/v1") | ||
| } | ||
|
|
||
| listOf("sourcesJar", "compileJava", "processResources").forEach { task -> | ||
| tasks.named(task) { dependsOn("openApiGenerate") } | ||
| } | ||
|
|
||
| sourceSets { main { java { srcDir(generatedOpenApiSrcDir) } } } | ||
|
|
||
| tasks.named<GenerateTask>("openApiGenerate") { | ||
| inputs.dir(templatesDir) | ||
| inputs.dir(specsDir) | ||
| actions.addFirst { delete { delete(generatedDir) } } | ||
| } | ||
|
|
||
| tasks.named("javadoc") { dependsOn("jandex") } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| plugins { | ||
| id("polaris-server") | ||
| id("org.kordamp.gradle.jandex") | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(project(":polaris-core")) | ||
| implementation(project(":polaris-api-metrics-reports-service")) | ||
|
|
||
| implementation(platform(libs.iceberg.bom)) | ||
| implementation("org.apache.iceberg:iceberg-api") | ||
|
|
||
| implementation(libs.jakarta.enterprise.cdi.api) | ||
| implementation(libs.jakarta.inject.api) | ||
| implementation(libs.jakarta.ws.rs.api) | ||
| compileOnly(libs.jakarta.annotation.api) | ||
|
|
||
| testImplementation(platform(libs.junit.bom)) | ||
| testImplementation("org.junit.jupiter:junit-jupiter") | ||
| testImplementation(libs.assertj.core) | ||
| testImplementation(libs.mockito.core) | ||
| testImplementation(libs.jakarta.ws.rs.api) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.