You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This MR fixes two problems found in a user's bug report: SCI values that were far too high, and transactions that showed a rate of 0.
Fix the SCI formula in the example Grafana dashboards
The SCI panels in all four example dashboards had unit errors. The corrected formulas follow the model from our SSP24 and FSE'25 papers. Recomputed with the
measurement data from the FSE'25 paper (Table 4), the new formula matches the published per-transaction power values within 0.6–1.5 %.
CPU utilization: rate() returns ms per second, but the old formula treated it as ms per minute (/ 60000) and didn't divide by the vCPU count. It now uses rate
/ 1000 / vCPU.
CPU power: min/max power are published per vCPU, so they are now multiplied by the vCPU count.
CPU energy: the old formula produced Joules instead of kWh, which made it too high by a factor of 3600. It is now PTcpu / 60 / 1000, i.e. kWh per minute.
Attribution: the Spring and Quarkus dashboards didn't assign CPU power to the transaction, so it is now multiplied by CPUutilT. PUE is now applied as well.
Unit mismatches: GEF is published in kg/kWh, so the CPU and memory terms are now converted to g. Embodied emissions were in mg and are now converted to g. The memory rate is now converted from per-second to per-minute.
New gauge io.retit.emissions.instance.vcpu.count: gives the dashboards the vCPU count, which was previously only available as a label.
README: documents the units of all metrics, including the process CPU time in ms and the Prometheus naming difference between the two CPU counters, plus the full SCI formula.
Exclude high-cardinality span attributes from resource demand metrics
All span attributes were copied onto the io.retit.resource.demand.* counters, including url.query. If the query contains session or person IDs, almost every
request creates its own time series. A new series starts with a single value, so Prometheus' rate() returns 0 for it, and after 2000 series the SDK puts
everything into an overflow series that has no url.path. Personal data also ended up as metric labels.
Extended default exclusion list: besides the existing network, thread, user, client and instance, it now also excludes:
New config option IO_RETIT_METRICS_EXCLUDED_ATTRIBUTES: a comma-separated list of prefixes that replaces the default list. For example, it can bring url.query
back for applications that dispatch via query parameters. io.retit.* attributes are always excluded.
Unit tests in MetricPublishingServiceTest cover the default list, a replacement list and an empty list.
README: documents the new option and which attributes are published by default.
Breaking changes
Metric attributes from the newly excluded prefixes are no longer published. Queries that filter or group by url_query etc. need to be adjusted.
The example dashboards need the new vCPU gauge, so they require this extension version.
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.167651300 g
CO₂ from manufacturing (embodied carbon) is: 0.156272079 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.323923 gCO₂eq / pipeline run emitted
Updated the IO_RETIT_METRICS_EXCLUDED_ATTRIBUTES to include additional prefixes for exclusion in metrics.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Andreas Brunnert <brunnert@retit.de>
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.184907076 g
CO₂ from manufacturing (embodied carbon) is: 0.163898517 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.348806 gCO₂eq / pipeline run emitted
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.209344854 g
CO₂ from manufacturing (embodied carbon) is: 0.175336748 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.384682 gCO₂eq / pipeline run emitted
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.220244276 g
CO₂ from manufacturing (embodied carbon) is: 0.184307014 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.404551 gCO₂eq / pipeline run emitted
This resolves and parses the exclusion configuration for every completed top-level span. On the default path, getProperty still constructs the environment-variable name and queries the environment each time; with a configured list it additionally splits, trims, and allocates a new list each time. Since agent configuration is process-wide and effectively immutable, resolve this list once during service initialization and reuse it to avoid adding configuration parsing to this hot path.
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.185854300 g
CO₂ from manufacturing (embodied carbon) is: 0.165342205 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.351197 gCO₂eq / pipeline run emitted
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.213942698 g
CO₂ from manufacturing (embodied carbon) is: 0.174352415 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.388295 gCO₂eq / pipeline run emitted
🌳 CO2 Data:
City: CONSTANT, Lat: , Lon:
IP:
CO₂ from energy is: 0.220003796 g
CO₂ from manufacturing (embodied carbon) is: 0.183431100 g Carbon Intensity for this location: 334 gCO₂eq/kWh SCI: 0.403435 gCO₂eq / pipeline run emitted
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
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.
This MR fixes two problems found in a user's bug report: SCI values that were far too high, and transactions that showed a rate of 0.
The SCI panels in all four example dashboards had unit errors. The corrected formulas follow the model from our SSP24 and FSE'25 papers. Recomputed with the
measurement data from the FSE'25 paper (Table 4), the new formula matches the published per-transaction power values within 0.6–1.5 %.
/ 1000 / vCPU.
All span attributes were copied onto the io.retit.resource.demand.* counters, including url.query. If the query contains session or person IDs, almost every
request creates its own time series. A new series starts with a single value, so Prometheus' rate() returns 0 for it, and after 2000 series the SDK puts
everything into an overflow series that has no url.path. Personal data also ended up as metric labels.
back for applications that dispatch via query parameters. io.retit.* attributes are always excluded.
Breaking changes