Skip to content

Conversation

@Vadman97
Copy link
Contributor

@Vadman97 Vadman97 commented Oct 15, 2025

Summary

Ensure that H.stop() shuts down OpenTelemetry exporters.

How did you test this change?

H.stop() now stops otel instrumentation; tested via e2e nextjs app

extensive testing of start-after-stop
image
image

Are there any deployment considerations?

no


Note

Ensure H.stop() and LDObserve.stop() fully shut down OTEL providers; switch metrics to getMeter() with guards and reset instrument caches; add test buttons and session replay config tweaks.

  • SDK (client):
    • Use getMeter() for metrics (createGauge/Counter/Histogram/UpDownCounter) with null-guards in sdk/highlight-run/src/client/index.tsx.
    • After setupBrowserTracing, clear metric instrument caches to bind to the new meter.
    • On stopRecording, call shutdown() to stop OTEL providers.
  • SDK (OTEL):
    • In sdk/highlight-run/src/client/otel/index.ts, prevent double-initialization if tracer or meter already exists.
    • Implement shutdown() to asynchronously shut down tracer and meter providers and unset them.
    • Expose getMeter(); remove direct metrics.getMeter(BROWSER_METER_NAME) usage.
  • SDK (observe):
    • Mirror metric getMeter() usage and cache resets in sdk/highlight-run/src/sdk/observe.ts.
    • Replace manual provider shutdowns with centralized shutdown() in stop().
  • E2E apps:
    • Add buttons to trigger H.recordMetric, H.start, H.stop in e2e/nextjs/.../highlight-buttons.tsx.
    • Extend session replay config (env, inline assets, canvas recording, sampling) in e2e/react-router/src/ldclientLazy.tsx.

Written by Cursor Bugbot for commit b092635. This will update automatically on new commits. Configure here.

@Vadman97 Vadman97 requested a review from a team as a code owner October 15, 2025 22:18
@Vadman97 Vadman97 changed the title Vadim/fix h stop otel fix: H.stop should stop otel exporters Oct 15, 2025
cursor[bot]

This comment was marked as outdated.

@Vadman97 Vadman97 enabled auto-merge (squash) October 16, 2025 22:54
cursor[bot]

This comment was marked as outdated.

@Vadman97 Vadman97 force-pushed the vadim/fix-h-stop-otel branch from 7e8e32f to 91a90de Compare October 29, 2025 20:24
cursor[bot]

This comment was marked as outdated.

@Vadman97 Vadman97 merged commit 2e5e96b into main Oct 29, 2025
24 checks passed
@Vadman97 Vadman97 deleted the vadim/fix-h-stop-otel branch October 29, 2025 22:00
Vadman97 pushed a commit that referenced this pull request Oct 30, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>observability: 0.4.7</summary>

##
[0.4.7](observability-0.4.6...observability-0.4.7)
(2025-10-30)


### Dependencies

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

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

##
[0.4.7](session-replay-0.4.6...session-replay-0.4.7)
(2025-10-30)


### Dependencies

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

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

##
[9.22.4](highlight.run-9.22.3...highlight.run-9.22.4)
(2025-10-30)


### Bug Fixes

* correctly report version on webjs otel data
([#278](#278))
([f1a2c74](f1a2c74))
* H.stop should stop otel exporters
([#273](#273))
([2e5e96b](2e5e96b))
</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]
> Publish observability 0.4.7, session-replay 0.4.7, and highlight.run
9.22.4 with dependency bumps and bug-fix notes.
> 
> - **Releases**:
>   - `sdk/@launchdarkly/observability` → `0.4.7`
>     - deps: `highlight.run` → `9.22.4`
>   - `sdk/@launchdarkly/session-replay` → `0.4.7`
>     - deps: `highlight.run` → `9.22.4`
>   - `sdk/highlight-run` → `9.22.4`
> - bug fixes: correct webjs otel version reporting; ensure `H.stop`
stops otel exporters
> - **Changelogs/Manifest**: Update `CHANGELOG.md` entries and
`.release-please-manifest.json` to reflect versions.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4e1f559. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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