@akinon/next 1.82.0-rc.7 → 1.82.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/components/client-root.tsx +20 -0
- package/instrumentation/node.ts +15 -13
- package/package.json +2 -2
- package/sentry/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.82.0-rc.9
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9abd011: ZERO-3267: Refactor error handling in ErrorPage component to set error details in Sentry scope
|
|
8
|
+
|
|
9
|
+
## 1.82.0-rc.8
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 17bfadc: ZERO-3275: Disable OpenTelemetry monitoring in production environment
|
|
14
|
+
|
|
3
15
|
## 1.82.0-rc.7
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useMobileIframeHandler } from '../hooks';
|
|
4
|
+
import * as Sentry from '@sentry/nextjs';
|
|
5
|
+
import { initSentry } from '../sentry';
|
|
6
|
+
import { useEffect } from 'react';
|
|
4
7
|
|
|
5
8
|
export default function ClientRoot({
|
|
6
9
|
children,
|
|
@@ -11,6 +14,23 @@ export default function ClientRoot({
|
|
|
11
14
|
}) {
|
|
12
15
|
const { preventPageRender } = useMobileIframeHandler({ sessionId });
|
|
13
16
|
|
|
17
|
+
const initializeSentry = async () => {
|
|
18
|
+
const response = await fetch('/api/sentry', { next: { revalidate: 0 } });
|
|
19
|
+
const data = await response.json();
|
|
20
|
+
|
|
21
|
+
const options = {
|
|
22
|
+
dsn: data.dsn
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
initSentry('Client', options);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!Sentry.isInitialized()) {
|
|
30
|
+
initializeSentry();
|
|
31
|
+
}
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
14
34
|
if (preventPageRender) {
|
|
15
35
|
return null;
|
|
16
36
|
}
|
package/instrumentation/node.ts
CHANGED
|
@@ -4,17 +4,19 @@ import { Resource } from '@opentelemetry/resources';
|
|
|
4
4
|
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
|
|
5
5
|
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-node';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
new
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
if (process.env.NODE_ENV === 'development') {
|
|
8
|
+
const sdk = new NodeSDK({
|
|
9
|
+
resource: new Resource({
|
|
10
|
+
[SemanticResourceAttributes.SERVICE_NAME]: 'pz-next-app'
|
|
11
|
+
}),
|
|
12
|
+
spanProcessor: new SimpleSpanProcessor(
|
|
13
|
+
new OTLPTraceExporter({
|
|
14
|
+
url: `${
|
|
15
|
+
process.env.PZ_DASHBOARD_URL ?? 'http://localhost:3005'
|
|
16
|
+
}/api/traces`
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
});
|
|
19
20
|
|
|
20
|
-
sdk.start();
|
|
21
|
+
sdk.start();
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.82.0-rc.
|
|
4
|
+
"version": "1.82.0-rc.9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"set-cookie-parser": "2.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@akinon/eslint-plugin-projectzero": "1.82.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.82.0-rc.9",
|
|
34
34
|
"@types/react-redux": "7.1.30",
|
|
35
35
|
"@types/set-cookie-parser": "2.4.7",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|