Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up OTEL browser auto instrumentation #8706

Open
wants to merge 63 commits into
base: main
Choose a base branch
from

Conversation

ccschmitz
Copy link
Contributor

@ccschmitz ccschmitz commented May 30, 2024

Summary

Adds browser OTEL instrumentation and starts collecting it alongside the existing session data. Also enables browser OTEL instrumentation for the Highlight project.

Collecting this data straight from the browser required us to update the configuration for the OTEL collector so it could send data securely using SSL.

How did you test this change?

Use the app locally and confirm the following.

  • New click, input, submit, and scroll traces are being captured
  • Session replay still works as expected

Here is an example of a network request with span propagation working:

Screenshot 2024-06-17 at 4 58 31 PM

This only worked because I disabled processing of our X-Highlight-Header temporarily, though. I'll set up this connection in HIG-4732.

Are there any deployment considerations?

  • Ensured package size isn't bloated by introducing the new packages
  • Will confirm data is flowing as expected in prod and monitor any errors

Does this work require review from our design team?

N/A - no visual changes

Copy link

linear bot commented May 30, 2024

Copy link

changeset-bot bot commented May 30, 2024

⚠️ No Changeset found

Latest commit: 64e734e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "rrdom" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrdom-nodejs" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-player" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrweb-snapshot" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/all" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/types" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/record" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/replay" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/packer" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/rrweb-plugin-canvas-webrtc-record" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/rrweb-plugin-canvas-webrtc-replay" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/rrweb-plugin-console-record" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/rrweb-plugin-console-replay" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/rrweb-plugin-sequential-id-record" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/rrweb-plugin-sequential-id-replay" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/utils" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@rrweb/web-extension" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "rrvideo" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

sdk/firstload/src/otel.ts Fixed Show fixed Hide fixed
sdk/firstload/src/otel.ts Fixed Show fixed Hide fixed
e2e/dotnet/HighlightConfig.cs Fixed Show fixed Hide fixed
docker/collector.yml Fixed Show fixed Hide fixed
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
# Can't use '*' with credentials because it fails CORS
# validation on the preflight request.
- 'https://*'
- 'http://*'

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
sdk/client/src/otel.ts Fixed Show fixed Hide fixed
e2e/tests/src/conftest.py Fixed Show fixed Hide fixed
e2e/tests/src/test_sdk.py Fixed Show fixed Hide fixed
e2e/tests/src/test_sdk.py Fixed Show fixed Hide fixed
e2e/tests/src/test_sdk.py Fixed Show fixed Hide fixed
e2e/dotnet/Properties/launchSettings.json Fixed Show fixed Hide fixed
e2e/dotnet/Properties/launchSettings.json Fixed Show fixed Hide fixed
e2e/dotnet/Properties/launchSettings.json Fixed Show fixed Hide fixed
@@ -122,6 +122,8 @@
sessionShortcut: 'alt+1,command+`,alt+esc',
version: import.meta.env.REACT_APP_COMMIT_SHA ?? '1.0.0',
serviceName: 'frontend',
enableOtelTracing: true,
otlpEndpoint: 'https://localhost:8318',

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
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.

None yet

2 participants