@nestjs/observe 0.3.17 → 0.3.19

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.
Files changed (32) hide show
  1. package/LICENSE +1 -2
  2. package/dist/agent/credentials-notice.d.ts +39 -0
  3. package/dist/agent/credentials-notice.js +68 -0
  4. package/dist/agent/detached-observe-worker.assembly.js +2 -0
  5. package/dist/agent/detached-observe-worker.d.ts +5 -0
  6. package/dist/agent/detached-observe-worker.js +3 -0
  7. package/dist/agent/observe-agent.worker.js +17 -16
  8. package/dist/cli/agent-notes.d.ts +46 -0
  9. package/dist/cli/agent-notes.js +93 -0
  10. package/dist/cli/link.js +13 -0
  11. package/dist/protocols/deferred-trace-completion.d.ts +27 -0
  12. package/dist/protocols/deferred-trace-completion.js +91 -0
  13. package/dist/protocols/graphql-observe-agent.service.d.ts +3 -3
  14. package/dist/protocols/graphql-observe-agent.service.js +10 -15
  15. package/dist/protocols/http-observe-agent.service.d.ts +2 -2
  16. package/dist/protocols/http-observe-agent.service.js +22 -19
  17. package/dist/protocols/job-trace-runner.d.ts +3 -3
  18. package/dist/protocols/job-trace-runner.js +10 -20
  19. package/dist/protocols/rpc-observe-agent.service.js +15 -29
  20. package/dist/protocols/ws-observe-agent.service.js +6 -10
  21. package/dist/services/index.d.ts +1 -0
  22. package/dist/services/index.js +1 -0
  23. package/dist/services/operation-trace.registry.d.ts +25 -3
  24. package/dist/services/operation-trace.registry.js +66 -10
  25. package/dist/services/trace-sampler.service.d.ts +1 -0
  26. package/dist/services/trace-sampler.service.js +10 -4
  27. package/dist/services/tracer.service.d.ts +2 -3
  28. package/dist/services/tracer.service.js +2 -4
  29. package/dist/types/path-value.type.d.ts +2 -2
  30. package/dist/utils/sdk-version.util.d.ts +19 -0
  31. package/dist/utils/sdk-version.util.js +34 -0
  32. package/package.json +6 -5
@@ -0,0 +1,34 @@
1
+ import { createRequire } from "module";
2
+ /**
3
+ * What `x-observe-sdk-version` carries when this package's own manifest cannot
4
+ * be read.
5
+ */
6
+ export const UNKNOWN_SDK_VERSION = "unknown";
7
+ /**
8
+ * This package's own version, as its installed `package.json` states it.
9
+ *
10
+ * Sent with every batch so the collector knows which agent an application
11
+ * runs - nothing else tells it, and a project scaffolded with `^0.1.8` keeps
12
+ * installing 0.1.x for as long as nobody edits that range.
13
+ *
14
+ * Resolved by the package's name rather than a relative path, and checked by
15
+ * name: a bundle that moved this file would otherwise read the application's
16
+ * own manifest and report its version instead. A bundle that erased
17
+ * `import.meta.url`, or one shipped without `node_modules`, gets
18
+ * {@link UNKNOWN_SDK_VERSION} - never an exception at start-up.
19
+ */
20
+ export function readSdkVersion() {
21
+ try {
22
+ const require = createRequire(import.meta.url);
23
+ const manifest = require("@nestjs/observe/package.json");
24
+ if (manifest.name === "@nestjs/observe" &&
25
+ typeof manifest.version === "string" &&
26
+ manifest.version.length > 0) {
27
+ return manifest.version;
28
+ }
29
+ }
30
+ catch {
31
+ // Falls through to the placeholder below.
32
+ }
33
+ return UNKNOWN_SDK_VERSION;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/observe",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "Observability and APM agent for NestJS - traces, runtime metrics and custom metrics",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://observe.nestjs.com",
@@ -121,14 +121,14 @@
121
121
  "devDependencies": {
122
122
  "@apollo/server": "5.5.1",
123
123
  "@as-integrations/express5": "1.1.2",
124
- "@commitlint/cli": "21.2.3",
125
- "@commitlint/config-angular": "21.2.3",
124
+ "@commitlint/cli": "21.2.4",
125
+ "@commitlint/config-angular": "21.2.4",
126
126
  "@grpc/grpc-js": "1.14.6",
127
127
  "@grpc/proto-loader": "0.8.1",
128
128
  "@mikro-orm/core": "7.2.0",
129
129
  "@mikro-orm/mysql": "7.2.0",
130
130
  "@mikro-orm/postgresql": "7.2.0",
131
- "@nestjs/apollo": "14.0.0",
131
+ "@nestjs/apollo": "14.1.1",
132
132
  "@nestjs/bull": "12.0.0",
133
133
  "@nestjs/bullmq": "12.0.0",
134
134
  "@nestjs/common": "12.0.1",
@@ -137,6 +137,7 @@
137
137
  "@nestjs/microservices": "12.0.1",
138
138
  "@nestjs/platform-express": "12.0.1",
139
139
  "@nestjs/platform-fastify": "12.0.3",
140
+ "@nestjs/platform-node": "12.3.2",
140
141
  "@nestjs/platform-socket.io": "12.0.3",
141
142
  "@nestjs/platform-ws": "12.0.3",
142
143
  "@nestjs/schedule": "12.0.1",
@@ -159,7 +160,7 @@
159
160
  "lint-staged": "17.6.0",
160
161
  "mongodb": "7.6.0",
161
162
  "mongoose": "9.10.1",
162
- "mssql": "12.7.9",
163
+ "mssql": "12.7.11",
163
164
  "mysql2": "3.24.6",
164
165
  "nestjs-cls": "6.2.1",
165
166
  "oxlint": "1.79.0",