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

refactor(browser-detector): replace ResourceAtrributes with Attributes #5004

Merged
Changes from 1 commit
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
Expand Up @@ -14,14 +14,13 @@
* limitations under the License.
*/

import { diag } from '@opentelemetry/api';
import { Attributes, diag } from '@opentelemetry/api';
import {
Detector,
IResource,
Resource,
ResourceDetectionConfig,
} from '@opentelemetry/resources';
import { ResourceAttributes } from '@opentelemetry/resources';
import { BROWSER_ATTRIBUTES, UserAgentData } from './types';

/**
Expand All @@ -33,7 +32,7 @@ class BrowserDetector implements Detector {
if (!isBrowser) {
return Resource.empty();
}
const browserResource: ResourceAttributes = getBrowserAttributes();
const browserResource: Attributes = getBrowserAttributes();
return this._getResourceAttributes(browserResource, config);
}
/**
Expand All @@ -44,7 +43,7 @@ class BrowserDetector implements Detector {
* @returns The sanitized resource attributes.
*/
private _getResourceAttributes(
browserResource: ResourceAttributes,
browserResource: Attributes,
_config?: ResourceDetectionConfig
) {
if (
Expand All @@ -62,8 +61,8 @@ class BrowserDetector implements Detector {
}

// Add Browser related attributes to resources
function getBrowserAttributes(): ResourceAttributes {
const browserAttribs: ResourceAttributes = {};
function getBrowserAttributes(): Attributes {
const browserAttribs: Attributes = {};
const userAgentData: UserAgentData | undefined = (navigator as any)
.userAgentData;
if (userAgentData) {
Expand Down
Loading