Skip to content

Commit

Permalink
feat: implement tracing package with OpenTelemetry and Pyroscope support
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] and trajan0x committed Dec 19, 2024
1 parent 093807c commit 148105a
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 18 deletions.
31 changes: 21 additions & 10 deletions packages/tracing/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"name": "@synapsecns/tracing",
"version": "0.1.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"description": "Tracing and profiling utilities for Synapse services",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"files": ["dist"],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"test": "jest",
"lint": "eslint src --ext .ts"
"prepare": "rollup -c --bundleConfigAsCjs",
"build": "rollup -c --bundleConfigAsCjs",
"prepublish": "yarn build"
},
"dependencies": {
"@opentelemetry/api": "1.8.0",
Expand All @@ -19,9 +21,18 @@
"@pyroscope/nodejs": "^0.4.3",
"@opentelemetry/sdk-metrics": "^1.22.0"
},
"peerDependencies": {
"express": "^4.18.2"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"rollup": "^4.22.4",
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.3.3",
"@types/node": "^20.0.0",
"typescript": "^5.0.0",
"@types/jest": "^29.0.0",
"jest": "^29.0.0",
"ts-jest": "^29.0.0",
Expand Down
38 changes: 38 additions & 0 deletions packages/tracing/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import typescript from 'rollup-plugin-typescript2'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import terser from '@rollup/plugin-terser'

import packageJson from './package.json'

export default [
{
input: 'src/index.ts',
output: [
{
file: packageJson.main,
format: 'cjs',
},
{
file: packageJson.module,
format: 'esm',
},
],
plugins: [
nodeResolve({
preferBuiltins: true,
}),
commonjs(),
json(),
typescript({
tsconfig: './tsconfig.json',
declaration: true,
declarationDir: './dist/types',
useTsconfigDeclarationDir: true,
}),
terser(),
],
external: ['express', '@opentelemetry/api', '@opentelemetry/sdk-node', '@pyroscope/nodejs'],
},
]
19 changes: 11 additions & 8 deletions packages/tracing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"target": "es2018",
"module": "esnext",
"lib": ["esnext", "dom"],
"declaration": true,
"declarationDir": "dist/types",
"outDir": "dist",
"strict": true,
"esModuleInterop": true,
"allowJs": true,
"skipLibCheck": true,
"target": "ES2020",
"module": "CommonJS"
"moduleResolution": "node",
"skipLibCheck": true
},
"include": ["src/**/*"]
"include": ["src"],
"exclude": ["node_modules", "dist"]
}

0 comments on commit 148105a

Please sign in to comment.