Skip to content

feat: emit UCUM units for first-party SDK instruments (O11Y-1820) - #707

Merged
John-Hollister merged 3 commits into
mainfrom
jhollister/O11Y-1820-first-party-metric-units
Aug 7, 2026
Merged

John-Hollister merged 3 commits into
mainfrom
jhollister/O11Y-1820-first-party-metric-units

Conversation

@John-Hollister

Copy link
Copy Markdown
Contributor

Summary

  • Emit UCUM/OTel units when creating first-party browser instruments (web vitals, heap, fps, viewport, network, long tasks) so ClickHouse MetricUnit is populated at ingest.
  • Add optional unit on public Metric APIs and pass it through on node / RN / Cloudflare create* paths; explicit unit overrides the first-party map.

Test plan

  • yarn vitest run src/client/utils/metricUnits.test.ts src/sdk/observe.metricUnits.test.ts in sdk/highlight-run
  • After publish: bump observability submodule; dogfood metric_units / GetMetrics for LCP (ms), CLS (1), usedJSHeapSize (By)

Made with Cursor

Pass unit at createGauge/Counter/Histogram so MetricUnit is populated at ingest for web vitals, heap, and other first-party browser metrics.

Co-authored-by: Cursor <cursoragent@cursor.com>
@John-Hollister
John-Hollister marked this pull request as ready for review August 6, 2026 17:45
@John-Hollister
John-Hollister requested a review from a team as a code owner August 6, 2026 17:45
@John-Hollister John-Hollister changed the title O11Y-1820: emit UCUM units for first-party SDK instruments feat: emit UCUM units for first-party SDK instruments (O11Y-1820) Aug 6, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aec63b6. Configure here.

Comment thread sdk/highlight-run/src/client/utils/metricUnits.ts Outdated
navigator.deviceMemory is scaled by 1024, so the recorded value is mebibytes (UCUM MiBy), not decimal megabytes (MBy).

Co-authored-by: Cursor <cursoragent@cursor.com>

@Vadman97 Vadman97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice, confirmed that our auto-instrumentations (like web vitals listener) go thru the recordGauge path, so the metric unit inference for 1p metrics makes sense

Comment thread .changeset/o11y-1820-metric-units.md Outdated
Release Please owns versioning now; changeset files are unused.

Co-authored-by: Cursor <cursoragent@cursor.com>
@John-Hollister
John-Hollister merged commit 1d83bd5 into main Aug 7, 2026
23 of 24 checks passed
@John-Hollister
John-Hollister deleted the jhollister/O11Y-1820-first-party-metric-units branch August 7, 2026 16:22
Vadman97 pushed a commit that referenced this pull request Aug 7, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>observability: 1.1.18</summary>

##
[1.1.18](observability-1.1.17...observability-1.1.18)
(2026-08-07)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * highlight.run bumped to 10.7.0
</details>

<details><summary>observability-next: 0.2.3</summary>

##
[0.2.3](observability-next-0.2.2...observability-next-0.2.3)
(2026-08-07)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/observability bumped to 1.1.18
    * @launchdarkly/observability-node bumped to 1.3.0
    * @launchdarkly/session-replay bumped to 1.1.18
</details>

<details><summary>observability-node: 1.3.0</summary>

##
[1.3.0](observability-node-1.2.0...observability-node-1.3.0)
(2026-08-07)


### Features

* emit UCUM units for first-party SDK instruments (O11Y-1820)
([#707](#707))
([1d83bd5](1d83bd5))
</details>

<details><summary>observability-react-native: 0.18.0</summary>

##
[0.18.0](observability-react-native-0.17.1...observability-react-native-0.18.0)
(2026-08-07)


### Features

* emit UCUM units for first-party SDK instruments (O11Y-1820)
([#707](#707))
([1d83bd5](1d83bd5))
</details>

<details><summary>session-replay: 1.1.18</summary>

##
[1.1.18](session-replay-1.1.17...session-replay-1.1.18)
(2026-08-07)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * highlight.run bumped to 10.7.0
</details>

<details><summary>session-replay-react-native: 0.21.1</summary>

##
[0.21.1](session-replay-react-native-0.21.0...session-replay-react-native-0.21.1)
(2026-08-07)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/observability-react-native bumped to 0.18.0
</details>

<details><summary>highlight.run: 10.7.0</summary>

##
[10.7.0](highlight.run-10.6.0...highlight.run-10.7.0)
(2026-08-07)


### Features

* emit UCUM units for first-party SDK instruments (O11Y-1820)
([#707](#707))
([1d83bd5](1d83bd5))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release Please** version bump only—no application code in this diff.
It cuts npm releases that ship the already-merged **UCUM units on
first-party SDK metrics** work
([#707](#707)).
> 
> **`highlight.run` 10.7.0** is the functional release (minor).
**`@launchdarkly/observability-node` 1.3.0** and
**`@launchdarkly/observability-react-native` 0.18.0** pick up the same
feature on their platforms. **`@launchdarkly/observability` 1.1.18**,
**`@launchdarkly/session-replay` 1.1.18**,
**`@launchdarkly/observability-next` 0.2.3**, and
**`@launchdarkly/session-replay-react-native` 0.21.1** are
dependency-driven patch/minor bumps so published packages align on
**`highlight.run` 10.7.0** and the updated RN stack.
> 
> Touches **`.release-please-manifest.json`**, each package’s
**`package.json`**, and **`CHANGELOG.md`** entries dated 2026-08-07.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
869541f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
abelonogov-ld added a commit that referenced this pull request Aug 8, 2026
…darkly/observability-sdk into andrey/ci-symbolication-artifacts

* 'andrey/ci-symbolication-artifacts' of github.com:launchdarkly/observability-sdk:
  fix: remediate high and critical Dependabot alerts across SDKs and examples (#710)
  chore: release main (#709)
  ci: prevent script injection in manual-publish-docs workflow (#694)
  feat: emit UCUM units for first-party SDK instruments (O11Y-1820) (#707)
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.

2 participants