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

Browser detector module #3292

Merged
merged 20 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm install --save @opentelemetry/opentelemetry-browser-detector

```js
import { Resource, detectResources } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
//...
import { browserDetector } from '@opentelemetry/opentelemetry-browser-detector';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,32 @@ describeBrowser('browserDetector()', () => {
language:'en-US',
userAgentData:{
platform:'platform',
brands:['brand1'],
brands:[
{
brand: 'Chromium',
version: '106'
},
{
brand: 'Google Chrome',
version: '106'
},
{
brand: 'Not;A=Brand',
version: '99'
}
],
mobile:false
}
});

const resource: Resource = await browserDetector.detect();
assertResource(resource, {
platform: 'platform',
brands: ['brand1'],
brands: [
MSNev marked this conversation as resolved.
Show resolved Hide resolved
'Chromium 106',
'Google Chrome 106',
'Not;A=Brand 99'
],
mobile: false,
language: 'en-US',
user_agent: 'dddd'
Expand Down