@nicollasfrazao/liguelead-log-service 1.2.9 → 1.2.10
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/README.md +25 -0
- package/dist/services/log.storage.external.s3.service.d.ts +34 -0
- package/dist/services/log.storage.external.s3.service.d.ts.map +1 -1
- package/dist/services/log.storage.external.s3.service.js +142 -9
- package/dist/services/log.storage.external.s3.service.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,6 +175,8 @@ LogService.info('Log batch', logs); // Array de logs pré-formatados
|
|
|
175
175
|
- ✅ **Fallback para armazenamento local** em caso de falha do S3
|
|
176
176
|
- ✅ **Padrão de serviço estático** - sem necessidade de instanciação
|
|
177
177
|
- ✅ **Autenticação via IAM Role ARN** (AssumeRole automático, cache, renovação, cross-account)
|
|
178
|
+
- 🛡️ **Resilência de rede** com retry automático e backoff exponencial para conexões Firehose
|
|
179
|
+
- 🔄 **Recovery automático** de erros transitórios como `socket hang up` e `write EPIPE`
|
|
178
180
|
|
|
179
181
|
## Estrutura dos Arquivos de Log
|
|
180
182
|
|
|
@@ -238,6 +240,29 @@ Quando `LOG_USE_S3_STORAGE=true`, os logs são enviados para **Kinesis Firehose*
|
|
|
238
240
|
- **Endpoint**: Configurável via `LOG_AWS_ENDPOINT` (útil para LocalStack)
|
|
239
241
|
- **Credenciais**: Via variáveis de ambiente AWS ou perfis IAM
|
|
240
242
|
|
|
243
|
+
#### Resilência de Rede (v1.2.10+)
|
|
244
|
+
|
|
245
|
+
O sistema possui **retry automático com backoff exponencial** para resolver erros comuns de rede:
|
|
246
|
+
|
|
247
|
+
**Recursos de Resilência:**
|
|
248
|
+
- 🔄 **Retry Inteligente**: Até 3 tentativas automáticas para erros de rede
|
|
249
|
+
- ⏰ **Backoff Exponencial**: Delay crescente entre tentativas (1s → 2s → 4s + jitter)
|
|
250
|
+
- 🎯 **Detecção Inteligente**: Identifica erros recuperáveis vs permanentes
|
|
251
|
+
- ⚡ **Timeouts Otimizados**: 30 segundos para requisições Firehose
|
|
252
|
+
|
|
253
|
+
**Erros Resolvidos Automaticamente:**
|
|
254
|
+
- `socket hang up` - Conexões TCP interrompidas
|
|
255
|
+
- `write EPIPE` - Escrita em pipe fechado
|
|
256
|
+
- `ECONNRESET` - Conexão resetada pelo peer
|
|
257
|
+
- `ETIMEDOUT` - Timeout de operação
|
|
258
|
+
- `EHOSTUNREACH` / `ENETUNREACH` - Problemas de conectividade
|
|
259
|
+
|
|
260
|
+
**Comportamento:**
|
|
261
|
+
1. **Tentativa inicial** de envio para Firehose
|
|
262
|
+
2. **Se falha de rede**: retry automático com backoff exponencial
|
|
263
|
+
3. **Se falha persistente**: fallback para armazenamento local
|
|
264
|
+
4. **Logging detalhado** de todas as tentativas para debug
|
|
265
|
+
|
|
241
266
|
Exemplo de estrutura no S3 via Firehose:
|
|
242
267
|
```
|
|
243
268
|
my-app-logs/
|
|
@@ -28,6 +28,14 @@ export declare class LogStorageExternalS3Service extends LogStorageExternalServi
|
|
|
28
28
|
* @var {Promise<any> | null}
|
|
29
29
|
*/
|
|
30
30
|
private credentialsCache;
|
|
31
|
+
/**
|
|
32
|
+
* @var {number}
|
|
33
|
+
*/
|
|
34
|
+
private readonly maxRetries;
|
|
35
|
+
/**
|
|
36
|
+
* @var {number}
|
|
37
|
+
*/
|
|
38
|
+
private readonly baseDelay;
|
|
31
39
|
/**
|
|
32
40
|
* Constructor of the LogStorageS3Service
|
|
33
41
|
*
|
|
@@ -52,6 +60,32 @@ export declare class LogStorageExternalS3Service extends LogStorageExternalServi
|
|
|
52
60
|
* @returns {Promise<any>} Fresh credentials object for AWS SDK
|
|
53
61
|
*/
|
|
54
62
|
private refreshAssumeRoleCredentials;
|
|
63
|
+
/**
|
|
64
|
+
* Sleep for specified milliseconds
|
|
65
|
+
*
|
|
66
|
+
* @param {number} ms - Milliseconds to sleep
|
|
67
|
+
*
|
|
68
|
+
* @returns {Promise<void>}
|
|
69
|
+
*/
|
|
70
|
+
private sleep;
|
|
71
|
+
/**
|
|
72
|
+
* Retry function with exponential backoff
|
|
73
|
+
*
|
|
74
|
+
* @param {Function} operation - The operation to retry
|
|
75
|
+
* @param {number} retries - Number of retries remaining
|
|
76
|
+
* @param {number} delay - Current delay in milliseconds
|
|
77
|
+
*
|
|
78
|
+
* @returns {Promise<any>}
|
|
79
|
+
*/
|
|
80
|
+
private retryWithBackoff;
|
|
81
|
+
/**
|
|
82
|
+
* Check if error is retryable
|
|
83
|
+
*
|
|
84
|
+
* @param {any} error - The error to check
|
|
85
|
+
*
|
|
86
|
+
* @returns {boolean}
|
|
87
|
+
*/
|
|
88
|
+
private isRetryableError;
|
|
55
89
|
/**
|
|
56
90
|
* Upload log content to Firehose (which delivers to S3)
|
|
57
91
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.storage.external.s3.service.d.ts","sourceRoot":"","sources":["../../src/services/log.storage.external.s3.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C;;;;;;;;;GASG;AACH,qBAAa,2BAA4B,SAAQ,yBAAyB;IAExE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAiB;IAEjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAA6C;IAE3D;;OAEG;IACH,OAAO,CAAC,UAAU,CAAyC;IAE3D;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAA6B;IAErD;;;;OAIG;gBACU,gBAAgB,EAAE,yBAAyB;
|
|
1
|
+
{"version":3,"file":"log.storage.external.s3.service.d.ts","sourceRoot":"","sources":["../../src/services/log.storage.external.s3.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI5C;;;;;;;;;GASG;AACH,qBAAa,2BAA4B,SAAQ,yBAAyB;IAExE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAiB;IAEjC;;OAEG;IACH,OAAO,CAAC,MAAM,CAA6C;IAE3D;;OAEG;IACH,OAAO,CAAC,UAAU,CAAyC;IAE3D;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAA6B;IAErD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAE1C;;;;OAIG;gBACU,gBAAgB,EAAE,yBAAyB;IAgCxD;;;;OAIG;IACI,SAAS,IAAI,OAAO;IAK3B;;;;OAIG;YACW,wBAAwB;IAqCtC;;;;OAIG;YACW,4BAA4B;IA6C1C;;;;;;OAMG;IACH,OAAO,CAAC,KAAK;IAKb;;;;;;;;OAQG;YACW,gBAAgB;IAuC9B;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IA2CxB;;;;;;;OAOG;YACW,SAAS;IAsCvB;;;;;;;;OAQG;YACW,SAAS;IAwCvB;;;;;;OAMG;IACU,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CA6CnD"}
|
|
@@ -33,9 +33,20 @@ class LogStorageExternalS3Service extends log_storage_external_service_1.LogStor
|
|
|
33
33
|
* @var {Promise<any> | null}
|
|
34
34
|
*/
|
|
35
35
|
this.credentialsCache = null;
|
|
36
|
+
/**
|
|
37
|
+
* @var {number}
|
|
38
|
+
*/
|
|
39
|
+
this.maxRetries = 3;
|
|
40
|
+
/**
|
|
41
|
+
* @var {number}
|
|
42
|
+
*/
|
|
43
|
+
this.baseDelay = 1000;
|
|
36
44
|
this.config = (0, log_storage_external_s3_config_1.getLogStorageExternalS3Config)();
|
|
37
45
|
const firehoseConfig = {
|
|
38
46
|
region: this.config.region,
|
|
47
|
+
requestTimeout: 30000,
|
|
48
|
+
maxAttempts: 3,
|
|
49
|
+
retryMode: 'adaptive'
|
|
39
50
|
};
|
|
40
51
|
if (this.config.roleArn) {
|
|
41
52
|
firehoseConfig.credentials = () => this.getAssumeRoleCredentials();
|
|
@@ -109,7 +120,9 @@ class LogStorageExternalS3Service extends log_storage_external_service_1.LogStor
|
|
|
109
120
|
DurationSeconds: 3600, // 1 hour
|
|
110
121
|
});
|
|
111
122
|
try {
|
|
112
|
-
const response = await
|
|
123
|
+
const response = await this.retryWithBackoff(async () => {
|
|
124
|
+
return stsClient.send(command);
|
|
125
|
+
});
|
|
113
126
|
if (!response.Credentials) {
|
|
114
127
|
throw new log_error_1.LogError('Failed to retrieve credentials from STS AssumeRole');
|
|
115
128
|
}
|
|
@@ -121,11 +134,97 @@ class LogStorageExternalS3Service extends log_storage_external_service_1.LogStor
|
|
|
121
134
|
};
|
|
122
135
|
}
|
|
123
136
|
catch (error) {
|
|
124
|
-
console.error('Failed to assume role:',
|
|
137
|
+
console.error('Failed to assume role after all retries:', {
|
|
138
|
+
error: error.message,
|
|
139
|
+
code: error.code,
|
|
140
|
+
statusCode: error.$metadata?.httpStatusCode,
|
|
141
|
+
retryable: this.isRetryableError(error)
|
|
142
|
+
});
|
|
125
143
|
this.credentialsCache = null;
|
|
126
144
|
throw error;
|
|
127
145
|
}
|
|
128
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Sleep for specified milliseconds
|
|
149
|
+
*
|
|
150
|
+
* @param {number} ms - Milliseconds to sleep
|
|
151
|
+
*
|
|
152
|
+
* @returns {Promise<void>}
|
|
153
|
+
*/
|
|
154
|
+
sleep(ms) {
|
|
155
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Retry function with exponential backoff
|
|
159
|
+
*
|
|
160
|
+
* @param {Function} operation - The operation to retry
|
|
161
|
+
* @param {number} retries - Number of retries remaining
|
|
162
|
+
* @param {number} delay - Current delay in milliseconds
|
|
163
|
+
*
|
|
164
|
+
* @returns {Promise<any>}
|
|
165
|
+
*/
|
|
166
|
+
async retryWithBackoff(operation, retries = this.maxRetries, delay = this.baseDelay) {
|
|
167
|
+
try {
|
|
168
|
+
return await operation();
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
if (retries === 0) {
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
174
|
+
const isRetryable = this.isRetryableError(error);
|
|
175
|
+
if (!isRetryable) {
|
|
176
|
+
throw error;
|
|
177
|
+
}
|
|
178
|
+
console.warn(`Firehose operation failed, retrying in ${delay}ms. Retries left: ${retries}`, {
|
|
179
|
+
error: error.message,
|
|
180
|
+
code: error.code
|
|
181
|
+
});
|
|
182
|
+
await this.sleep(delay);
|
|
183
|
+
const jitter = Math.random() * 0.1 * delay;
|
|
184
|
+
const nextDelay = delay * 2 + jitter;
|
|
185
|
+
return this.retryWithBackoff(operation, retries - 1, nextDelay);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Check if error is retryable
|
|
190
|
+
*
|
|
191
|
+
* @param {any} error - The error to check
|
|
192
|
+
*
|
|
193
|
+
* @returns {boolean}
|
|
194
|
+
*/
|
|
195
|
+
isRetryableError(error) {
|
|
196
|
+
const retryableCodes = [
|
|
197
|
+
'ECONNRESET',
|
|
198
|
+
'ECONNREFUSED',
|
|
199
|
+
'ETIMEDOUT',
|
|
200
|
+
'EPIPE',
|
|
201
|
+
'EHOSTUNREACH',
|
|
202
|
+
'ENETUNREACH',
|
|
203
|
+
'EAI_AGAIN'
|
|
204
|
+
];
|
|
205
|
+
const retryableMessages = [
|
|
206
|
+
'socket hang up',
|
|
207
|
+
'network timeout',
|
|
208
|
+
'connection timeout',
|
|
209
|
+
'write EPIPE',
|
|
210
|
+
'read ECONNRESET'
|
|
211
|
+
];
|
|
212
|
+
if (error.code
|
|
213
|
+
&&
|
|
214
|
+
retryableCodes.includes(error.code)) {
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
if (error.message) {
|
|
218
|
+
const message = error.message.toLowerCase();
|
|
219
|
+
return retryableMessages.some(msg => message.includes(msg));
|
|
220
|
+
}
|
|
221
|
+
if (error.$metadata?.httpStatusCode) {
|
|
222
|
+
const statusCode = error.$metadata.httpStatusCode;
|
|
223
|
+
return statusCode >= 500
|
|
224
|
+
|| statusCode === 429;
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
129
228
|
/**
|
|
130
229
|
* Upload log content to Firehose (which delivers to S3)
|
|
131
230
|
*
|
|
@@ -143,14 +242,21 @@ class LogStorageExternalS3Service extends log_storage_external_service_1.LogStor
|
|
|
143
242
|
const logEntry = log_service_1.LogService.formatLog(log);
|
|
144
243
|
return { Data: Buffer.from(logEntry + '\n', 'utf8') };
|
|
145
244
|
});
|
|
146
|
-
await this.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
245
|
+
await this.retryWithBackoff(async () => {
|
|
246
|
+
return this.firehose.send(new client_firehose_1.PutRecordBatchCommand({
|
|
247
|
+
DeliveryStreamName: this.config.firehoseStreamName,
|
|
248
|
+
Records: records
|
|
249
|
+
}));
|
|
250
|
+
});
|
|
150
251
|
}
|
|
151
252
|
}
|
|
152
253
|
catch (error) {
|
|
153
|
-
console.error(`Failed to upload log to Firehose: ${key}`,
|
|
254
|
+
console.error(`Failed to upload log to Firehose after all retries: ${key}`, {
|
|
255
|
+
error: error.message,
|
|
256
|
+
code: error.code,
|
|
257
|
+
statusCode: error.$metadata?.httpStatusCode,
|
|
258
|
+
retryable: this.isRetryableError(error)
|
|
259
|
+
});
|
|
154
260
|
throw error;
|
|
155
261
|
}
|
|
156
262
|
}
|
|
@@ -170,7 +276,15 @@ class LogStorageExternalS3Service extends log_storage_external_service_1.LogStor
|
|
|
170
276
|
await this.uploadLog(key, data);
|
|
171
277
|
}
|
|
172
278
|
catch (error) {
|
|
173
|
-
console.error(`Failed to send log to Firehose: ${key}`,
|
|
279
|
+
console.error(`Failed to send log to Firehose: ${key}`, {
|
|
280
|
+
error: error.message,
|
|
281
|
+
code: error.code,
|
|
282
|
+
statusCode: error.$metadata?.httpStatusCode,
|
|
283
|
+
requestId: error.$metadata?.requestId,
|
|
284
|
+
retryable: this.isRetryableError(error),
|
|
285
|
+
batchSize: data.length,
|
|
286
|
+
timestamp: new Date().toISOString()
|
|
287
|
+
});
|
|
174
288
|
throw error;
|
|
175
289
|
}
|
|
176
290
|
finally {
|
|
@@ -190,10 +304,29 @@ class LogStorageExternalS3Service extends log_storage_external_service_1.LogStor
|
|
|
190
304
|
async write(data) {
|
|
191
305
|
try {
|
|
192
306
|
const combinedFilePath = this.getCombinedLogFilePath();
|
|
307
|
+
console.debug(`Attempting to write ${data.length} log entries to Firehose`, {
|
|
308
|
+
stream: this.config.firehoseStreamName,
|
|
309
|
+
region: this.config.region,
|
|
310
|
+
filePath: combinedFilePath,
|
|
311
|
+
timestamp: new Date().toISOString()
|
|
312
|
+
});
|
|
193
313
|
await this.appendLog(combinedFilePath, data);
|
|
314
|
+
console.debug(`Successfully wrote ${data.length} log entries to Firehose`, {
|
|
315
|
+
stream: this.config.firehoseStreamName,
|
|
316
|
+
timestamp: new Date().toISOString()
|
|
317
|
+
});
|
|
194
318
|
}
|
|
195
319
|
catch (error) {
|
|
196
|
-
console.error('Failed to write log to Firehose/S3 storage:',
|
|
320
|
+
console.error('Failed to write log to Firehose/S3 storage:', {
|
|
321
|
+
error: error.message,
|
|
322
|
+
code: error.code,
|
|
323
|
+
statusCode: error.$metadata?.httpStatusCode,
|
|
324
|
+
requestId: error.$metadata?.requestId,
|
|
325
|
+
stream: this.config.firehoseStreamName,
|
|
326
|
+
region: this.config.region,
|
|
327
|
+
retryable: this.isRetryableError(error),
|
|
328
|
+
timestamp: new Date().toISOString()
|
|
329
|
+
});
|
|
197
330
|
throw error;
|
|
198
331
|
}
|
|
199
332
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.storage.external.s3.service.js","sourceRoot":"","sources":["../../src/services/log.storage.external.s3.service.ts"],"names":[],"mappings":";;;AAAA,8DAAiF;AACjF,oDAAmE;AACnE,iFAA2E;AAG3E,+CAA2C;AAE3C,8FAA0F;AAC1F,mDAA+C;AAE/C;;;;;;;;;GASG;AACH,MAAa,2BAA4B,SAAQ,wDAAyB;
|
|
1
|
+
{"version":3,"file":"log.storage.external.s3.service.js","sourceRoot":"","sources":["../../src/services/log.storage.external.s3.service.ts"],"names":[],"mappings":";;;AAAA,8DAAiF;AACjF,oDAAmE;AACnE,iFAA2E;AAG3E,+CAA2C;AAE3C,8FAA0F;AAC1F,mDAA+C;AAE/C;;;;;;;;;GASG;AACH,MAAa,2BAA4B,SAAQ,wDAAyB;IAgCxE;;;;OAIG;IACH,YAAa,gBAA2C;QAEtD,KAAK,CAAE,gBAAgB,CAAC,CAAC;QA3B3B;;WAEG;QACK,eAAU,GAA+B,IAAI,GAAG,EAAE,CAAC;QAE3D;;WAEG;QACK,qBAAgB,GAAwB,IAAI,CAAC;QAErD;;WAEG;QACc,eAAU,GAAW,CAAC,CAAC;QAExC;;WAEG;QACc,cAAS,GAAW,IAAI,CAAC;QAWxC,IAAI,CAAC,MAAM,GAAG,IAAA,8DAA6B,GAAE,CAAC;QAE9C,MAAM,cAAc,GAAQ;YAC1B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,cAAc,EAAE,KAAK;YACrB,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,UAAU;SACtB,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACxB,cAAc,CAAC,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC;QACrE,CAAC;aAAM,IACL,IAAI,CAAC,MAAM,CAAC,WAAW;eACpB,IAAI,CAAC,MAAM,CAAC,eAAe,EAC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ClB,gBAAgB,EAChB,IAAI,CACL,CAAC;YAEF,OAAO,CAAC,KAAK,CACX,sBAAsB,IAAI,CAAC,MAAM,0BAA0B,EAC3D;gBACE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB;gBACtC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CACX,6CAA6C,EAC7C;gBACE,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,cAAc;gBAC3C,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS;gBACrC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB;gBACtC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;gBAC1B,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;gBACvC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CACF,CAAC;YAEF,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA5aD,kEA4aC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicollasfrazao/liguelead-log-service",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.10",
|
|
4
4
|
"description": "A standalone logging service for Express applications with multi-destination storage (local files + S3 via Kinesis Firehose) and comprehensive request tracking using strategy pattern.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|