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
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ All notable changes to experimental packages in this project will be documented

* refactor(exporter-prometheus): replace `MetricAttributes` and `MetricAttributeValues` with `Attributes` and `AttributeValues` [#4993](https://github.com/open-telemetry/opentelemetry-js/pull/4993)

* refactor(browser-detector): replace `ResourceAttributes` with `Attributes` [#5004](https://github.com/open-telemetry/opentelemetry-js/pull/5004)

## 0.53.0

### :boom: Breaking Change
Expand Down
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