Skip to content

Commit 580a877

Browse files
committed
fix imports
1 parent 89b48a7 commit 580a877

File tree

10 files changed

+54
-42
lines changed

10 files changed

+54
-42
lines changed

experimental/instrumentation-otel-axios/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
SEMATTRS_HTTP_URL,
1111
SEMATTRS_HTTP_USER_AGENT,
1212
} from '@opentelemetry/semantic-conventions';
13-
import { Axios, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
13+
import { Axios, type AxiosInstance, type AxiosRequestConfig, type AxiosResponse } from 'axios';
1414

1515
import { AttributeNames } from './constants';
1616
import type { AxiosInstrumentationOptions } from './types';

packages/react-native-sdk/src/instrumentations/errors/registerOnunhandledrejection.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { ExceptionStackFrame, isPrimitive } from '@grafana/faro-core';
2-
import type { API } from '@grafana/faro-core';
1+
import { type API, type ExceptionStackFrame, isPrimitive } from '@grafana/faro-core';
32

43
import { primitiveUnhandledType, primitiveUnhandledValue } from './const';
54
import { getErrorDetails } from './getErrorDetails';

packages/react-native-sdk/src/instrumentations/session/instrumentation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {
22
BaseInstrumentation,
3+
type Config,
34
dateNow,
45
EVENT_SESSION_EXTEND,
56
EVENT_SESSION_RESUME,
67
EVENT_SESSION_START,
7-
Meta,
8-
MetaSession,
8+
type Meta,
9+
type MetaSession,
910
VERSION,
1011
} from '@grafana/faro-core';
11-
import type { Config } from '@grafana/faro-core';
1212

1313
import type { TransportItem } from '../..';
1414
import { createSession } from '../../metas';

packages/react-native-sdk/src/instrumentations/view/instrumentation.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { BaseInstrumentation, EVENT_VIEW_CHANGED, Meta, MetaView, unknownString, VERSION } from '@grafana/faro-core';
1+
import {
2+
BaseInstrumentation,
3+
EVENT_VIEW_CHANGED,
4+
type Meta,
5+
type MetaView,
6+
unknownString,
7+
VERSION,
8+
} from '@grafana/faro-core';
29

310
// all this does is send VIEW_CHANGED event
411
export class ViewInstrumentation extends BaseInstrumentation {

packages/react-native-sdk/src/metas/browser/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Dimensions, Platform } from 'react-native';
33
import { getBrand, getModel, getSystemVersion } from 'react-native-device-info';
44

5-
import { Meta, MetaItem } from '@grafana/faro-core';
5+
import type { Meta, MetaItem } from '@grafana/faro-core';
66

77
const { width, height } = Dimensions.get('window');
88

packages/react-native-sdk/src/transports/fetch/transport.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import {
22
BaseExtension,
33
BaseTransport,
4+
type Config,
45
createPromiseBuffer,
56
getTransportBody,
67
noop,
7-
PromiseBuffer,
8+
type Patterns,
9+
type PromiseBuffer,
10+
type TransportItem,
811
VERSION,
912
} from '@grafana/faro-core';
10-
import type { Config, Patterns, TransportItem } from '@grafana/faro-core';
1113

1214
import { getSessionManagerByConfig } from '../../instrumentations/session/sessionManager';
1315
import { getUserSessionUpdater } from '../../instrumentations/session/sessionManager/sessionManagerUtils';

packages/react-native-tracing/src/faroTraceExporter.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { SpanContext } from '@opentelemetry/api';
2-
import { ESpanKind, IResourceSpans } from '@opentelemetry/otlp-transformer';
2+
import { ESpanKind, type IResourceSpans } from '@opentelemetry/otlp-transformer';
33

44
import { faro, unknownString } from '@grafana/faro-core';
55
import type { EventAttributes as FaroEventAttributes } from '@grafana/react-native-sdk';

packages/react-native-tracing/src/instrumentation.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import {context, trace} from '@opentelemetry/api';
2-
import {W3CTraceContextPropagator} from '@opentelemetry/core';
3-
import {registerInstrumentations} from '@opentelemetry/instrumentation';
4-
import {Resource, ResourceAttributes} from '@opentelemetry/resources';
5-
import {BatchSpanProcessor, WebTracerProvider} from '@opentelemetry/sdk-trace-web';
6-
import {ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION,} from '@opentelemetry/semantic-conventions';
1+
import { context, trace } from '@opentelemetry/api';
2+
import { W3CTraceContextPropagator } from '@opentelemetry/core';
3+
import { registerInstrumentations } from '@opentelemetry/instrumentation';
4+
import { Resource, type ResourceAttributes } from '@opentelemetry/resources';
5+
import { BatchSpanProcessor, WebTracerProvider } from '@opentelemetry/sdk-trace-web';
6+
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
77

8+
import { BaseInstrumentation, type Transport, VERSION } from '@grafana/react-native-sdk';
89

9-
import {BaseInstrumentation, Transport, VERSION} from '@grafana/react-native-sdk';
10-
11-
import {FaroTraceExporter} from './faroTraceExporter';
12-
import {getDefaultOTELInstrumentations} from './getDefaultOTELInstrumentations';
13-
import {getSamplingDecision} from './sampler';
14-
import {FaroSessionSpanProcessor} from './sessionSpanProcessor';
15-
import type {TracingInstrumentationOptions} from './types';
10+
import { FaroTraceExporter } from './faroTraceExporter';
11+
import { getDefaultOTELInstrumentations } from './getDefaultOTELInstrumentations';
12+
import { getSamplingDecision } from './sampler';
13+
import { FaroSessionSpanProcessor } from './sessionSpanProcessor';
14+
import type { TracingInstrumentationOptions } from './types';
1615

1716
// the providing of app name here is not great
1817
// should delay initialization and provide the full Faro config,
@@ -36,7 +35,6 @@ export class TracingInstrumentation extends BaseInstrumentation {
3635
attributes[ATTR_SERVICE_NAME] = this.config.app.name;
3736
}
3837

39-
4038
if (this.config.app.version) {
4139
attributes[ATTR_SERVICE_VERSION] = this.config.app.version;
4240
}
@@ -57,13 +55,13 @@ export class TracingInstrumentation extends BaseInstrumentation {
5755
});
5856

5957
provider.addSpanProcessor(
60-
options.spanProcessor ??
58+
options.spanProcessor ??
6159
new FaroSessionSpanProcessor(
62-
new BatchSpanProcessor(new FaroTraceExporter({ api: this.api }), {
63-
scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,
64-
maxExportBatchSize: 30,
65-
}),
66-
this.metas
60+
new BatchSpanProcessor(new FaroTraceExporter({ api: this.api }), {
61+
scheduledDelayMillis: TracingInstrumentation.SCHEDULED_BATCH_DELAY_MS,
62+
maxExportBatchSize: 30,
63+
}),
64+
this.metas
6765
)
6866
);
6967

@@ -73,17 +71,17 @@ export class TracingInstrumentation extends BaseInstrumentation {
7371
});
7472

7573
const { propagateTraceHeaderCorsUrls, fetchInstrumentationOptions, xhrInstrumentationOptions } =
76-
this.options.instrumentationOptions ?? {};
74+
this.options.instrumentationOptions ?? {};
7775

7876
registerInstrumentations({
7977
instrumentations:
80-
options.instrumentations ??
81-
getDefaultOTELInstrumentations({
82-
ignoreUrls: this.getIgnoreUrls(),
83-
propagateTraceHeaderCorsUrls,
84-
fetchInstrumentationOptions,
85-
xhrInstrumentationOptions,
86-
}),
78+
options.instrumentations ??
79+
getDefaultOTELInstrumentations({
80+
ignoreUrls: this.getIgnoreUrls(),
81+
propagateTraceHeaderCorsUrls,
82+
fetchInstrumentationOptions,
83+
xhrInstrumentationOptions,
84+
}),
8785
});
8886
this.api.initOTEL(trace, context);
8987
}

packages/react-native-tracing/src/instrumentationUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Span, SpanStatusCode } from '@opentelemetry/api';
1+
import { type Span, SpanStatusCode } from '@opentelemetry/api';
22
import type { FetchCustomAttributeFunction } from '@opentelemetry/instrumentation-fetch';
33
import type { XHRCustomAttributeFunction } from '@opentelemetry/instrumentation-xml-http-request';
44

packages/react-native-tracing/src/react-navigation/handlers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import { SpanStatusCode, Tracer } from '@opentelemetry/api';
1+
import { SpanStatusCode, type Tracer } from '@opentelemetry/api';
22

33
import { EVENT_ROUTE_CHANGE } from '@grafana/faro-core';
44

55
import { api, internalLogger } from './dependencies';
6-
import { NavigationContainer, NavigationState, ROUTE_CHANGE_TIMEOUT_MS, SPAN_ATTRIBUTES, SPAN_NAME } from './types';
6+
import {
7+
type NavigationContainer,
8+
type NavigationState,
9+
ROUTE_CHANGE_TIMEOUT_MS,
10+
SPAN_ATTRIBUTES,
11+
SPAN_NAME,
12+
} from './types';
713

814
/**
915
* Cleans up the navigation state and marks the span as failed.

0 commit comments

Comments
 (0)