feat(metrics): add UpDownCounter to Buffered Metrics and RuntimeMetricMeter#2007
Merged
mjameswh merged 5 commits intotemporalio:mainfrom Apr 20, 2026
Merged
Conversation
Contributor
Author
…imeMetricMeter Add the UpDownCounter metric instrument type, which supports adding signed values (positive or negative), to the buffered metrics pipeline and RuntimeMetricMeter. This does not yet expose UpDownCounter on workflow or activity context meters. - Update sdk-core submodule to pick up UpDownCounter support - Add MetricUpDownCounter interface and update MetricKind type - Add UpDownCounter NAPI bridge (Rust struct, create/add functions) - Handle SignedDelta and UpDownCounter in buffered metric conversion - Add RuntimeMetricUpDownCounter class - Add NoopMetricMeter and composed tags support for UpDownCounter - Add buffered metrics test covering UpDownCounter including negative values - Enable otel feature on temporalio-common (required by sdk-core update)
c0413df to
69118e3
Compare
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
mjameswh
reviewed
Apr 14, 2026
Contributor
|
Thanks a lot @gibbonjj for bearing with me. Splitting your original PR definitely makes easier. I flagged a few minor details to be fixed, they should all be straightforward to apply. |
…buffered_metrics # Conflicts: # packages/core-bridge/Cargo.lock
- Use #[derive(TryIntoJs)] on MetricKind enum (the derive macro produces 'up-down-counter' automatically), and rename the TS kind string from 'up_down_counter' to 'up-down-counter' to match - Reorder newMetricUpDownCounter export and createUpDownCounter method to group with their respective creation siblings - Add FIXME on MetricMeterWithComposedTags.createUpDownCounter guard noting it can go once up-down-counter support is complete
Contributor
Author
Thanks! addressed all of your comments 😄 |
4 tasks
mjameswh
approved these changes
Apr 20, 2026
Contributor
|
Awesome! Thanks @gibbonjj! |
Contributor
|
There was a bug in the |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
UpDownCountermetric instrument type (supports signed values) to the buffered metrics pipeline andRuntimeMetricMeterUpDownCountersupport (temporalio/sdk-core#1180)otelfeature ontemporalio-common(required by sdk-core update)This is step 1+2 of the breakdown from the previous PR review:
Changes
packages/common/src/metrics.ts—MetricUpDownCounterinterface,MetricKindunion,NoopMetricMeter, composed tags wrapperpackages/core-bridge/src/metrics.rs— RustUpDownCounterstruct, NAPI create/add functions, buffered metricSignedDelta+UpDownCounterhandlingpackages/core-bridge/ts/native.ts— native TS declarations,BufferedMetricKindupdatepackages/worker/src/runtime-metrics.ts—RuntimeMetricUpDownCounterclass,createUpDownCounteron meterpackages/test/src/test-runtime-buffered-metrics.ts— buffered metrics test with UpDownCounter including negative values