Add Sentry and Baselime packages in the monitoring section
This commit introduces Sentry and Baselime packages into the monitoring section, complete with associated dependencies and scripts. These changes also reflect necessary updates to the 'pnpm-lock.yaml' file to account for these new dependencies.
This commit is contained in:
8
packages/monitoring/baselime/README.md
Normal file
8
packages/monitoring/baselime/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Baselime Monitoring / @kit/baselime
|
||||
|
||||
Please set the following environment variables:
|
||||
|
||||
```
|
||||
BASELIME_KEY=your_key
|
||||
MONITORING_INSTRUMENTATION_PROVIDER=baselime
|
||||
```
|
||||
38
packages/monitoring/baselime/package.json
Normal file
38
packages/monitoring/baselime/package.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "@kit/baselime",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .turbo node_modules",
|
||||
"format": "prettier --check \"**/*.{ts,tsx}\"",
|
||||
"lint": "eslint .",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"prettier": "@kit/prettier-config",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@baselime/node-opentelemetry": "^0.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@kit/eslint-config": "workspace:*",
|
||||
"@kit/prettier-config": "workspace:*",
|
||||
"@kit/tailwind-config": "workspace:*",
|
||||
"@kit/tsconfig": "workspace:*"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"extends": [
|
||||
"@kit/eslint-config/base",
|
||||
"@kit/eslint-config/react"
|
||||
]
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"src/*"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
33
packages/monitoring/baselime/src/index.ts
Normal file
33
packages/monitoring/baselime/src/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
BaselimeSDK,
|
||||
BetterHttpInstrumentation,
|
||||
VercelPlugin,
|
||||
} from '@baselime/node-opentelemetry';
|
||||
|
||||
const INSTRUMENTATION_SERVICE_NAME = process.env.INSTRUMENTATION_SERVICE_NAME;
|
||||
|
||||
if (!INSTRUMENTATION_SERVICE_NAME) {
|
||||
throw new Error(`
|
||||
You have set the Baselime instrumentation provider, but have not set the INSTRUMENTATION_SERVICE_NAME environment variable. Please set the INSTRUMENTATION_SERVICE_NAME environment variable.
|
||||
`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @name registerBaselimeInstrumentation
|
||||
* @description This file is used to register Baselime instrumentation for your Next.js application.
|
||||
*
|
||||
* Please set the MONITORING_INSTRUMENTATION_PROVIDER environment variable to 'baselime' to register Baselime instrumentation.
|
||||
*/
|
||||
export function registerBaselimeInstrumentation() {
|
||||
const sdk = new BaselimeSDK({
|
||||
serverless: true,
|
||||
service: INSTRUMENTATION_SERVICE_NAME,
|
||||
instrumentations: [
|
||||
new BetterHttpInstrumentation({
|
||||
plugins: [new VercelPlugin()],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
sdk.start();
|
||||
}
|
||||
8
packages/monitoring/baselime/tsconfig.json
Normal file
8
packages/monitoring/baselime/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@kit/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
|
||||
},
|
||||
"include": ["*.ts", "src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user