Skip to content

#86 first draft of dedicated library#315

Open
brunnert wants to merge 42 commits intomainfrom
feature/JavaLibrary
Open

#86 first draft of dedicated library#315
brunnert wants to merge 42 commits intomainfrom
feature/JavaLibrary

Conversation

@brunnert
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new dedicated CDI-based “library” module so the RETIT span processor can be used as a plain dependency (e.g., in Quarkus via CDI auto-discovery) without requiring the Java agent extension JAR, and adds a Quarkus example + integration test to validate the setup.

Changes:

  • Add new cdi-library Maven module with beans.xml and a CDI producer for RETITSpanProcessor.
  • Update the extension module to depend on and shade the library (while excluding CDI-only classes to keep Java-agent usage Java 8 compatible).
  • Add a new quarkus-rest-service-library example project and an integration test that runs it in Testcontainers.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
pom.xml Adds the new cdi-library module to the reactor build.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithLibraryIT.java New IT that runs the Quarkus “library” example container and asserts spans/metrics.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/AbstractFrameworkIT.java Adds a dedicated setup path for the library-based Quarkus example (no javaagent).
extension/pom.xml Makes the extension depend on/shade the new library and adjusts resource handling to avoid duplicates.
examples/pom.xml Registers the new quarkus-rest-service-library example module.
examples/quarkus-rest-service-library/pom.xml New Quarkus example module configured for uber-jar + container image build.
examples/quarkus-rest-service-library/src/main/resources/application.properties Quarkus example configuration (OTel + app packaging).
examples/quarkus-rest-service-library/src/main/java/io/retit/opentelemetry/quarkus/library/TestService.java Example service performing CPU + disk work to generate telemetry.
examples/quarkus-rest-service-library/src/main/java/io/retit/opentelemetry/quarkus/library/TestRESTEndpoint.java Example REST endpoints used by the integration test.
examples/quarkus-rest-service-library/src/main/java/io/retit/opentelemetry/quarkus/library/ResourceDemandMeasurementService.java Measures per-thread CPU/memory and publishes example metrics.
examples/quarkus-rest-service-library/src/main/java/io/retit/opentelemetry/quarkus/library/OpenTelemetryService.java Example OTel metric publishing service.
examples/quarkus-rest-service-library/README.md Documentation for using the CDI library approach (no agent) with Quarkus.
cdi-library/pom.xml New library module POM that reuses extension sources/resources via build-helper.
cdi-library/src/main/resources/META-INF/beans.xml Enables CDI bean discovery for the library JAR.
cdi-library/src/main/java/io/retit/opentelemetry/javaagent/extension/cdi/RETITSpanProcessorConfiguration.java CDI producer that registers RETITSpanProcessor (and optionally GC listener).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/quarkus-rest-service-library/src/main/resources/application.properties Outdated
Comment thread cdi-library/pom.xml Outdated
Comment thread cdi-library/pom.xml Outdated
Comment thread examples/quarkus-rest-service-cdi-library/README.md Outdated
brunnert and others added 7 commits April 30, 2026 08:26
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25156466710]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #123.94712140.233.58597.89
Total Run23.952140.233.58597.89
Additional overhead from Eco CIN/A2.932.011.46

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.198565672 g
CO₂ from manufacturing (embodied carbon) is: 0.170586273 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.369152 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25161617954]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.96311937.213.87500.99
Total Run27.961937.213.87500.99
Additional overhead from Eco CIN/A2.591.921.35

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.179730076 g
CO₂ from manufacturing (embodied carbon) is: 0.142939365 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.322669 gCO₂eq / pipeline run emitted

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new CDI-based library module so CDI frameworks (notably Quarkus) can use the RETIT SpanProcessor without the Java agent, and adds a dedicated Quarkus “library mode” example plus an integration test.

Changes:

  • Add new cdi-library Maven module that exposes RETITSpanProcessor via CDI producer + META-INF/beans.xml.
  • Add quarkus-rest-service-library example demonstrating usage without -javaagent, plus QuarkusWithLibraryIT.
  • Adjust build/license tooling configuration (module wiring + license URL replacement rules).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
pom.xml Adds cdi-library module and introduces GNU→SPDX license URL replacement rules for license-maven-plugin.
extension/src/test/java/.../AbstractFrameworkIT.java Adds container setup helper for the library-based Quarkus example.
extension/src/test/java/.../quarkus/QuarkusWithLibraryIT.java New integration test for quarkus-rest-service-library container.
extension/pom.xml Adds/updates dependency commentary around JNA + shading.
examples/pom.xml Registers new Quarkus library example module.
examples/quarkus-rest-service-library/pom.xml New Quarkus example module configured for uber-jar + container image build.
examples/quarkus-rest-service-library/src/main/resources/application.properties Quarkus + OTel configuration for the library-based example.
examples/quarkus-rest-service-library/src/main/java/.../TestRESTEndpoint.java New REST endpoints for the example.
examples/quarkus-rest-service-library/src/main/java/.../TestService.java New example “workload” service to generate measurable CPU/I/O.
examples/quarkus-rest-service-library/src/main/java/.../ResourceDemandMeasurementService.java Publishes CPU/memory metrics; includes thread CPU/allocation measurement.
examples/quarkus-rest-service-library/src/main/java/.../OpenTelemetryService.java Creates OTel counters and publishes resource-demand metrics.
examples/quarkus-rest-service-library/README.md Documentation for using the library-based approach and running the example/test.
cdi-library/pom.xml New module that compiles against extension sources to produce a plain JAR library.
cdi-library/src/main/resources/META-INF/beans.xml Enables CDI discovery for the library artifact.
cdi-library/src/main/java/.../RETITSpanProcessorConfiguration.java CDI producer that exposes RETITSpanProcessor and initializes GC tracking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pom.xml Outdated
Comment thread pom.xml Outdated
Comment thread extension/pom.xml Outdated
Comment thread examples/quarkus-rest-service-cdi-library/README.md Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25183564879]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #124.78891919.853.77508.90
Total Run24.791919.853.77508.90
Additional overhead from Eco CIN/A2.091.921.09

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.178119528 g
CO₂ from manufacturing (embodied carbon) is: 0.145196197 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.323316 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25184032286]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.80791896.823.86491.98
Total Run27.811896.823.86491.98
Additional overhead from Eco CIN/A2.601.861.40

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.175982596 g
CO₂ from manufacturing (embodied carbon) is: 0.140368687 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.316351 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25214535554]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.58181987.643.85516.70
Total Run27.581987.643.85516.70
Additional overhead from Eco CIN/A2.341.771.32

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.184408748 g
CO₂ from manufacturing (embodied carbon) is: 0.147421645 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.331830 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25214536745]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #126.98222018.263.81529.59
Total Run26.982018.263.81529.59
Additional overhead from Eco CIN/A2.451.841.33

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.187249752 g
CO₂ from manufacturing (embodied carbon) is: 0.151099340 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.338349 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25214604147]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #126.71211992.323.79525.05
Total Run26.711992.323.79525.05
Additional overhead from Eco CIN/A2.301.781.29

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.184842948 g
CO₂ from manufacturing (embodied carbon) is: 0.149804015 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.334647 gCO₂eq / pipeline run emitted

brunnert and others added 4 commits May 1, 2026 14:50
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
@brunnert brunnert marked this pull request as ready for review May 1, 2026 12:54
@brunnert brunnert requested a review from Copilot May 1, 2026 12:54
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25214868344]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #123.18622257.143.54636.92
Total Run23.192257.143.54636.92
Additional overhead from Eco CIN/A2.901.871.55

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.209412322 g
CO₂ from manufacturing (embodied carbon) is: 0.181722071 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.391134 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25214939662]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #125.64731897.913.72510.50
Total Run25.651897.913.72510.50
Additional overhead from Eco CIN/A1.721.760.98

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.176083798 g
CO₂ from manufacturing (embodied carbon) is: 0.145652699 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.321736 gCO₂eq / pipeline run emitted

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a first draft of a dedicated “library” integration path (CDI-based) alongside the existing Java-agent extension, by extracting shared functionality into a new core module and adding a cdi-library module that registers the RETIT span processor via CDI.

Changes:

  • Add new core module with shared resource-demand collectors, emissions/CCF coefficient loading, and metric publishing, plus unit tests and coefficient datasets.
  • Add new cdi-library module that exposes a CDI producer (RETITSpanProcessorConfiguration) to register the RETIT SpanProcessor without the Java agent.
  • Update examples, integration tests, and CI/release workflows to build/test the new library-based Quarkus path and publish artifacts to GitHub Packages.

Reviewed changes

Copilot reviewed 29 out of 81 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pom.xml Adds new Maven modules (core, cdi-library) and GitHub Packages distribution management; updates license plugin URL replacements.
extension/pom.xml Switches extension module to depend on the new core module instead of duplicating shared deps.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/jdk/JavaAgentExtensionIT.java Import cleanup (but introduces Checkstyle-breaking star imports).
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/common/ContainerLogMetricAndSpanExtractingTest.java Adjusts static imports (but introduces Checkstyle-breaking star import).
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/AbstractFrameworkIT.java Adds library-mode container setup for Quarkus internal OTel; introduces unused import.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithLibraryIT.java New integration test for the Quarkus library example image.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithInternalOtelSupportAndExtensionIT.java Removes an empty/placeholder Quarkus IT class.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithInternalOtelSupportAndCDILibraryIT.java New IT covering Quarkus internal OTel + CDI library integration.
examples/pom.xml Adds new example modules (quarkus-common, quarkus-rest-service-cdi-library).
examples/quarkus-rest-service/src/main/resources/application.properties Changes default OTLP endpoint to host.docker.internal.
examples/quarkus-rest-service/src/main/java/io/retit/opentelemetry/quarkus/OpenTelemetryService.java Removes per-example OTel metric publisher (moved to shared quarkus-common).
examples/quarkus-rest-service/pom.xml Adds dependency on new quarkus-common example module.
examples/quarkus-common/pom.xml New shared Quarkus example module used by multiple Quarkus services.
examples/quarkus-common/src/main/resources/META-INF/beans.xml Enables CDI bean discovery for the shared Quarkus example module.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/TestService.java Adds a shared “workload” service for example endpoints.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/TestRESTEndpoint.java Adds shared REST endpoints for the Quarkus examples.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/ResourceDemandMeasurementService.java Updates resource demand measurement and makes CPU-time support safer (but introduces 0l literals).
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/OpenTelemetryService.java New shared metrics publisher using injected OpenTelemetry.
examples/quarkus-rest-service-cdi-library/pom.xml New Quarkus example app demonstrating CDI library usage (no Java agent).
examples/quarkus-rest-service-cdi-library/src/main/resources/application.properties New configuration for library-based Quarkus example.
examples/quarkus-rest-service-cdi-library/README.md Documents how to use the CDI library example.
core/pom.xml New core module POM consolidating shared functionality and test deps.
core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker Enables Mockito inline mock maker for tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/resources/windows/WindowsDataCollectorTest.java Adds Windows-specific native collector tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/resources/macos/MacOSDataCollectorTest.java Adds macOS-specific native collector tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/resources/linux/LinuxDataCollectorTest.java Adds Linux-specific native collector tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/processor/RETITSpanProcessorTest.java Adds unit tests for the new core span processor.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/emissions/EmissionDataLoaderTest.java Adds tests for embodied emissions + hardware lifespan behavior.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintDataTest.java Adds tests validating CCF data loading across providers.
core/src/main/resources/ccf-coefficients/instances/gcp-instances.csv Adds CCF instance dataset for GCP.
core/src/main/resources/ccf-coefficients/instances/coefficients-gcp-use.csv Adds CCF CPU power coefficients for GCP architectures.
core/src/main/resources/ccf-coefficients/instances/coefficients-azure-use.csv Adds CCF CPU power coefficients for Azure architectures.
core/src/main/resources/ccf-coefficients/grid-emissions/grid-emissions-factors-gcp.csv Adds regional grid emissions factors for GCP.
core/src/main/resources/ccf-coefficients/grid-emissions/grid-emissions-factors-azure.csv Adds regional grid emissions factors for Azure.
core/src/main/resources/ccf-coefficients/grid-emissions/grid-emissions-factors-aws.csv Adds regional grid emissions factors for AWS.
core/src/main/resources/ccf-coefficients/embodied-emissions/coefficients-gcp-embodied-mean.csv Adds embodied emissions dataset for GCP instance types.
core/src/main/resources/ccf-coefficients/ccf-coefficients.md Documents provenance/licensing of copied CCF coefficient data.
core/src/main/resources/ccf-coefficients/LICENSE Adds Apache 2.0 license for the copied CCF coefficients.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/windows/WindowsKernel32Library.java Adds JNA bindings for Windows thread/process data used by collectors.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/windows/WindowsDataCollector.java Adds Windows resource demand collector implementation.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/macos/MacOSSystemLibrary.java Adds JNA bindings for macOS thread APIs.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/macos/MacOSDataCollector.java Adds macOS resource demand collector implementation.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/linux/LinuxDataCollector.java Adds Linux disk/network demand reading from /proc/thread-self/* (contains a critical array-contract bug).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/linux/LinuxCLibrary.java Adds JNA binding for Linux gettid() and clock_gettime.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/JavaAgentGCNotificationListener.java Makes GC span creation conditional on GlobalOpenTelemetry.isSet() and adds logging.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/JavaAgentGCHandler.java New helper for registering GC notification listener(s).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/IBMDataCollector.java Adds IBM JVM collector implementation (mostly unsupported operations).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/HotSpotDataCollector.java Adds HotSpot/OpenJDK collector implementation for allocated bytes.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/ThreadHandle.java Adds JNA pointer wrapper for thread handles.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/NativeFacade.java Adds cross-platform native facade for TID and thread CPU time (contains Checkstyle-breaking ...l literal and a Linux/x86-only guard).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/IResourceDemandDataCollector.java Introduces the collector interface contract (2-element arrays for disk/network).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/CommonResourceDemandDataCollector.java Refactors JVM/OS collector selection and adds macOS support.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/CLibrary.java Adds shared JNA interface for clock_gettime.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/processor/RETITSpanProcessor.java Adds the core span processor implementation (start + onEnding).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/metrics/MetricPublishingService.java Adds metric publishing for resource demand/emissions coefficients.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/energy/StorageEnergyData.java Adds energy coefficient helper for storage.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/energy/NetworkEnergyData.java Adds energy coefficient helper for network.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/energy/MemoryEnergyData.java Adds energy coefficient helper for memory.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/embodied/EmbodiedEmissions.java Adds embodied emissions calculation with hardware lifespan support.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudProvider.java Introduces provider enum.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintInstanceData.java Adds instance configuration DTO for emissions coefficients.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintDataLoader.java Adds CSV-based loader for provider/region/instance coefficients.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintData.java Adds singleton config holder using the loader.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintCoefficients.java Adds constants for energy/emissions coefficients (PUE, watts, etc.).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/TelemetryUtils.java Adds shared span-attribute enrichment helpers using the new collectors.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/InstanceConfiguration.java Adds shared configuration accessors (incl. hardware lifespan).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/Constants.java Adds shared constants for config keys and attribute names.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/CSVParser.java Adds lightweight CSV parsing utility.
cdi-library/pom.xml Adds CDI library module packaging and provided-scope SDK/CDI dependencies.
cdi-library/src/main/resources/META-INF/beans.xml Enables CDI discovery for the CDI library artifact.
cdi-library/src/main/java/io/retit/opentelemetry/javaagent/extension/cdi/RETITSpanProcessorConfiguration.java Adds CDI producer for RETIT SpanProcessor and config forwarding (hard-depends on MicroProfile Config).
.github/workflows/maven.yml Updates CI test invocation to include the new Quarkus CDI library IT.
.github/workflows/release.yml Adds GitHub Packages publishing for core and cdi-library and configures Maven server credentials.
.gitignore Ignores core/dependency-reduced-pom.xml.
Comments suppressed due to low confidence (2)

extension/src/test/java/io/retit/opentelemetry/javaagent/extension/jdk/JavaAgentExtensionIT.java:32

  • Wildcard imports (java.util.* and static Assertions.*) violate the project's Checkstyle AvoidStarImport rule and will fail CI. Replace with explicit imports for the specific types/assertions used in this test.
    examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/ResourceDemandMeasurementService.java:66
  • Long literals use lowercase l (0l), which violates Checkstyle's UpperEll rule and can be visually ambiguous. Use 0L for long literals (or just return 0L consistently).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25215097525]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #122.83682129.293.51606.82
Total Run22.842129.293.51606.82
Additional overhead from Eco CIN/A2.731.721.59

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.197550646 g
CO₂ from manufacturing (embodied carbon) is: 0.173134125 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.370685 gCO₂eq / pipeline run emitted

brunnert and others added 2 commits May 1, 2026 15:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25215375743]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.10921875.883.79495.14
Total Run27.111875.883.79495.14
Additional overhead from Eco CIN/A2.181.761.24

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.174040052 g
CO₂ from manufacturing (embodied carbon) is: 0.141270279 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.315310 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25215561328]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.27531711.623.78453.19
Total Run27.281711.623.78453.19
Additional overhead from Eco CIN/A1.541.730.89

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.158800300 g
CO₂ from manufacturing (embodied carbon) is: 0.129301365 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.288102 gCO₂eq / pipeline run emitted

@brunnert brunnert linked an issue May 1, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25215530536]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #122.70052112.63.50603.30
Total Run22.702112.603.50603.30
Additional overhead from Eco CIN/A2.661.801.48

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.196002222 g
CO₂ from manufacturing (embodied carbon) is: 0.172129820 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.368132 gCO₂eq / pipeline run emitted

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a first draft of a dedicated, non-agent “library” packaging for the RETIT OpenTelemetry instrumentation, alongside new Quarkus examples/tests and a refactor of shared logic into new Maven modules.

Changes:

  • Adds new Maven modules core (shared implementation) and cdi-library (CDI auto-registration of RETITSpanProcessor).
  • Adds a new Quarkus CDI-library example and corresponding integration tests in the extension module.
  • Introduces Cloud Carbon Footprint (CCF) coefficient datasets and new emissions/resource-demand collection code (Linux/Windows/macOS + JVM helpers).

Reviewed changes

Copilot reviewed 30 out of 82 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pom.xml Adds new modules; configures license URL redirects.
jitpack.yml Builds only core + cdi-library on JitPack.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/jdk/JavaAgentExtensionIT.java Simplifies java.util imports.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithLibraryIT.java Adds IT for Quarkus library example.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithInternalOtelSupportAndExtensionIT.java Removes unused/empty Quarkus IT.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/quarkus/QuarkusWithInternalOtelSupportAndCDILibraryIT.java Adds IT for Quarkus + CDI library scenario.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/frameworks/AbstractFrameworkIT.java Adds commonSetupForLibrary; adjusts OTEL env setup.
extension/src/test/java/io/retit/opentelemetry/javaagent/extension/common/ContainerLogMetricAndSpanExtractingTest.java Refactors assertions; moves helper method.
extension/pom.xml Switches extension to depend on core.
examples/quarkus-rest-service/src/main/resources/application.properties Changes OTLP endpoint configuration.
examples/quarkus-rest-service/src/main/java/io/retit/opentelemetry/quarkus/OpenTelemetryService.java Removes local metrics publisher (moved to common).
examples/quarkus-rest-service/pom.xml Adds dependency on quarkus-common.
examples/quarkus-rest-service-cdi-library/src/main/resources/application.properties Adds new CDI-library example config.
examples/quarkus-rest-service-cdi-library/pom.xml Adds new CDI-library example module build.
examples/quarkus-rest-service-cdi-library/README.md Documents CDI library example usage.
examples/quarkus-common/src/main/resources/META-INF/beans.xml Enables CDI discovery in shared Quarkus example code.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/TestService.java Adds shared example service logic.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/TestRESTEndpoint.java Adds shared REST endpoint implementation.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/ResourceDemandMeasurementService.java Updates CPU/memory measurement implementation.
examples/quarkus-common/src/main/java/io/retit/opentelemetry/quarkus/OpenTelemetryService.java Adds shared metrics publisher service.
examples/quarkus-common/pom.xml Adds new shared Quarkus example module.
examples/pom.xml Registers new example submodules.
core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker Enables Mockito inline mock-maker.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/resources/windows/WindowsDataCollectorTest.java Adds Windows resource collector tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/resources/macos/MacOSDataCollectorTest.java Adds macOS resource collector tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/resources/linux/LinuxDataCollectorTest.java Adds Linux resource collector tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/processor/RETITSpanProcessorTest.java Adds RETIT span processor unit tests.
core/src/test/java/io/retit/opentelemetry/javaagent/extension/emissions/EmissionDataLoaderTest.java Adds emissions loader tests (incl. hardware lifespan).
core/src/test/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintDataTest.java Adds CCF data initialization tests.
core/src/main/resources/ccf-coefficients/instances/gcp-instances.csv Adds GCP instance dataset.
core/src/main/resources/ccf-coefficients/instances/coefficients-gcp-use.csv Adds GCP power coefficients dataset.
core/src/main/resources/ccf-coefficients/instances/coefficients-azure-use.csv Adds Azure power coefficients dataset.
core/src/main/resources/ccf-coefficients/grid-emissions/grid-emissions-factors-gcp.csv Adds GCP grid emissions dataset.
core/src/main/resources/ccf-coefficients/grid-emissions/grid-emissions-factors-azure.csv Adds Azure grid emissions dataset.
core/src/main/resources/ccf-coefficients/grid-emissions/grid-emissions-factors-aws.csv Adds AWS grid emissions dataset.
core/src/main/resources/ccf-coefficients/embodied-emissions/coefficients-gcp-embodied-mean.csv Adds GCP embodied emissions dataset.
core/src/main/resources/ccf-coefficients/ccf-coefficients.md Documents dataset provenance/license.
core/src/main/resources/ccf-coefficients/LICENSE Includes Apache-2.0 license for datasets.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/windows/WindowsKernel32Library.java Adds Windows JNA bindings.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/windows/WindowsDataCollector.java Adds Windows OS collector.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/macos/MacOSSystemLibrary.java Adds macOS JNA bindings.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/macos/MacOSDataCollector.java Adds macOS OS collector.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/linux/LinuxDataCollector.java Adds Linux OS collector with procfs parsing.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/linux/LinuxCLibrary.java Adds Linux JNA bindings.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/JavaAgentGCNotificationListener.java Guards GC span creation on GlobalOpenTelemetry.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/JavaAgentGCHandler.java Adds GC listener registration helper.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/IBMDataCollector.java Adds IBM JVM collector stub.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/jvm/HotSpotDataCollector.java Adds HotSpot/OpenJDK JVM collector.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/ThreadHandle.java Adds cross-platform thread-handle type.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/NativeFacade.java Adds cross-platform native facade (incl. macOS).
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/IResourceDemandDataCollector.java Adds resource demand collector interface.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/CommonResourceDemandDataCollector.java Adds OS/JVM selector and shared CPU logic.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/resources/common/CLibrary.java Adds shared JNA clock_gettime interface.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/processor/RETITSpanProcessor.java Adds core RETIT span processor implementation.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/metrics/MetricPublishingService.java Adds metric publishing for emissions/demand vectors.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/energy/StorageEnergyData.java Adds storage energy coefficient wrapper.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/energy/NetworkEnergyData.java Adds network energy coefficient wrapper.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/energy/MemoryEnergyData.java Adds memory energy coefficient wrapper.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/embodied/EmbodiedEmissions.java Adds embodied emissions calculation.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudProvider.java Adds cloud provider enum.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintInstanceData.java Adds instance detail DTO.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintDataLoader.java Adds CSV-backed emissions/config loader.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintData.java Adds singleton emissions config holder.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/emissions/CloudCarbonFootprintCoefficients.java Adds constant coefficients for calculations.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/TelemetryUtils.java Adds span attribute enrichment utilities.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/InstanceConfiguration.java Adds config accessors + hardware lifespan setting.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/Constants.java Adds shared constants used across new modules.
core/src/main/java/io/retit/opentelemetry/javaagent/extension/commons/CSVParser.java Adds simple CSV parsing helper.
core/pom.xml Adds new core module build/deps.
cdi-library/src/main/resources/META-INF/beans.xml Enables CDI discovery in the library jar.
cdi-library/src/main/java/io/retit/opentelemetry/javaagent/extension/cdi/RETITSpanProcessorConfiguration.java Adds CDI producer registering the span processor + GC listener.
cdi-library/pom.xml Adds new CDI-library module build/deps.
README.md Documents dual integration modes (agent vs CDI library).
.gitignore Ignores core/dependency-reduced-pom.xml.
.github/workflows/release.yml Sets Maven version from tag in release workflow.
.github/workflows/maven.yml Updates CI test command + adds CDI-library IT.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output - Old Energy Estimation

Eco CI Output [RUN-ID: 25215751120]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.20732038.233.84531.02
Total Run27.212038.233.84531.02
Additional overhead from Eco CIN/A2.431.831.33

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.189102450 g
CO₂ from manufacturing (embodied carbon) is: 0.151507338 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.340610 gCO₂eq / pipeline run emitted

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Eco CI Output [RUN-ID: 25216605547]:

Label🖥 avg. CPU utilization [%]🔋 Total Energy [Joules]🔌 avg. Power [Watts]Duration [Seconds]
Measurement #127.64751821.213.83475.14
Total Run27.651821.213.83475.14
Additional overhead from Eco CIN/A2.281.771.29

🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.168967928 g
CO₂ from manufacturing (embodied carbon) is: 0.135564003 g
Carbon Intensity for this location: 334 gCO₂eq/kWh
SCI: 0.304532 gCO₂eq / pipeline run emitted

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.

Publish a java library that can be used outside of the agent.

2 participants