Skip to content

Commit 9973bb6

Browse files
committed
chore: Add browser-telemetry to release please.
1 parent 1ff96ce commit 9973bb6

File tree

11 files changed

+43
-12
lines changed

11 files changed

+43
-12
lines changed

.github/workflows/manual-publish-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- packages/telemetry/node-server-sdk-otel
2222
- packages/sdk/browser
2323
- packages/sdk/server-ai
24+
- packages/telemetry/browser-telemetry
2425
name: Publish Documentation
2526
jobs:
2627
build-publish:

.github/workflows/manual-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ on:
3434
- packages/tooling/jest
3535
- packages/sdk/browser
3636
- packages/sdk/server-ai
37+
- packages/telemetry/browser-telemetry
3738
prerelease:
3839
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
3940
type: boolean

.github/workflows/release-please.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
package-react-universal-release: ${{ steps.release.outputs['packages/sdk/react-universal--release_created'] }}
2727
package-browser-released: ${{ steps.release.outputs['packages/sdk/browser--release_created'] }}
2828
package-server-ai-released: ${{ steps.release.outputs['packages/sdk/server-ai--release_created'] }}
29+
package-browser-telemetry-released: ${{ steps.release.outputs['packages/telemetry/browser-telemetry--release_created'] }}
2930
steps:
3031
- uses: googleapis/release-please-action@v4
3132
id: release
@@ -398,3 +399,23 @@ jobs:
398399
with:
399400
workspace_path: packages/sdk/server-ai
400401
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
402+
403+
release-browser-telemetry:
404+
runs-on: ubuntu-latest
405+
needs: ['release-please', 'release-browser']
406+
permissions:
407+
id-token: write
408+
contents: write
409+
if: ${{ always() && !failure() && !cancelled() && needs.release-please.outputs.package-browser-telemetry-released == 'true' }}
410+
steps:
411+
- uses: actions/checkout@v4
412+
- uses: actions/setup-node@v4
413+
with:
414+
node-version: 20.x
415+
registry-url: 'https://registry.npmjs.org'
416+
- id: release-browser-telemetry
417+
name: Full release of packages/telemetry/browser-telemetry
418+
uses: ./actions/full-release
419+
with:
420+
workspace_path: packages/telemetry/browser-telemetry
421+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}

.release-please-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"packages/sdk/react-native": "10.9.4",
1515
"packages/telemetry/node-server-sdk-otel": "1.1.3",
1616
"packages/sdk/browser": "0.4.0",
17-
"packages/sdk/server-ai": "0.7.1"
17+
"packages/sdk/server-ai": "0.7.1",
18+
"packages/telemetry/browser-telemetry": "0.0.9"
1819
}

packages/telemetry/browser-telemetry/src/api/Breadcrumb.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface Breadcrumb {
6868
/**
6969
* Utility type which allows for easy extension of base breadcrumb type.
7070
*/
71-
type ImplementsCrumb<U extends Breadcrumb> = U;
71+
export type ImplementsCrumb<U extends Breadcrumb> = U;
7272

7373
/**
7474
* Type for custom breadcrumbs.

packages/telemetry/browser-telemetry/src/api/Options.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ export interface Options {
212212
*
213213
* Can be used to redact or modify error data.
214214
*
215-
* For filtering breadcrumbs or URLs in error data, see {@link breadcrumbs.filters} and
216-
* {@link breadcrumbs.http.customUrlFilter}.
215+
* If any filter throws an exception, then the error data will be discarded.
216+
*
217+
* For filtering breadcrumbs or URLs in error data, refer to the `breadcrumbs.filters` option in {@link breadcrumbs} and
218+
* `breadcrumbs.http.customUrlFilter` - {@link HttpBreadcrumbOptions.customUrlFilter}.
217219
*/
218220
errorFilters?: ErrorDataFilter[];
219221
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './LDClientTracking';
22
export * from './LDClientLogging';
3+
export * from './BrowserTelemetryInspector';

packages/telemetry/browser-telemetry/src/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export * from './Recorder';
66
export * from './stack';
77
export * from './client';
88
export * from './MinLogger';
9+
export * from './BrowserTelemetry';

packages/telemetry/browser-telemetry/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ export * from './singleton';
1111
/**
1212
* Initialize a new telemetry instance.
1313
*
14-
* This instance is not global. Generally developers should use {@link initializeTelemetry} instead.
14+
* This instance is not global. Generally developers should use {@link initTelemetry} instead.
1515
*
1616
* If for some reason multiple telemetry instances are needed, this method can be used to create a new instance.
1717
* Instances are not aware of each other and may send duplicate data from automatically captured events.
1818
*
1919
* @param options The options to use for the telemetry instance.
2020
* @returns A telemetry instance.
2121
*/
22-
export function initializeTelemetryInstance(options?: Options): BrowserTelemetry {
22+
export function initTelemetryInstance(options?: Options): BrowserTelemetry {
2323
const parsedOptions = parse(options || {}, safeMinLogger(options?.logger));
2424
return new BrowserTelemetryImpl(parsedOptions);
2525
}

packages/telemetry/browser-telemetry/src/singleton/singletonMethods.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getTelemetryInstance } from './singletonInstance';
77
* Returns an array of active SDK inspectors to use with SDK versions that do
88
* not support hooks.
99
*
10-
* Telemetry must be initialized, using {@link initializeTelemetry} before calling this method.
10+
* Telemetry must be initialized, using {@link initTelemetry} before calling this method.
1111
* If telemetry is not initialized, this method will return an empty array.
1212
*
1313
* @returns An array of {@link BrowserTelemetryInspector} objects.
@@ -23,7 +23,7 @@ export function inspectors(): BrowserTelemetryInspector[] {
2323
* Unhandled errors are automatically captured, but this method can be used
2424
* to capture errors which were handled, but are still useful for telemetry.
2525
*
26-
* Telemetry must be initialized, using {@link initializeTelemetry} before calling this method.
26+
* Telemetry must be initialized, using {@link initTelemetry} before calling this method.
2727
* If telemetry is not initialized, then the exception will be discarded.
2828
*
2929
* @param exception The Error object to capture
@@ -41,7 +41,7 @@ export function captureError(exception: Error): void {
4141
*
4242
* For most errors {@link captureError} should be used.
4343
*
44-
* Telemetry must be initialized, using {@link initializeTelemetry} before calling this method.
44+
* Telemetry must be initialized, using {@link initTelemetry} before calling this method.
4545
* If telemetry is not initialized, then the error event will be discarded.
4646
*
4747
* @param errorEvent The ErrorEvent to capture
@@ -57,7 +57,7 @@ export function captureErrorEvent(errorEvent: ErrorEvent): void {
5757
* used for capturing manual breadcrumbs. For application specific breadcrumbs
5858
* the {@link CustomBreadcrumb} type can be used.
5959
*
60-
* Telemetry must be initialized, using {@link initializeTelemetry} before calling this method.
60+
* Telemetry must be initialized, using {@link initTelemetry} before calling this method.
6161
* If telemetry is not initialized, then the breadcrumb will be discarded.
6262
*
6363
* @param breadcrumb The breadcrumb to add.
@@ -73,7 +73,7 @@ export function addBreadcrumb(breadcrumb: Breadcrumb): void {
7373
* client instance. The client instance will be used to report telemetry
7474
* to LaunchDarkly and also for collecting flag and context data.
7575
*
76-
* Telemetry must be initialized, using {@link initializeTelemetry} before calling this method.
76+
* Telemetry must be initialized, using {@link initTelemetry} before calling this method.
7777
* If telemetry is not initialized, then the client will not be registered, and no events will be sent to LaunchDarkly.
7878
*
7979
* @param client The {@link LDClientTracking} instance to register for
@@ -90,7 +90,7 @@ export function register(client: LDClientTracking): void {
9090
* where collection needs to be stopped independent of application
9191
* lifecycle.
9292
*
93-
* If telemetry is not initialized, using {@link initializeTelemetry}, then this method will do nothing.
93+
* If telemetry is not initialized, using {@link initTelemetry}, then this method will do nothing.
9494
*/
9595
export function close(): void {
9696
getTelemetryInstance()?.close();

0 commit comments

Comments
 (0)