Skip to content

Commit fc265b5

Browse files
update examples for setting up resource attributes in JS (#7252)
Co-authored-by: Juliano Costa <[email protected]>
1 parent c1e218d commit fc265b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en/docs/demo/services/react-native-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
5050
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
5151
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
5252
import { registerInstrumentations } from '@opentelemetry/instrumentation';
53-
import { Resource } from '@opentelemetry/resources';
53+
import { resourceFromAttributes } from '@opentelemetry/resources';
5454
import {
5555
ATTR_DEVICE_ID,
5656
ATTR_OS_NAME,
@@ -72,7 +72,7 @@ import { SessionIdProcessor } from '@/utils/SessionIdProcessor';
7272
const Tracer = async () => {
7373
const localhost = await getLocalhost();
7474

75-
const resource = new Resource({
75+
const resource = resourceFromAttributes({
7676
[ATTR_SERVICE_NAME]: 'react-native-app',
7777
[ATTR_OS_NAME]: Platform.OS,
7878
[ATTR_OS_VERSION]: getSystemVersion(),

0 commit comments

Comments
 (0)