Add resource_slots_cpu/mem_usage metrics #2122
Open
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.
What was changed
Add
resource_slots_cpu_usageandresource_slots_mem_usagemetricsWhy?
Match Core and Java
Checklist
Closes Add resource tuner metrics #2089
How was this tested:
Added a test
Any docs updates needed?
Should update https://docs.temporal.io/references/sdk-metrics#resource_slots_cpu_usage to include Go in the list of supported SDKs
Note
Adds
resource_slots_cpu_usageandresource_slots_mem_usagegauges and emits them during PID decisions in the resource tuner, with accompanying tests.metrics.ResourceSlotsCPUUsageandmetrics.ResourceSlotsMemUsage.contrib/resourcetuner):metrics.HandlerintopidDecisionandTryReserveSlotto publish usage.publishResourceMetricsto update gauges with percent values.TestPidDecisionEmitsUsageMetricsverifying both gauges and values.Written by Cursor Bugbot for commit 5b7e431. This will update automatically on new commits. Configure here.