@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.
- package/dist/index.cjs +351 -42
- package/dist/index.d.cts +96 -1
- package/dist/index.d.ts +96 -1
- package/dist/index.js +340 -38
- package/ee/{markdown.ts → chunking/markdown.ts} +2 -2
- package/ee/python/README.md +295 -0
- package/ee/python/documents/processing/README.md +155 -0
- package/ee/{documents → python/documents}/processing/doc_processor.ts +25 -17
- package/ee/{documents/processing/pdf_to_markdown.py → python/documents/processing/document_to_markdown.py} +3 -10
- package/ee/python/setup.sh +180 -0
- package/package.json +14 -3
- package/scripts/postinstall.cjs +149 -0
- package/.agents/skills/mintlify/SKILL.md +0 -347
- package/.editorconfig +0 -15
- package/.eslintrc.json +0 -52
- package/.github/workflows/release-backend.yml +0 -38
- package/.husky/commit-msg +0 -1
- package/.jscpd.json +0 -18
- package/.mcp.json +0 -25
- package/.nvmrc +0 -1
- package/.prettierignore +0 -5
- package/.prettierrc.json +0 -12
- package/CHANGELOG.md +0 -8
- package/SECURITY.md +0 -5
- package/commitlint.config.js +0 -4
- package/devops/documentation/patch-older-releases.md +0 -42
- package/ee/documents/processing/build_pdf_processor.sh +0 -35
- package/ee/documents/processing/chunk_markdown.py +0 -263
- package/ee/documents/processing/pdf_processor.spec +0 -115
- package/eslint.config.js +0 -88
- package/jest.config.ts +0 -25
- package/mintlify-docs/.mintignore +0 -7
- package/mintlify-docs/AGENTS.md +0 -33
- package/mintlify-docs/CLAUDE.MD +0 -50
- package/mintlify-docs/CONTRIBUTING.md +0 -32
- package/mintlify-docs/LICENSE +0 -21
- package/mintlify-docs/README.md +0 -55
- package/mintlify-docs/ai-tools/claude-code.mdx +0 -43
- package/mintlify-docs/ai-tools/cursor.mdx +0 -39
- package/mintlify-docs/ai-tools/windsurf.mdx +0 -39
- package/mintlify-docs/api-reference/core-types/agent-types.mdx +0 -110
- package/mintlify-docs/api-reference/core-types/analytics-types.mdx +0 -95
- package/mintlify-docs/api-reference/core-types/configuration-types.mdx +0 -83
- package/mintlify-docs/api-reference/core-types/evaluation-types.mdx +0 -106
- package/mintlify-docs/api-reference/core-types/job-types.mdx +0 -135
- package/mintlify-docs/api-reference/core-types/overview.mdx +0 -73
- package/mintlify-docs/api-reference/core-types/prompt-types.mdx +0 -102
- package/mintlify-docs/api-reference/core-types/rbac-types.mdx +0 -163
- package/mintlify-docs/api-reference/core-types/session-types.mdx +0 -77
- package/mintlify-docs/api-reference/core-types/user-management.mdx +0 -112
- package/mintlify-docs/api-reference/core-types/workflow-types.mdx +0 -88
- package/mintlify-docs/api-reference/core-types.mdx +0 -585
- package/mintlify-docs/api-reference/dynamic-types.mdx +0 -851
- package/mintlify-docs/api-reference/endpoint/create.mdx +0 -4
- package/mintlify-docs/api-reference/endpoint/delete.mdx +0 -4
- package/mintlify-docs/api-reference/endpoint/get.mdx +0 -4
- package/mintlify-docs/api-reference/endpoint/webhook.mdx +0 -4
- package/mintlify-docs/api-reference/introduction.mdx +0 -661
- package/mintlify-docs/api-reference/mutations.mdx +0 -1012
- package/mintlify-docs/api-reference/openapi.json +0 -217
- package/mintlify-docs/api-reference/queries.mdx +0 -1154
- package/mintlify-docs/backend/introduction.mdx +0 -218
- package/mintlify-docs/changelog.mdx +0 -387
- package/mintlify-docs/community-edition.mdx +0 -304
- package/mintlify-docs/core/exulu-agent/api-reference.mdx +0 -894
- package/mintlify-docs/core/exulu-agent/configuration.mdx +0 -690
- package/mintlify-docs/core/exulu-agent/introduction.mdx +0 -552
- package/mintlify-docs/core/exulu-app/api-reference.mdx +0 -481
- package/mintlify-docs/core/exulu-app/configuration.mdx +0 -319
- package/mintlify-docs/core/exulu-app/introduction.mdx +0 -117
- package/mintlify-docs/core/exulu-authentication.mdx +0 -810
- package/mintlify-docs/core/exulu-chunkers/api-reference.mdx +0 -1011
- package/mintlify-docs/core/exulu-chunkers/configuration.mdx +0 -596
- package/mintlify-docs/core/exulu-chunkers/introduction.mdx +0 -403
- package/mintlify-docs/core/exulu-context/api-reference.mdx +0 -911
- package/mintlify-docs/core/exulu-context/configuration.mdx +0 -648
- package/mintlify-docs/core/exulu-context/introduction.mdx +0 -394
- package/mintlify-docs/core/exulu-database.mdx +0 -811
- package/mintlify-docs/core/exulu-default-agents.mdx +0 -545
- package/mintlify-docs/core/exulu-eval/api-reference.mdx +0 -772
- package/mintlify-docs/core/exulu-eval/configuration.mdx +0 -680
- package/mintlify-docs/core/exulu-eval/introduction.mdx +0 -459
- package/mintlify-docs/core/exulu-logging.mdx +0 -464
- package/mintlify-docs/core/exulu-otel.mdx +0 -670
- package/mintlify-docs/core/exulu-queues/api-reference.mdx +0 -648
- package/mintlify-docs/core/exulu-queues/configuration.mdx +0 -650
- package/mintlify-docs/core/exulu-queues/introduction.mdx +0 -474
- package/mintlify-docs/core/exulu-reranker/api-reference.mdx +0 -630
- package/mintlify-docs/core/exulu-reranker/configuration.mdx +0 -663
- package/mintlify-docs/core/exulu-reranker/introduction.mdx +0 -516
- package/mintlify-docs/core/exulu-tool/api-reference.mdx +0 -723
- package/mintlify-docs/core/exulu-tool/configuration.mdx +0 -805
- package/mintlify-docs/core/exulu-tool/introduction.mdx +0 -539
- package/mintlify-docs/core/exulu-variables/api-reference.mdx +0 -699
- package/mintlify-docs/core/exulu-variables/configuration.mdx +0 -736
- package/mintlify-docs/core/exulu-variables/introduction.mdx +0 -511
- package/mintlify-docs/development.mdx +0 -94
- package/mintlify-docs/docs.json +0 -248
- package/mintlify-docs/enterprise-edition.mdx +0 -538
- package/mintlify-docs/essentials/code.mdx +0 -35
- package/mintlify-docs/essentials/images.mdx +0 -59
- package/mintlify-docs/essentials/markdown.mdx +0 -88
- package/mintlify-docs/essentials/navigation.mdx +0 -87
- package/mintlify-docs/essentials/reusable-snippets.mdx +0 -110
- package/mintlify-docs/essentials/settings.mdx +0 -318
- package/mintlify-docs/favicon.svg +0 -3
- package/mintlify-docs/frontend/introduction.mdx +0 -39
- package/mintlify-docs/getting-started.mdx +0 -267
- package/mintlify-docs/guides/custom-agent.mdx +0 -608
- package/mintlify-docs/guides/first-agent.mdx +0 -315
- package/mintlify-docs/images/admin_ui.png +0 -0
- package/mintlify-docs/images/contexts.png +0 -0
- package/mintlify-docs/images/create_agents.png +0 -0
- package/mintlify-docs/images/evals.png +0 -0
- package/mintlify-docs/images/graphql.png +0 -0
- package/mintlify-docs/images/graphql_api.png +0 -0
- package/mintlify-docs/images/hero-dark.png +0 -0
- package/mintlify-docs/images/hero-light.png +0 -0
- package/mintlify-docs/images/hero.png +0 -0
- package/mintlify-docs/images/knowledge_sources.png +0 -0
- package/mintlify-docs/images/mcp.png +0 -0
- package/mintlify-docs/images/scaling.png +0 -0
- package/mintlify-docs/index.mdx +0 -411
- package/mintlify-docs/logo/dark.svg +0 -9
- package/mintlify-docs/logo/light.svg +0 -9
- package/mintlify-docs/partners.mdx +0 -558
- package/mintlify-docs/products.mdx +0 -77
- package/mintlify-docs/snippets/snippet-intro.mdx +0 -4
- package/mintlify-docs/styles.css +0 -207
- package/ngrok.bash +0 -1
- package/ngrok.md +0 -6
- package/ngrok.yml +0 -10
- package/release.config.cjs +0 -15
- package/skills-lock.json +0 -10
- package/types/context-processor.ts +0 -45
- package/types/enums/eval-types.ts +0 -5
- package/types/enums/field-types.ts +0 -1
- package/types/enums/jobs.ts +0 -11
- package/types/enums/statistics.ts +0 -13
- package/types/exulu-table-definition.ts +0 -79
- package/types/file-types.ts +0 -18
- package/types/models/agent-session.ts +0 -27
- package/types/models/agent.ts +0 -68
- package/types/models/context.ts +0 -53
- package/types/models/embedding.ts +0 -17
- package/types/models/eval-run.ts +0 -40
- package/types/models/exulu-agent-tool-config.ts +0 -11
- package/types/models/item.ts +0 -21
- package/types/models/job.ts +0 -8
- package/types/models/project.ts +0 -16
- package/types/models/rate-limiter-rules.ts +0 -7
- package/types/models/test-case.ts +0 -25
- package/types/models/tool.ts +0 -9
- package/types/models/user-role.ts +0 -12
- package/types/models/user.ts +0 -20
- package/types/models/variable.ts +0 -8
- package/types/models/vector-methods.ts +0 -7
- package/types/provider-config.ts +0 -21
- package/types/queue-config.ts +0 -16
- package/types/rbac-rights-modes.ts +0 -1
- package/types/statistics.ts +0 -20
- package/types/workflow.ts +0 -31
- /package/ee/{documents → python/documents}/THIRD_PARTY_LICENSES/docling.txt +0 -0
- /package/ee/{documents/processing → python}/requirements.txt +0 -0
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Logging"
|
|
3
|
-
description: "Winston logger implementation with OpenTelemetry integration"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
|
|
8
|
-
Exulu uses [Winston](https://github.com/winstonjs/winston) for structured logging across all components, including the Express server, MCP server, and worker instances. The logging system is centralized through a logger factory function that creates Winston logger instances with conditional OpenTelemetry integration.
|
|
9
|
-
|
|
10
|
-
## Architecture
|
|
11
|
-
|
|
12
|
-
The logging system is built around a centralized logger factory in `src/exulu/logger.ts` that creates Winston logger instances with:
|
|
13
|
-
|
|
14
|
-
- **Structured JSON logging**: All logs are formatted as JSON with timestamps and metadata
|
|
15
|
-
- **Error stack traces**: Automatic stack trace capture for error objects
|
|
16
|
-
- **Environment context**: Automatic service name and environment labeling
|
|
17
|
-
- **Conditional OpenTelemetry**: OTel transport enabled based on configuration
|
|
18
|
-
- **Console fallback**: Always includes console transport for development
|
|
19
|
-
- **Instance-level control**: Express, Workers, and MCP can have independent telemetry settings
|
|
20
|
-
|
|
21
|
-
## Logger configuration
|
|
22
|
-
|
|
23
|
-
### Core logger setup
|
|
24
|
-
|
|
25
|
-
The `createLogger` function accepts an `enableOtel` boolean parameter to conditionally enable OpenTelemetry transport:
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { createLogger } from "@exulu/backend";
|
|
29
|
-
|
|
30
|
-
const logger = createLogger({
|
|
31
|
-
enableOtel: true // Enable OpenTelemetry integration
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Implementation details
|
|
36
|
-
|
|
37
|
-
The logger is configured with the following Winston setup:
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
const createLogger = ({ enableOtel }: { enableOtel: boolean }) => {
|
|
41
|
-
const logger = winston.createLogger({
|
|
42
|
-
level: 'debug',
|
|
43
|
-
format: winston.format.combine(
|
|
44
|
-
winston.format.timestamp(),
|
|
45
|
-
winston.format.errors({ stack: true }),
|
|
46
|
-
winston.format.metadata(),
|
|
47
|
-
winston.format.json()
|
|
48
|
-
),
|
|
49
|
-
defaultMeta: {
|
|
50
|
-
service: 'Exulu',
|
|
51
|
-
environment: process.env.NODE_ENV || 'development',
|
|
52
|
-
},
|
|
53
|
-
transports: [
|
|
54
|
-
new winston.transports.Console(),
|
|
55
|
-
...(enableOtel ? [new OpenTelemetryTransportV3()] : []),
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
return logger;
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Configuration-driven telemetry
|
|
63
|
-
|
|
64
|
-
The `ExuluApp` class manages telemetry configuration through the `ExuluConfig` type:
|
|
65
|
-
|
|
66
|
-
```typescript
|
|
67
|
-
export type ExuluConfig = {
|
|
68
|
-
telemetry?: {
|
|
69
|
-
enabled: boolean,
|
|
70
|
-
}
|
|
71
|
-
workers: {
|
|
72
|
-
enabled: boolean,
|
|
73
|
-
logsDir?: string,
|
|
74
|
-
telemetry?: {
|
|
75
|
-
enabled: boolean,
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// ...
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Integration points
|
|
83
|
-
|
|
84
|
-
### Express server logging
|
|
85
|
-
|
|
86
|
-
In your Express application, the logger is automatically created and configured:
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
const logger = createLogger({
|
|
90
|
-
enableOtel: this._config?.telemetry?.enabled ?? false
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
The logger is then passed to `createExpressRoutes()` for use throughout the Express application.
|
|
95
|
-
|
|
96
|
-
**Example usage in routes:**
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
logger.info('Processing user request', {
|
|
100
|
-
userId: req.user.id,
|
|
101
|
-
endpoint: req.path
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
logger.error('Failed to process request', {
|
|
105
|
-
error: err.message,
|
|
106
|
-
stack: err.stack
|
|
107
|
-
});
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### BullMQ workers logging
|
|
111
|
-
|
|
112
|
-
Workers create their own logger instance with independent telemetry configuration:
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
const logger = createLogger({
|
|
116
|
-
enableOtel: this._config?.workers?.telemetry?.enabled ?? false
|
|
117
|
-
});
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
This allows you to:
|
|
121
|
-
- Enable telemetry for production workers while keeping it off in development
|
|
122
|
-
- Have different logging configurations for different worker types
|
|
123
|
-
- Control logging overhead independently from the main application
|
|
124
|
-
|
|
125
|
-
**Example usage in workers:**
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
logger.debug('Starting job processing', {
|
|
129
|
-
jobId: job.id,
|
|
130
|
-
queue: job.queueName
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
logger.info('Job completed successfully', {
|
|
134
|
-
jobId: job.id,
|
|
135
|
-
duration: Date.now() - startTime
|
|
136
|
-
});
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### MCP server logging
|
|
140
|
-
|
|
141
|
-
The MCP server receives the logger instance via dependency injection:
|
|
142
|
-
|
|
143
|
-
```typescript
|
|
144
|
-
create = async ({
|
|
145
|
-
express,
|
|
146
|
-
contexts,
|
|
147
|
-
agents,
|
|
148
|
-
config,
|
|
149
|
-
tools,
|
|
150
|
-
tracer,
|
|
151
|
-
logger // Logger injected here
|
|
152
|
-
}: {
|
|
153
|
-
logger: Logger
|
|
154
|
-
}) => {
|
|
155
|
-
// Logger is passed in and used throughout MCP server
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## Usage examples
|
|
160
|
-
|
|
161
|
-
### Basic configuration
|
|
162
|
-
|
|
163
|
-
Configure telemetry in your ExuluApp config:
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
import { ExuluApp } from "@exulu/backend";
|
|
167
|
-
|
|
168
|
-
const app = new ExuluApp();
|
|
169
|
-
|
|
170
|
-
await app.create({
|
|
171
|
-
config: {
|
|
172
|
-
telemetry: {
|
|
173
|
-
enabled: true // Enables OTel for Express and MCP
|
|
174
|
-
},
|
|
175
|
-
workers: {
|
|
176
|
-
enabled: true,
|
|
177
|
-
telemetry: {
|
|
178
|
-
enabled: false // Workers use console-only logging
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
contexts: contexts,
|
|
183
|
-
agents: agents
|
|
184
|
-
});
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Environment-specific logging
|
|
188
|
-
|
|
189
|
-
Different settings for development, staging, and production:
|
|
190
|
-
|
|
191
|
-
```typescript
|
|
192
|
-
const isProduction = process.env.NODE_ENV === "production";
|
|
193
|
-
const isDevelopment = process.env.NODE_ENV === "development";
|
|
194
|
-
|
|
195
|
-
await app.create({
|
|
196
|
-
config: {
|
|
197
|
-
telemetry: {
|
|
198
|
-
enabled: isProduction // Only send to OTel in production
|
|
199
|
-
},
|
|
200
|
-
workers: {
|
|
201
|
-
enabled: true,
|
|
202
|
-
telemetry: {
|
|
203
|
-
enabled: isProduction && !isDevelopment
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Structured logging best practices
|
|
211
|
-
|
|
212
|
-
```typescript
|
|
213
|
-
// Good - structured with context
|
|
214
|
-
logger.info('User authenticated', {
|
|
215
|
-
userId: user.id,
|
|
216
|
-
method: 'oauth',
|
|
217
|
-
provider: 'google'
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
// Good - error with stack trace
|
|
221
|
-
logger.error('Database connection failed', {
|
|
222
|
-
error: err.message,
|
|
223
|
-
stack: err.stack,
|
|
224
|
-
database: 'postgresql',
|
|
225
|
-
host: process.env.DB_HOST
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
// Avoid - unstructured messages
|
|
229
|
-
logger.info(`User ${user.id} authenticated via google`);
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Log levels
|
|
233
|
-
|
|
234
|
-
Winston supports the following log levels (in order of priority):
|
|
235
|
-
|
|
236
|
-
- `error` - Error events that might still allow the application to continue
|
|
237
|
-
- `warn` - Warning events that indicate potential issues
|
|
238
|
-
- `info` - Informational messages highlighting application progress
|
|
239
|
-
- `http` - HTTP request/response logging
|
|
240
|
-
- `verbose` - More detailed informational messages
|
|
241
|
-
- `debug` - Detailed debugging information
|
|
242
|
-
- `silly` - Most detailed logging (rarely used)
|
|
243
|
-
|
|
244
|
-
The default log level is `debug`, which includes all levels except `silly`.
|
|
245
|
-
|
|
246
|
-
### Setting log levels
|
|
247
|
-
|
|
248
|
-
```typescript
|
|
249
|
-
// Log levels are configured in the createLogger function
|
|
250
|
-
// Default: 'debug'
|
|
251
|
-
|
|
252
|
-
logger.error('Critical error occurred'); // Always logged
|
|
253
|
-
logger.warn('Warning message'); // Always logged
|
|
254
|
-
logger.info('Info message'); // Always logged
|
|
255
|
-
logger.debug('Debug details'); // Logged when level >= debug
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## OpenTelemetry integration
|
|
259
|
-
|
|
260
|
-
When OpenTelemetry is enabled, logs are automatically correlated with traces:
|
|
261
|
-
|
|
262
|
-
```typescript
|
|
263
|
-
// Logger with OTEL integration
|
|
264
|
-
const logger = createLogger({
|
|
265
|
-
enableOtel: config?.telemetry?.enabled ?? false
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
// Logs are automatically correlated with active trace
|
|
269
|
-
logger.info("Processing request", {
|
|
270
|
-
userId: "user-123",
|
|
271
|
-
operation: "search"
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
// In SigNoz, you can jump from traces to logs and vice versa
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### Benefits of OTel integration
|
|
278
|
-
|
|
279
|
-
<CardGroup cols={2}>
|
|
280
|
-
<Card title="Trace correlation" icon="link">
|
|
281
|
-
Logs are automatically linked to active traces
|
|
282
|
-
</Card>
|
|
283
|
-
<Card title="Context propagation" icon="route">
|
|
284
|
-
Trace IDs and span IDs included in log metadata
|
|
285
|
-
</Card>
|
|
286
|
-
<Card title="Unified observability" icon="chart-mixed">
|
|
287
|
-
View logs and traces together in SigNoz
|
|
288
|
-
</Card>
|
|
289
|
-
<Card title="Debugging workflow" icon="bug">
|
|
290
|
-
Jump from trace to related logs and vice versa
|
|
291
|
-
</Card>
|
|
292
|
-
</CardGroup>
|
|
293
|
-
|
|
294
|
-
### Viewing logs in SigNoz
|
|
295
|
-
|
|
296
|
-
After enabling OTel logging, visit your SigNoz dashboard to:
|
|
297
|
-
|
|
298
|
-
1. View logs in the **Logs Explorer**
|
|
299
|
-
2. Filter logs by trace ID, span ID, or custom attributes
|
|
300
|
-
3. Jump from a trace span to related logs
|
|
301
|
-
4. Search logs using structured query language
|
|
302
|
-
|
|
303
|
-
## Performance considerations
|
|
304
|
-
|
|
305
|
-
### Console vs OpenTelemetry
|
|
306
|
-
|
|
307
|
-
- **Console transport**: Synchronous, low overhead, good for development
|
|
308
|
-
- **OpenTelemetry transport**: Asynchronous, batched export, minimal production overhead
|
|
309
|
-
|
|
310
|
-
### Batching and buffering
|
|
311
|
-
|
|
312
|
-
Logs are batched when using OpenTelemetry:
|
|
313
|
-
- Batch size: 512 log records
|
|
314
|
-
- Batch interval: 1 second
|
|
315
|
-
- This minimizes network overhead and improves performance
|
|
316
|
-
|
|
317
|
-
### Production best practices
|
|
318
|
-
|
|
319
|
-
<Tip>
|
|
320
|
-
Use structured logging with consistent field names to make searching and filtering easier in SigNoz.
|
|
321
|
-
</Tip>
|
|
322
|
-
|
|
323
|
-
<Warning>
|
|
324
|
-
Avoid logging sensitive data like passwords, API keys, or personal information. Use redaction or filtering if necessary.
|
|
325
|
-
</Warning>
|
|
326
|
-
|
|
327
|
-
<Note>
|
|
328
|
-
Enable debug-level logging only in development. Use info or warn level in production to reduce log volume.
|
|
329
|
-
</Note>
|
|
330
|
-
|
|
331
|
-
## Troubleshooting
|
|
332
|
-
|
|
333
|
-
### Logs not appearing in SigNoz
|
|
334
|
-
|
|
335
|
-
<AccordionGroup>
|
|
336
|
-
<Accordion title="Check telemetry configuration">
|
|
337
|
-
Verify that telemetry is enabled in your config:
|
|
338
|
-
|
|
339
|
-
```typescript
|
|
340
|
-
console.log("Telemetry enabled:", config.telemetry?.enabled);
|
|
341
|
-
console.log("Worker telemetry:", config.workers?.telemetry?.enabled);
|
|
342
|
-
```
|
|
343
|
-
</Accordion>
|
|
344
|
-
|
|
345
|
-
<Accordion title="Verify environment variables">
|
|
346
|
-
Ensure OpenTelemetry environment variables are set:
|
|
347
|
-
|
|
348
|
-
```bash
|
|
349
|
-
echo $SIGNOZ_LOGS_URL
|
|
350
|
-
echo $SIGNOZ_ACCESS_TOKEN
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
Should be:
|
|
354
|
-
- SigNoz Cloud: `https://ingest.{region}.signoz.cloud:443/v1/logs`
|
|
355
|
-
- Self-hosted: `http://localhost:4318/v1/logs`
|
|
356
|
-
</Accordion>
|
|
357
|
-
|
|
358
|
-
<Accordion title="Check logger initialization">
|
|
359
|
-
Ensure the logger is created with OpenTelemetry enabled:
|
|
360
|
-
|
|
361
|
-
```typescript
|
|
362
|
-
const logger = createLogger({
|
|
363
|
-
enableOtel: true // Must be true for OTel export
|
|
364
|
-
});
|
|
365
|
-
```
|
|
366
|
-
</Accordion>
|
|
367
|
-
|
|
368
|
-
<Accordion title="Review console output">
|
|
369
|
-
Check if logs appear in console but not in SigNoz. This indicates a transport issue, not a logging issue.
|
|
370
|
-
</Accordion>
|
|
371
|
-
</AccordionGroup>
|
|
372
|
-
|
|
373
|
-
### High log volume
|
|
374
|
-
|
|
375
|
-
If you're generating too many logs:
|
|
376
|
-
|
|
377
|
-
1. Increase log level to `info` or `warn` in production
|
|
378
|
-
2. Use sampling for high-frequency operations
|
|
379
|
-
3. Disable debug logging for specific components
|
|
380
|
-
4. Use filters in SigNoz to focus on important logs
|
|
381
|
-
|
|
382
|
-
### Log format issues
|
|
383
|
-
|
|
384
|
-
If logs aren't properly structured:
|
|
385
|
-
|
|
386
|
-
1. Always pass objects as the second parameter to logger methods
|
|
387
|
-
2. Use consistent field names across your application
|
|
388
|
-
3. Avoid string interpolation in log messages
|
|
389
|
-
4. Use the metadata format for structured data
|
|
390
|
-
|
|
391
|
-
## Example log outputs
|
|
392
|
-
|
|
393
|
-
### Console output (development)
|
|
394
|
-
|
|
395
|
-
```json
|
|
396
|
-
{
|
|
397
|
-
"level": "info",
|
|
398
|
-
"message": "Processing user request",
|
|
399
|
-
"timestamp": "2024-03-10T15:30:45.123Z",
|
|
400
|
-
"service": "Exulu",
|
|
401
|
-
"environment": "development",
|
|
402
|
-
"userId": "user-123",
|
|
403
|
-
"endpoint": "/api/agents/run"
|
|
404
|
-
}
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
### OpenTelemetry output (production)
|
|
408
|
-
|
|
409
|
-
The same log with trace correlation:
|
|
410
|
-
|
|
411
|
-
```json
|
|
412
|
-
{
|
|
413
|
-
"level": "info",
|
|
414
|
-
"message": "Processing user request",
|
|
415
|
-
"timestamp": "2024-03-10T15:30:45.123Z",
|
|
416
|
-
"service": "Exulu",
|
|
417
|
-
"environment": "production",
|
|
418
|
-
"userId": "user-123",
|
|
419
|
-
"endpoint": "/api/agents/run",
|
|
420
|
-
"trace_id": "1234567890abcdef",
|
|
421
|
-
"span_id": "abcdef123456",
|
|
422
|
-
"trace_flags": "01"
|
|
423
|
-
}
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
## Best practices summary
|
|
427
|
-
|
|
428
|
-
<CardGroup cols={2}>
|
|
429
|
-
<Card title="Structure your logs" icon="table">
|
|
430
|
-
Use objects for log metadata, not string concatenation
|
|
431
|
-
</Card>
|
|
432
|
-
<Card title="Use appropriate levels" icon="layer-group">
|
|
433
|
-
error for errors, warn for warnings, info for important events
|
|
434
|
-
</Card>
|
|
435
|
-
<Card title="Add context" icon="circle-info">
|
|
436
|
-
Include relevant IDs, timestamps, and operation details
|
|
437
|
-
</Card>
|
|
438
|
-
<Card title="Enable in production" icon="rocket">
|
|
439
|
-
Use OTel integration for production observability
|
|
440
|
-
</Card>
|
|
441
|
-
<Card title="Protect sensitive data" icon="shield">
|
|
442
|
-
Never log passwords, tokens, or PII
|
|
443
|
-
</Card>
|
|
444
|
-
<Card title="Keep it consistent" icon="equals">
|
|
445
|
-
Use the same field names across your application
|
|
446
|
-
</Card>
|
|
447
|
-
</CardGroup>
|
|
448
|
-
|
|
449
|
-
## Next steps
|
|
450
|
-
|
|
451
|
-
<CardGroup cols={2}>
|
|
452
|
-
<Card title="ExuluOtel" icon="chart-line" href="/core/exulu-otel">
|
|
453
|
-
Learn about OpenTelemetry integration
|
|
454
|
-
</Card>
|
|
455
|
-
<Card title="ExuluApp" icon="box" href="/core/exulu-app/introduction">
|
|
456
|
-
Configure telemetry in ExuluApp
|
|
457
|
-
</Card>
|
|
458
|
-
<Card title="SigNoz" icon="chart-mixed" href="https://signoz.io/docs/">
|
|
459
|
-
Explore SigNoz documentation
|
|
460
|
-
</Card>
|
|
461
|
-
<Card title="Winston" icon="book" href="https://github.com/winstonjs/winston">
|
|
462
|
-
Winston logger documentation
|
|
463
|
-
</Card>
|
|
464
|
-
</CardGroup>
|