@echoteam/signoz-react 1.0.0
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/LICENSE +21 -0
- package/README.md +285 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.esm.js +34185 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +34210 -0
- package/dist/index.js.map +1 -0
- package/dist/types/error/ErrorBoundary.d.ts +23 -0
- package/dist/types/error/ErrorPage.d.ts +17 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/tracing.d.ts +23 -0
- package/package.json +90 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ErrorFallbackProps {
|
|
3
|
+
error: Error;
|
|
4
|
+
resetErrorBoundary: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface ErrorBoundaryProps {
|
|
7
|
+
/** React children */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Custom fallback component */
|
|
10
|
+
fallback?: React.ComponentType<ErrorFallbackProps>;
|
|
11
|
+
/** Custom error handler function */
|
|
12
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
13
|
+
/** Custom reset handler */
|
|
14
|
+
onReset?: () => void;
|
|
15
|
+
/** Apakah menampilkan reset button (default: true) */
|
|
16
|
+
showResetButton?: boolean;
|
|
17
|
+
/** Custom reset button text */
|
|
18
|
+
resetButtonText?: string;
|
|
19
|
+
/** Custom CSS class untuk fallback */
|
|
20
|
+
fallbackClassName?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const ErrorBoundary: React.FC<ErrorBoundaryProps>;
|
|
23
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ErrorPageProps {
|
|
3
|
+
/** Judul halaman error (default: "Oops!") */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Pesan error utama (default: "Terjadi kesalahan yang tidak terduga.") */
|
|
6
|
+
message?: string;
|
|
7
|
+
/** Custom render function untuk menampilkan error */
|
|
8
|
+
renderError?: (error: Error) => React.ReactNode;
|
|
9
|
+
/** Custom CSS class untuk container */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Apakah menampilkan stack trace (default: false) */
|
|
12
|
+
showStackTrace?: boolean;
|
|
13
|
+
/** Custom action button */
|
|
14
|
+
actionButton?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare const ErrorPage: React.FC<ErrorPageProps>;
|
|
17
|
+
export default ErrorPage;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface SignOzConfig {
|
|
2
|
+
serviceName: string;
|
|
3
|
+
serviceVersion: string;
|
|
4
|
+
environment: string;
|
|
5
|
+
serviceNamespace: string;
|
|
6
|
+
url: string;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
REACT_APP_SIGNOZ_SERVICE_NAME: string;
|
|
12
|
+
REACT_APP_SIGNOZ_SERVICE_VERSION: string;
|
|
13
|
+
REACT_APP_SIGNOZ_ENV: string;
|
|
14
|
+
REACT_APP_SIGNOZ_SERVICE_NAMESPACE: string;
|
|
15
|
+
REACT_APP_SIGNOZ_URL: string;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Inisialisasi SignOz tracing untuk aplikasi React
|
|
20
|
+
* @param config - Konfigurasi SignOz (opsional, akan menggunakan environment variables jika tidak disediakan)
|
|
21
|
+
*/
|
|
22
|
+
export declare function initializeSignOzTracing(config?: SignOzConfig): void;
|
|
23
|
+
export default initializeSignOzTracing;
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@echoteam/signoz-react",
|
|
3
|
+
"private": false,
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"version": "1.0.0",
|
|
8
|
+
"description": "SignOz React JS - Library untuk monitoring dan tracing aplikasi React menggunakan OpenTelemetry dan SignOz",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.esm.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "rollup -c",
|
|
19
|
+
"dev": "rollup -c -w",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
22
|
+
"test": "jest",
|
|
23
|
+
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
|
|
24
|
+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\""
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"signoz",
|
|
28
|
+
"react",
|
|
29
|
+
"opentelemetry",
|
|
30
|
+
"monitoring",
|
|
31
|
+
"tracing",
|
|
32
|
+
"observability",
|
|
33
|
+
"apm",
|
|
34
|
+
"javascript",
|
|
35
|
+
"typescript"
|
|
36
|
+
],
|
|
37
|
+
"author": "CODR Team",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://gitlab.echoteam.tech/codr/package/signoz-react-js.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://gitlab.echoteam.tech/codr/package/signoz-react-js/-/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://gitlab.echoteam.tech/codr/package/signoz-react-js",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": ">=16.8.0",
|
|
49
|
+
"react-dom": ">=16.8.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@opentelemetry/api": "^1.7.0",
|
|
53
|
+
"@opentelemetry/auto-instrumentations-web": "^0.40.0",
|
|
54
|
+
"@opentelemetry/context-zone": "^1.21.0",
|
|
55
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.48.0",
|
|
56
|
+
"@opentelemetry/instrumentation": "^0.48.0",
|
|
57
|
+
"@opentelemetry/resources": "^1.21.0",
|
|
58
|
+
"@opentelemetry/sdk-trace-base": "^1.21.0",
|
|
59
|
+
"@opentelemetry/sdk-trace-web": "^1.21.0",
|
|
60
|
+
"react-error-boundary": "^4.0.11"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@babel/core": "^7.23.0",
|
|
64
|
+
"@babel/preset-env": "^7.23.0",
|
|
65
|
+
"@babel/preset-react": "^7.22.0",
|
|
66
|
+
"@babel/preset-typescript": "^7.23.0",
|
|
67
|
+
"@rollup/plugin-babel": "^6.0.0",
|
|
68
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
69
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
70
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
71
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
72
|
+
"@types/react": "^18.2.0",
|
|
73
|
+
"@types/react-dom": "^18.2.0",
|
|
74
|
+
"@types/react-router-dom": "^5.3.3",
|
|
75
|
+
"eslint": "^8.50.0",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"prettier": "^3.0.0",
|
|
78
|
+
"react-router-dom": "^7.6.2",
|
|
79
|
+
"rimraf": "^5.0.0",
|
|
80
|
+
"rollup": "^4.0.0",
|
|
81
|
+
"rollup-plugin-dts": "^6.0.0",
|
|
82
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
83
|
+
"tslib": "^2.8.1",
|
|
84
|
+
"typescript": "^5.2.0"
|
|
85
|
+
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">=14.0.0",
|
|
88
|
+
"npm": ">=6.0.0"
|
|
89
|
+
}
|
|
90
|
+
}
|