Skip to content

Conversation

@fredr
Copy link
Member

@fredr fredr commented Oct 30, 2025

Adds support for creating custom metrics in typescript apps. Depends on #2109

Inspired by the implementation in the go runtime.
Metrics needs to be defined within a service, and will automatically add the service label.

This implementation is backed by a SharedArrayBuffer, where each u64 slot is a metric value, created from js by the main thread. From js we do atomic operation to update values on this buffer, and from rust we do atomic load when collecting the metrics. The rust runtime is use to coordinate what slot should be used for a label set, so that we can support multiple workers updating the same metric.

@fredr fredr requested a review from eandre October 30, 2025 12:51
@fredr fredr self-assigned this Oct 30, 2025
@encore-cla
Copy link

encore-cla bot commented Oct 30, 2025

All committers have signed the CLA.

@fredr fredr force-pushed the fredr/ts-custom-metrics branch 2 times, most recently from 72f6462 to 1efb0bd Compare October 30, 2025 15:41
@fredr fredr force-pushed the fredr/ts-custom-metrics branch from b59ebcb to b24e057 Compare December 3, 2025 10:20
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.

3 participants