@exulu/backend 1.48.2 → 1.49.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.
Files changed (164) hide show
  1. package/dist/index.cjs +351 -42
  2. package/dist/index.d.cts +96 -1
  3. package/dist/index.d.ts +96 -1
  4. package/dist/index.js +340 -38
  5. package/ee/{markdown.ts → chunking/markdown.ts} +2 -2
  6. package/ee/python/README.md +295 -0
  7. package/ee/python/documents/processing/README.md +155 -0
  8. package/ee/{documents → python/documents}/processing/doc_processor.ts +25 -17
  9. package/ee/{documents/processing/pdf_to_markdown.py → python/documents/processing/document_to_markdown.py} +3 -10
  10. package/ee/python/setup.sh +180 -0
  11. package/package.json +14 -3
  12. package/scripts/postinstall.cjs +149 -0
  13. package/.agents/skills/mintlify/SKILL.md +0 -347
  14. package/.editorconfig +0 -15
  15. package/.eslintrc.json +0 -52
  16. package/.github/workflows/release-backend.yml +0 -38
  17. package/.husky/commit-msg +0 -1
  18. package/.jscpd.json +0 -18
  19. package/.mcp.json +0 -25
  20. package/.nvmrc +0 -1
  21. package/.prettierignore +0 -5
  22. package/.prettierrc.json +0 -12
  23. package/CHANGELOG.md +0 -8
  24. package/SECURITY.md +0 -5
  25. package/commitlint.config.js +0 -4
  26. package/devops/documentation/patch-older-releases.md +0 -42
  27. package/ee/documents/processing/build_pdf_processor.sh +0 -35
  28. package/ee/documents/processing/chunk_markdown.py +0 -263
  29. package/ee/documents/processing/pdf_processor.spec +0 -115
  30. package/eslint.config.js +0 -88
  31. package/jest.config.ts +0 -25
  32. package/mintlify-docs/.mintignore +0 -7
  33. package/mintlify-docs/AGENTS.md +0 -33
  34. package/mintlify-docs/CLAUDE.MD +0 -50
  35. package/mintlify-docs/CONTRIBUTING.md +0 -32
  36. package/mintlify-docs/LICENSE +0 -21
  37. package/mintlify-docs/README.md +0 -55
  38. package/mintlify-docs/ai-tools/claude-code.mdx +0 -43
  39. package/mintlify-docs/ai-tools/cursor.mdx +0 -39
  40. package/mintlify-docs/ai-tools/windsurf.mdx +0 -39
  41. package/mintlify-docs/api-reference/core-types/agent-types.mdx +0 -110
  42. package/mintlify-docs/api-reference/core-types/analytics-types.mdx +0 -95
  43. package/mintlify-docs/api-reference/core-types/configuration-types.mdx +0 -83
  44. package/mintlify-docs/api-reference/core-types/evaluation-types.mdx +0 -106
  45. package/mintlify-docs/api-reference/core-types/job-types.mdx +0 -135
  46. package/mintlify-docs/api-reference/core-types/overview.mdx +0 -73
  47. package/mintlify-docs/api-reference/core-types/prompt-types.mdx +0 -102
  48. package/mintlify-docs/api-reference/core-types/rbac-types.mdx +0 -163
  49. package/mintlify-docs/api-reference/core-types/session-types.mdx +0 -77
  50. package/mintlify-docs/api-reference/core-types/user-management.mdx +0 -112
  51. package/mintlify-docs/api-reference/core-types/workflow-types.mdx +0 -88
  52. package/mintlify-docs/api-reference/core-types.mdx +0 -585
  53. package/mintlify-docs/api-reference/dynamic-types.mdx +0 -851
  54. package/mintlify-docs/api-reference/endpoint/create.mdx +0 -4
  55. package/mintlify-docs/api-reference/endpoint/delete.mdx +0 -4
  56. package/mintlify-docs/api-reference/endpoint/get.mdx +0 -4
  57. package/mintlify-docs/api-reference/endpoint/webhook.mdx +0 -4
  58. package/mintlify-docs/api-reference/introduction.mdx +0 -661
  59. package/mintlify-docs/api-reference/mutations.mdx +0 -1012
  60. package/mintlify-docs/api-reference/openapi.json +0 -217
  61. package/mintlify-docs/api-reference/queries.mdx +0 -1154
  62. package/mintlify-docs/backend/introduction.mdx +0 -218
  63. package/mintlify-docs/changelog.mdx +0 -387
  64. package/mintlify-docs/community-edition.mdx +0 -304
  65. package/mintlify-docs/core/exulu-agent/api-reference.mdx +0 -894
  66. package/mintlify-docs/core/exulu-agent/configuration.mdx +0 -690
  67. package/mintlify-docs/core/exulu-agent/introduction.mdx +0 -552
  68. package/mintlify-docs/core/exulu-app/api-reference.mdx +0 -481
  69. package/mintlify-docs/core/exulu-app/configuration.mdx +0 -319
  70. package/mintlify-docs/core/exulu-app/introduction.mdx +0 -117
  71. package/mintlify-docs/core/exulu-authentication.mdx +0 -810
  72. package/mintlify-docs/core/exulu-chunkers/api-reference.mdx +0 -1011
  73. package/mintlify-docs/core/exulu-chunkers/configuration.mdx +0 -596
  74. package/mintlify-docs/core/exulu-chunkers/introduction.mdx +0 -403
  75. package/mintlify-docs/core/exulu-context/api-reference.mdx +0 -911
  76. package/mintlify-docs/core/exulu-context/configuration.mdx +0 -648
  77. package/mintlify-docs/core/exulu-context/introduction.mdx +0 -394
  78. package/mintlify-docs/core/exulu-database.mdx +0 -811
  79. package/mintlify-docs/core/exulu-default-agents.mdx +0 -545
  80. package/mintlify-docs/core/exulu-eval/api-reference.mdx +0 -772
  81. package/mintlify-docs/core/exulu-eval/configuration.mdx +0 -680
  82. package/mintlify-docs/core/exulu-eval/introduction.mdx +0 -459
  83. package/mintlify-docs/core/exulu-logging.mdx +0 -464
  84. package/mintlify-docs/core/exulu-otel.mdx +0 -670
  85. package/mintlify-docs/core/exulu-queues/api-reference.mdx +0 -648
  86. package/mintlify-docs/core/exulu-queues/configuration.mdx +0 -650
  87. package/mintlify-docs/core/exulu-queues/introduction.mdx +0 -474
  88. package/mintlify-docs/core/exulu-reranker/api-reference.mdx +0 -630
  89. package/mintlify-docs/core/exulu-reranker/configuration.mdx +0 -663
  90. package/mintlify-docs/core/exulu-reranker/introduction.mdx +0 -516
  91. package/mintlify-docs/core/exulu-tool/api-reference.mdx +0 -723
  92. package/mintlify-docs/core/exulu-tool/configuration.mdx +0 -805
  93. package/mintlify-docs/core/exulu-tool/introduction.mdx +0 -539
  94. package/mintlify-docs/core/exulu-variables/api-reference.mdx +0 -699
  95. package/mintlify-docs/core/exulu-variables/configuration.mdx +0 -736
  96. package/mintlify-docs/core/exulu-variables/introduction.mdx +0 -511
  97. package/mintlify-docs/development.mdx +0 -94
  98. package/mintlify-docs/docs.json +0 -248
  99. package/mintlify-docs/enterprise-edition.mdx +0 -538
  100. package/mintlify-docs/essentials/code.mdx +0 -35
  101. package/mintlify-docs/essentials/images.mdx +0 -59
  102. package/mintlify-docs/essentials/markdown.mdx +0 -88
  103. package/mintlify-docs/essentials/navigation.mdx +0 -87
  104. package/mintlify-docs/essentials/reusable-snippets.mdx +0 -110
  105. package/mintlify-docs/essentials/settings.mdx +0 -318
  106. package/mintlify-docs/favicon.svg +0 -3
  107. package/mintlify-docs/frontend/introduction.mdx +0 -39
  108. package/mintlify-docs/getting-started.mdx +0 -267
  109. package/mintlify-docs/guides/custom-agent.mdx +0 -608
  110. package/mintlify-docs/guides/first-agent.mdx +0 -315
  111. package/mintlify-docs/images/admin_ui.png +0 -0
  112. package/mintlify-docs/images/contexts.png +0 -0
  113. package/mintlify-docs/images/create_agents.png +0 -0
  114. package/mintlify-docs/images/evals.png +0 -0
  115. package/mintlify-docs/images/graphql.png +0 -0
  116. package/mintlify-docs/images/graphql_api.png +0 -0
  117. package/mintlify-docs/images/hero-dark.png +0 -0
  118. package/mintlify-docs/images/hero-light.png +0 -0
  119. package/mintlify-docs/images/hero.png +0 -0
  120. package/mintlify-docs/images/knowledge_sources.png +0 -0
  121. package/mintlify-docs/images/mcp.png +0 -0
  122. package/mintlify-docs/images/scaling.png +0 -0
  123. package/mintlify-docs/index.mdx +0 -411
  124. package/mintlify-docs/logo/dark.svg +0 -9
  125. package/mintlify-docs/logo/light.svg +0 -9
  126. package/mintlify-docs/partners.mdx +0 -558
  127. package/mintlify-docs/products.mdx +0 -77
  128. package/mintlify-docs/snippets/snippet-intro.mdx +0 -4
  129. package/mintlify-docs/styles.css +0 -207
  130. package/ngrok.bash +0 -1
  131. package/ngrok.md +0 -6
  132. package/ngrok.yml +0 -10
  133. package/release.config.cjs +0 -15
  134. package/skills-lock.json +0 -10
  135. package/types/context-processor.ts +0 -45
  136. package/types/enums/eval-types.ts +0 -5
  137. package/types/enums/field-types.ts +0 -1
  138. package/types/enums/jobs.ts +0 -11
  139. package/types/enums/statistics.ts +0 -13
  140. package/types/exulu-table-definition.ts +0 -79
  141. package/types/file-types.ts +0 -18
  142. package/types/models/agent-session.ts +0 -27
  143. package/types/models/agent.ts +0 -68
  144. package/types/models/context.ts +0 -53
  145. package/types/models/embedding.ts +0 -17
  146. package/types/models/eval-run.ts +0 -40
  147. package/types/models/exulu-agent-tool-config.ts +0 -11
  148. package/types/models/item.ts +0 -21
  149. package/types/models/job.ts +0 -8
  150. package/types/models/project.ts +0 -16
  151. package/types/models/rate-limiter-rules.ts +0 -7
  152. package/types/models/test-case.ts +0 -25
  153. package/types/models/tool.ts +0 -9
  154. package/types/models/user-role.ts +0 -12
  155. package/types/models/user.ts +0 -20
  156. package/types/models/variable.ts +0 -8
  157. package/types/models/vector-methods.ts +0 -7
  158. package/types/provider-config.ts +0 -21
  159. package/types/queue-config.ts +0 -16
  160. package/types/rbac-rights-modes.ts +0 -1
  161. package/types/statistics.ts +0 -20
  162. package/types/workflow.ts +0 -31
  163. /package/ee/{documents → python/documents}/THIRD_PARTY_LICENSES/docling.txt +0 -0
  164. /package/ee/{documents/processing → python}/requirements.txt +0 -0
@@ -1,670 +0,0 @@
1
- ---
2
- title: "ExuluOtel"
3
- description: "OpenTelemetry integration for distributed tracing and logging"
4
- ---
5
-
6
- ## Overview
7
-
8
- `ExuluOtel` provides built-in OpenTelemetry (OTEL) support for distributed tracing and logging across your Exulu application. It automatically instruments your application to collect traces and logs, helping you monitor performance, debug issues, and understand system behavior in production.
9
-
10
- ## Key features
11
-
12
- <CardGroup cols={2}>
13
- <Card title="Distributed tracing" icon="route">
14
- Track requests across services and components
15
- </Card>
16
- <Card title="Structured logging" icon="file-lines">
17
- Correlate logs with traces for better debugging
18
- </Card>
19
- <Card title="Auto-instrumentation" icon="wand-magic-sparkles">
20
- Automatic instrumentation of Node.js modules
21
- </Card>
22
- <Card title="SigNoz integration" icon="chart-line">
23
- Built-in support for SigNoz (cloud and self-hosted)
24
- </Card>
25
- <Card title="Component control" icon="sliders">
26
- Enable/disable telemetry per component
27
- </Card>
28
- <Card title="Graceful shutdown" icon="power-off">
29
- Ensures traces are flushed before exit
30
- </Card>
31
- </CardGroup>
32
-
33
- ## What is OpenTelemetry?
34
-
35
- OpenTelemetry (OTEL) is an open-source observability framework for collecting traces, metrics, and logs from your applications. It helps you:
36
-
37
- - **Monitor performance**: Identify slow operations and bottlenecks
38
- - **Debug issues**: Trace requests through your entire system
39
- - **Understand behavior**: See how components interact
40
- - **Optimize resources**: Find inefficient code paths
41
- - **Alert on problems**: Set up monitoring and alerting
42
-
43
- ## Quick start
44
-
45
- ### Prerequisites
46
-
47
- ExuluOtel currently supports **SigNoz** as the observability backend. You can use:
48
-
49
- - [SigNoz Cloud](https://signoz.io/teams/) (hosted solution)
50
- - [Self-hosted SigNoz](https://signoz.io/docs/install/) (open-source)
51
-
52
- ### Environment variables
53
-
54
- Set up your SigNoz credentials:
55
-
56
- ```bash
57
- # .env file
58
- SIGNOZ_TRACES_URL=https://ingest.{region}.signoz.cloud:443/v1/traces
59
- SIGNOZ_LOGS_URL=https://ingest.{region}.signoz.cloud:443/v1/logs
60
- SIGNOZ_ACCESS_TOKEN=your-signoz-access-token
61
- ```
62
-
63
- **For SigNoz Cloud:**
64
- - Get your ingestion URL and token from your SigNoz dashboard
65
- - Format: `https://ingest.{region}.signoz.cloud:443`
66
- - Regions: `us`, `in`, `eu`
67
-
68
- **For self-hosted SigNoz:**
69
- ```bash
70
- SIGNOZ_TRACES_URL=http://localhost:4318/v1/traces
71
- SIGNOZ_LOGS_URL=http://localhost:4318/v1/logs
72
- SIGNOZ_ACCESS_TOKEN= # Optional for self-hosted
73
- ```
74
-
75
- ### Initialize OpenTelemetry
76
-
77
- ```typescript
78
- import { ExuluOtel } from "@exulu/backend";
79
-
80
- // Create and start OpenTelemetry SDK
81
- const otel = ExuluOtel.create({
82
- SIGNOZ_TRACES_URL: process.env.SIGNOZ_TRACES_URL!,
83
- SIGNOZ_LOGS_URL: process.env.SIGNOZ_LOGS_URL!,
84
- SIGNOZ_ACCESS_TOKEN: process.env.SIGNOZ_ACCESS_TOKEN!
85
- });
86
-
87
- // Start tracing
88
- otel.start();
89
- ```
90
-
91
- <Warning>
92
- Initialize ExuluOtel **before** creating your ExuluApp to ensure all operations are traced.
93
- </Warning>
94
-
95
- ### Enable in ExuluApp
96
-
97
- Enable telemetry in your application configuration:
98
-
99
- ```typescript
100
- import { ExuluApp, ExuluOtel } from "@exulu/backend";
101
-
102
- // Initialize OTEL first
103
- const otel = ExuluOtel.create({
104
- SIGNOZ_TRACES_URL: process.env.SIGNOZ_TRACES_URL!,
105
- SIGNOZ_LOGS_URL: process.env.SIGNOZ_LOGS_URL!,
106
- SIGNOZ_ACCESS_TOKEN: process.env.SIGNOZ_ACCESS_TOKEN!
107
- });
108
-
109
- otel.start();
110
-
111
- // Create app with telemetry enabled
112
- const app = new ExuluApp();
113
-
114
- await app.create({
115
- config: {
116
- telemetry: {
117
- enabled: true // Enable global telemetry
118
- },
119
- workers: {
120
- enabled: true,
121
- telemetry: {
122
- enabled: true // Enable worker telemetry
123
- }
124
- }
125
- },
126
- contexts: {
127
- // Your contexts
128
- },
129
- agents: {
130
- // Your agents
131
- }
132
- });
133
- ```
134
-
135
- ## Configuration
136
-
137
- ### Global telemetry
138
-
139
- Enable or disable telemetry globally:
140
-
141
- ```typescript
142
- await app.create({
143
- config: {
144
- telemetry: {
145
- enabled: true // Global switch for all telemetry
146
- }
147
- }
148
- });
149
- ```
150
-
151
- **When enabled:**
152
- - Express server routes are traced
153
- - MCP operations are traced
154
- - Logs are correlated with traces
155
-
156
- ### Component-level telemetry
157
-
158
- Enable telemetry for specific components:
159
-
160
- ```typescript
161
- await app.create({
162
- config: {
163
- telemetry: {
164
- enabled: true // Global telemetry
165
- },
166
- workers: {
167
- enabled: true,
168
- telemetry: {
169
- enabled: true // Worker-specific telemetry
170
- }
171
- }
172
- }
173
- });
174
- ```
175
-
176
- **Components:**
177
- - **Workers**: BullMQ job processing traces
178
- - **Express server**: HTTP request/response traces
179
- - **MCP server**: Model Context Protocol operation traces
180
-
181
- ### Environment-specific configuration
182
-
183
- Different settings for dev/staging/prod:
184
-
185
- ```typescript
186
- const isProduction = process.env.NODE_ENV === "production";
187
-
188
- await app.create({
189
- config: {
190
- telemetry: {
191
- enabled: isProduction // Only in production
192
- },
193
- workers: {
194
- enabled: true,
195
- telemetry: {
196
- enabled: isProduction
197
- }
198
- }
199
- }
200
- });
201
- ```
202
-
203
- ## What gets traced?
204
-
205
- ### Automatic instrumentation
206
-
207
- ExuluOtel uses OpenTelemetry auto-instrumentation to automatically trace:
208
-
209
- <AccordionGroup>
210
- <Accordion title="HTTP requests/responses">
211
- - Express.js routes
212
- - Outgoing HTTP/HTTPS requests
213
- - Response status codes and timing
214
- - Headers and query parameters
215
- </Accordion>
216
-
217
- <Accordion title="Database operations">
218
- - PostgreSQL queries
219
- - Connection pool usage
220
- - Query timing and errors
221
- </Accordion>
222
-
223
- <Accordion title="Redis operations">
224
- - BullMQ queue operations
225
- - Redis commands
226
- - Connection management
227
- </Accordion>
228
-
229
- <Accordion title="File system operations">
230
- - File reads/writes
231
- - Directory operations
232
- - S3 storage interactions
233
- </Accordion>
234
-
235
- <Accordion title="LLM API calls">
236
- - OpenAI API requests
237
- - Anthropic API requests
238
- - Other provider API calls
239
- - Token usage and latency
240
- </Accordion>
241
- </AccordionGroup>
242
-
243
- ### Custom traces
244
-
245
- Components automatically create custom traces for:
246
-
247
- - **Agent operations**: `generateSync()`, `generateStream()`
248
- - **Context operations**: `search()`, `createItem()`, `updateItem()`
249
- - **Tool executions**: Function tool calls
250
- - **Worker jobs**: Background job processing
251
- - **Embeddings generation**: Batch and single embeddings
252
-
253
- ## Viewing traces in SigNoz
254
-
255
- After enabling telemetry, visit your SigNoz dashboard to view traces.
256
-
257
- ### Trace structure
258
-
259
- ```
260
- HTTP POST /api/agents/run
261
- ├─ Agent.generateSync()
262
- │ ├─ Context.search()
263
- │ │ ├─ PostgreSQL: vector search query
264
- │ │ └─ Embedder.generate()
265
- │ │ └─ OpenAI API: create embeddings
266
- │ ├─ Tool.execute()
267
- │ │ └─ External API call
268
- │ └─ OpenAI API: chat completion
269
- └─ Response sent
270
- ```
271
-
272
- ### Key metrics
273
-
274
- - **Duration**: How long each operation took
275
- - **Status**: Success, error, or timeout
276
- - **Attributes**: Operation-specific metadata
277
- - **Events**: Important moments in the trace
278
- - **Logs**: Structured logs correlated with spans
279
-
280
- ## Configuration examples
281
-
282
- ### Production setup
283
-
284
- ```typescript
285
- import { ExuluApp, ExuluOtel } from "@exulu/backend";
286
-
287
- // Initialize OTEL
288
- const otel = ExuluOtel.create({
289
- SIGNOZ_TRACES_URL: process.env.SIGNOZ_TRACES_URL!,
290
- SIGNOZ_LOGS_URL: process.env.SIGNOZ_LOGS_URL!,
291
- SIGNOZ_ACCESS_TOKEN: process.env.SIGNOZ_ACCESS_TOKEN!
292
- });
293
-
294
- otel.start();
295
-
296
- // Production configuration
297
- const app = new ExuluApp();
298
-
299
- await app.create({
300
- config: {
301
- telemetry: {
302
- enabled: true // Always on in production
303
- },
304
- workers: {
305
- enabled: true,
306
- telemetry: {
307
- enabled: true // Trace background jobs
308
- }
309
- },
310
- MCP: {
311
- enabled: true
312
- // Uses global telemetry setting
313
- }
314
- },
315
- contexts: contexts,
316
- agents: agents
317
- });
318
- ```
319
-
320
- ### Development setup
321
-
322
- ```typescript
323
- import { ExuluApp, ExuluOtel } from "@exulu/backend";
324
-
325
- // Only enable if env vars are set
326
- const telemetryEnabled = Boolean(
327
- process.env.SIGNOZ_TRACES_URL &&
328
- process.env.SIGNOZ_LOGS_URL &&
329
- process.env.SIGNOZ_ACCESS_TOKEN
330
- );
331
-
332
- if (telemetryEnabled) {
333
- const otel = ExuluOtel.create({
334
- SIGNOZ_TRACES_URL: process.env.SIGNOZ_TRACES_URL!,
335
- SIGNOZ_LOGS_URL: process.env.SIGNOZ_LOGS_URL!,
336
- SIGNOZ_ACCESS_TOKEN: process.env.SIGNOZ_ACCESS_TOKEN!
337
- });
338
-
339
- otel.start();
340
- }
341
-
342
- const app = new ExuluApp();
343
-
344
- await app.create({
345
- config: {
346
- telemetry: {
347
- enabled: telemetryEnabled // Optional in dev
348
- }
349
- }
350
- });
351
- ```
352
-
353
- ### Selective component tracing
354
-
355
- ```typescript
356
- await app.create({
357
- config: {
358
- telemetry: {
359
- enabled: true // Global enabled
360
- },
361
- workers: {
362
- enabled: true,
363
- telemetry: {
364
- enabled: false // Disable worker traces (reduce noise)
365
- }
366
- }
367
- }
368
- });
369
- ```
370
-
371
- ## Integration with logging
372
-
373
- ExuluOtel automatically correlates structured logs with traces:
374
-
375
- ```typescript
376
- import { createLogger } from "@exulu/backend";
377
-
378
- // Logger with OTEL integration
379
- const logger = createLogger({
380
- enableOtel: config?.telemetry?.enabled ?? false
381
- });
382
-
383
- // Logs are automatically correlated with active trace
384
- logger.info("Processing request", {
385
- userId: "user-123",
386
- operation: "search"
387
- });
388
-
389
- // In SigNoz, you can jump from traces to logs and vice versa
390
- ```
391
-
392
- ## Performance considerations
393
-
394
- ### Overhead
395
-
396
- OpenTelemetry adds minimal overhead:
397
- - **CPU**: ~1-2% increase
398
- - **Memory**: ~10-20MB for SDK
399
- - **Network**: Batched export reduces impact
400
-
401
- ### Sampling
402
-
403
- For high-traffic applications, consider sampling:
404
-
405
- ```typescript
406
- // Future: Sampling configuration
407
- // Currently traces all requests when enabled
408
- ```
409
-
410
- ### Batch export
411
-
412
- Traces and logs are exported in batches to minimize network overhead:
413
- - Traces: Batched every 5 seconds or 512 spans
414
- - Logs: Batched every 1 second or 512 records
415
-
416
- ## Troubleshooting
417
-
418
- ### Traces not appearing in SigNoz
419
-
420
- <AccordionGroup>
421
- <Accordion title="Check environment variables">
422
- Ensure all required variables are set:
423
-
424
- ```bash
425
- echo $SIGNOZ_TRACES_URL
426
- echo $SIGNOZ_LOGS_URL
427
- echo $SIGNOZ_ACCESS_TOKEN
428
- ```
429
-
430
- Verify URLs are correct:
431
- - SigNoz Cloud: `https://ingest.{region}.signoz.cloud:443`
432
- - Self-hosted: `http://localhost:4318` (or your host)
433
- </Accordion>
434
-
435
- <Accordion title="Verify telemetry is enabled">
436
- Check your configuration:
437
-
438
- ```typescript
439
- console.log("Telemetry enabled:", config.telemetry?.enabled);
440
- console.log("Worker telemetry:", config.workers?.telemetry?.enabled);
441
- ```
442
- </Accordion>
443
-
444
- <Accordion title="Check network connectivity">
445
- Test connection to SigNoz:
446
-
447
- ```bash
448
- curl -X POST https://ingest.{region}.signoz.cloud:443/v1/traces \
449
- -H "signoz-access-token: your-token" \
450
- -H "Content-Type: application/json" \
451
- -d '{}'
452
- ```
453
- </Accordion>
454
-
455
- <Accordion title="Review logs">
456
- Check for OTEL initialization:
457
-
458
- ```
459
- [EXULU] Setting up OpenTelemetry
460
- ```
461
-
462
- Look for errors:
463
- ```
464
- Error terminating tracing: ...
465
- ```
466
- </Accordion>
467
- </AccordionGroup>
468
-
469
- ### High cardinality warnings
470
-
471
- If you see high cardinality warnings in SigNoz:
472
-
473
- - Avoid using user IDs or request IDs as span names
474
- - Use attributes instead of span names for variable data
475
- - Limit the number of unique span names
476
-
477
- ### Memory issues
478
-
479
- If experiencing memory pressure:
480
-
481
- - Reduce batch sizes (requires custom configuration)
482
- - Enable selective component tracing
483
- - Consider sampling for high-traffic routes
484
-
485
- ## Graceful shutdown
486
-
487
- ExuluOtel handles graceful shutdown automatically:
488
-
489
- ```typescript
490
- // Listens for SIGTERM signal
491
- process.on('SIGTERM', () => {
492
- sdk.shutdown()
493
- .then(() => console.log('Tracing terminated'))
494
- .catch((error) => console.log('Error terminating tracing', error))
495
- .finally(() => process.exit(0));
496
- });
497
- ```
498
-
499
- This ensures:
500
- - In-flight traces are flushed
501
- - Connections are closed properly
502
- - No data is lost on shutdown
503
-
504
- ## Best practices
505
-
506
- <Tip>
507
- **Initialize early**: Start ExuluOtel before creating ExuluApp to capture all traces from initialization.
508
- </Tip>
509
-
510
- <Note>
511
- **Use in production**: OpenTelemetry is production-ready and adds minimal overhead. Enable it to gain visibility into your application.
512
- </Note>
513
-
514
- <Warning>
515
- **Protect credentials**: Store SigNoz credentials in environment variables or [ExuluVariables](/core/exulu-variables/introduction), never hardcode them.
516
- </Warning>
517
-
518
- <Info>
519
- **Correlate logs**: Enable OTEL-aware logging to correlate logs with traces for better debugging.
520
- </Info>
521
-
522
- ## SigNoz setup
523
-
524
- ### SigNoz Cloud
525
-
526
- 1. Sign up at [signoz.io](https://signoz.io/teams/)
527
- 2. Create a new project
528
- 3. Copy ingestion details from Settings → Ingestion Settings
529
- 4. Set environment variables with your credentials
530
-
531
- ### Self-hosted SigNoz
532
-
533
- 1. Install SigNoz using Docker:
534
-
535
- ```bash
536
- git clone https://github.com/SigNoz/signoz.git
537
- cd signoz/deploy
538
- ./install.sh
539
- ```
540
-
541
- 2. Access SigNoz at `http://localhost:3301`
542
-
543
- 3. Configure environment variables:
544
-
545
- ```bash
546
- SIGNOZ_TRACES_URL=http://localhost:4318/v1/traces
547
- SIGNOZ_LOGS_URL=http://localhost:4318/v1/logs
548
- SIGNOZ_ACCESS_TOKEN= # Not required for self-hosted
549
- ```
550
-
551
- [SigNoz installation guide](https://signoz.io/docs/install/)
552
-
553
- ## Future enhancements
554
-
555
- Planned features for ExuluOtel:
556
-
557
- - Support for additional OTEL backends (Jaeger, Zipkin, etc.)
558
- - Custom sampling strategies
559
- - Metrics collection (in addition to traces and logs)
560
- - Advanced span filtering
561
- - Custom instrumentation helpers
562
-
563
- ## Example traces
564
-
565
- ### Agent generation trace
566
-
567
- ```
568
- Trace: Agent.generateSync
569
- ├─ Span: load_agent_config (2ms)
570
- ├─ Span: search_contexts (45ms)
571
- │ ├─ Span: generate_embeddings (38ms)
572
- │ │ └─ Span: openai_api_call (35ms)
573
- │ └─ Span: postgres_vector_search (5ms)
574
- ├─ Span: execute_tools (120ms)
575
- │ └─ Span: github_api_call (115ms)
576
- └─ Span: llm_generation (850ms)
577
- └─ Span: openai_chat_completion (845ms)
578
-
579
- Total duration: 1,017ms
580
- ```
581
-
582
- ### Context search trace
583
-
584
- ```
585
- Trace: Context.search
586
- ├─ Span: embedder_generate (42ms)
587
- │ └─ Span: openai_embeddings_api (38ms)
588
- ├─ Span: postgres_vector_search (8ms)
589
- └─ Span: reranker_execute (25ms)
590
- └─ Span: cohere_rerank_api (22ms)
591
-
592
- Total duration: 75ms
593
- ```
594
-
595
- ### Worker job trace
596
-
597
- ```
598
- Trace: Worker.processJob (queue: embeddings)
599
- ├─ Span: fetch_context_item (5ms)
600
- │ └─ Span: postgres_query (3ms)
601
- ├─ Span: chunk_text (15ms)
602
- ├─ Span: generate_embeddings_batch (250ms)
603
- │ └─ Span: openai_embeddings_api (245ms)
604
- └─ Span: store_embeddings (20ms)
605
- └─ Span: postgres_bulk_insert (18ms)
606
-
607
- Total duration: 290ms
608
- ```
609
-
610
- ## API reference
611
-
612
- ### ExuluOtel.create()
613
-
614
- Factory method to create and configure OpenTelemetry SDK.
615
-
616
- ```typescript
617
- ExuluOtel.create(options: {
618
- SIGNOZ_TRACES_URL: string;
619
- SIGNOZ_LOGS_URL: string;
620
- SIGNOZ_ACCESS_TOKEN: string;
621
- }): NodeSDK
622
- ```
623
-
624
- **Parameters:**
625
-
626
- <ParamField path="SIGNOZ_TRACES_URL" type="string" required>
627
- URL for trace export (OTLP/HTTP endpoint)
628
- </ParamField>
629
-
630
- <ParamField path="SIGNOZ_LOGS_URL" type="string" required>
631
- URL for log export (OTLP/HTTP endpoint)
632
- </ParamField>
633
-
634
- <ParamField path="SIGNOZ_ACCESS_TOKEN" type="string" required>
635
- SigNoz access token for authentication
636
- </ParamField>
637
-
638
- **Returns:** `NodeSDK` - OpenTelemetry Node SDK instance
639
-
640
- **Example:**
641
-
642
- ```typescript
643
- import { ExuluOtel } from "@exulu/backend";
644
-
645
- const otel = ExuluOtel.create({
646
- SIGNOZ_TRACES_URL: "https://ingest.us.signoz.cloud:443/v1/traces",
647
- SIGNOZ_LOGS_URL: "https://ingest.us.signoz.cloud:443/v1/logs",
648
- SIGNOZ_ACCESS_TOKEN: "your-access-token"
649
- });
650
-
651
- // Start tracing
652
- otel.start();
653
- ```
654
-
655
- ## Next steps
656
-
657
- <CardGroup cols={2}>
658
- <Card title="ExuluApp" icon="box" href="/core/exulu-app/introduction">
659
- Learn about ExuluApp configuration
660
- </Card>
661
- <Card title="SigNoz docs" icon="chart-line" href="https://signoz.io/docs/">
662
- Explore SigNoz documentation
663
- </Card>
664
- <Card title="OpenTelemetry" icon="globe" href="https://opentelemetry.io/docs/">
665
- Learn about OpenTelemetry
666
- </Card>
667
- <Card title="ExuluVariables" icon="key" href="/core/exulu-variables/introduction">
668
- Manage telemetry credentials
669
- </Card>
670
- </CardGroup>