Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: '@launchdarkly/browser-telemetry Bug Report'
about: Create a report to help us improve
title: ''
labels: 'package: telemetry/browser-telemerty, bug'
assignees: ''
---

Copy link
Member Author

Choose a reason for hiding this comment

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

Below this line is standard. Above it is customized for the package.

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.

**Additional context**
Add any other context about the problem here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: '@launchdarkly/browser-telemetry Feature Request'
about: Create a report to help us improve
title: ''
labels: 'package: telemetry/browser-telemetry, feature'
assignees: ''
---

Copy link
Member Author

Choose a reason for hiding this comment

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

Below this line is standard. Above it is customized for the package.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
55 changes: 52 additions & 3 deletions packages/telemetry/browser-telemetry/README.md
Copy link
Member Author

Choose a reason for hiding this comment

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

The readme content will need updated when the 4.x SDK is released.

Also the current content is minimal, but should be enough for getting people going with metrics.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
> [!WARNING]
> This is an alpha version. The API is not stabilized and will introduce breaking changes.

TODO Add badges
[![NPM][browser-telemetry-npm-badge]][browser-telemetry-npm-link]
[![Actions Status][browser-telemetry-ci-badge]][browser-telemetry-ci]
[![Documentation][browser-telemetry-ghp-badge]][browser-telemetry-ghp-link]
[![NPM][browser-telemetry-dm-badge]][browser-telemetry-npm-link]
[![NPM][browser-telemetry-dt-badge]][browser-telemetry-npm-link]

## LaunchDarkly overview

Expand All @@ -15,11 +19,47 @@ TODO Add badges

## Compatibility

TODO
This package is compatible with the `launchdarkly-js-client-sdk` version 3.4.0 and later.

## Setup

TODO
### For error metric collection only

```
import { initialize } from "launchdarkly-js-client-sdk";
import { initTelemetry, register } from "@launchdarkly/browser-telemetry";

// Initialize the telemetry as early as possible in your application.
// Errors will be missed if they occur before the telemetry is initialized.
// For metrics only, breadcrumbs and stack traces are not required.
initTelemetry({breadcrumbs: false, stack: false});

// Initialize the LaunchDarkly client.
const client = initialize('sdk-key', context);

// Register the client with the telemetry instance.
register(client);
```

### For error monitoring + metric collection

```
import { initialize } from "launchdarkly-js-client-sdk";
import { initTelemetry, register, inspectors } from "@launchdarkly/browser-telemetry";

// Initialize the telemetry as early as possible in your application.
// Errors will be missed if they occur before the telemetry is initialized.
initTelemetry();

// Initialize the LaunchDarkly client.
const client = initialize('sdk-key', context, {
// Inspectors allows the telemetry SDK to capture feature flag information.
inspectors: inspectors(),
});

// Register the client with the telemetry instance.
register(client);
```

## Contributing

Expand All @@ -39,3 +79,12 @@ We encourage pull requests and other contributions from the community. Check out
- [docs.launchdarkly.com](https://docs.launchdarkly.com/ 'LaunchDarkly Documentation') for our documentation and SDK reference guides
- [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ 'LaunchDarkly API Documentation') for our API documentation
- [blog.launchdarkly.com](https://blog.launchdarkly.com/ 'LaunchDarkly Blog Documentation') for the latest product updates

[browser-telemetry-ci-badge]: https://github.com/launchdarkly/js-core/actions/workflows/browser-telemetry.yml/badge.svg
[browser-telemetry-ci]: https://github.com/launchdarkly/js-core/actions/workflows/browser-telemetry.yml
[browser-telemetry-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/browser-telemetry.svg?style=flat-square
[browser-telemetry-npm-link]: https://www.npmjs.com/package/@launchdarkly/browser-telemetry
[browser-telemetry-ghp-badge]: https://img.shields.io/static/v1?label=GitHub+Pages&message=API+reference&color=00add8
[browser-telemetry-ghp-link]: https://launchdarkly.github.io/js-core/packages/telemetry/browser-telemetry/docs/
[browser-telemetry-dm-badge]: https://img.shields.io/npm/dm/@launchdarkly/browser-telemetry.svg?style=flat-square
[browser-telemetry-dt-badge]: https://img.shields.io/npm/dt/@launchdarkly/browser-telemetry.svg?style=flat-square
Loading