Skip to content

#2779 add shading to prometheus plugin#2780

Merged
robfrank merged 1 commit intomainfrom
feat/2779-prometheus-shaded
Nov 15, 2025
Merged

#2779 add shading to prometheus plugin#2780
robfrank merged 1 commit intomainfrom
feat/2779-prometheus-shaded

Conversation

@robfrank
Copy link
Collaborator

This pull request includes updates to the Maven build configuration for the metrics and package modules, as well as dependency management improvements. Additionally, it cleans up the studio/package-lock.json by removing unnecessary peer fields from dependencies.

Dependency and build configuration improvements:

  • Added the maven-shade-plugin to the metrics/pom.xml build configuration, enabling the creation of shaded (fat) JARs.
  • In package/pom.xml, swapped the order of arcadedb-metrics and arcadedb-studio dependencies, added a shaded classifier to arcadedb-metrics, and excluded all its transitive dependencies to avoid potential conflicts.

Package lock file cleanup:

  • Removed the "peer": true property from multiple dependencies in studio/package-lock.json, simplifying the dependency metadata and potentially reducing warnings or issues during npm/yarn installs. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

@robfrank robfrank added this to the 25.11.1 milestone Nov 15, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the project's build and dependency management by introducing shading for the Prometheus metrics plugin to ensure self-contained deployment and prevent dependency clashes. Concurrently, it streamlines the frontend's package-lock.json by removing redundant peer dependency flags, aiming for a cleaner and more stable dependency resolution process.

Highlights

  • Maven Build Configuration: The maven-shade-plugin has been added to the metrics/pom.xml to enable the creation of shaded (fat) JARs, which helps in bundling all dependencies into a single JAR.
  • Dependency Management: In package/pom.xml, the order of arcadedb-metrics and arcadedb-studio dependencies was swapped. The arcadedb-metrics dependency now includes a shaded classifier and explicitly excludes all its transitive dependencies to prevent potential conflicts.
  • Frontend Dependency Cleanup: The studio/package-lock.json file has been cleaned up by removing the unnecessary "peer": true property from several dependency entries, which simplifies dependency metadata and can reduce warnings during npm/yarn installs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify
Copy link
Contributor

mergify bot commented Nov 15, 2025

🧪 CI Insights

Here's what we observed from your CI run for ae9b80f.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces shading for the arcadedb-metrics module to bundle the Prometheus client dependencies, preventing potential classpath conflicts. The changes in package/pom.xml correctly consume the shaded JAR and exclude its transitive dependencies. The modifications to studio/package-lock.json appear to be dependency metadata cleanup. My main feedback is to add package relocation to the maven-shade-plugin configuration in metrics/pom.xml as a best practice to avoid any potential library conflicts at runtime.

Comment on lines +64 to +67
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While adding the maven-shade-plugin is correct for bundling dependencies, it's a best practice to also relocate the packages of the shaded dependencies. This prevents potential classpath conflicts if other parts of the application or other plugins use different versions of the same libraries (like Micrometer or Prometheus client). I suggest adding a <configuration> section with <relocations> to move the shaded packages into a private namespace within the arcadedb-metrics artifact.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>io.micrometer</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.io.micrometer</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>io.prometheus</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.io.prometheus</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.hdrhistogram</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.org.hdrhistogram</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.latencyutils</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.org.latencyutils</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </plugin>

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.10%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f397d6d) 73243 46790 63.88%
Head commit (ae9b80f) 73255 (+12) 46723 (-67) 63.78% (-0.10%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2780) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@robfrank robfrank linked an issue Nov 15, 2025 that may be closed by this pull request
@robfrank robfrank merged commit 9fd0029 into main Nov 15, 2025
20 of 25 checks passed
@robfrank robfrank deleted the feat/2779-prometheus-shaded branch November 15, 2025 16:40
robfrank added a commit that referenced this pull request Feb 11, 2026
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.

Shade the Phometheus jars

1 participant