@adobe/spacecat-shared-utils 1.86.0 → 1.87.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/cdn-helpers.js +14 -2
- package/src/log-wrapper.js +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.87.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.86.0...@adobe/spacecat-shared-utils-v1.87.0) (2026-01-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* propagate traceId across workers for cross-worker tracing ([#1247](https://github.com/adobe/spacecat-shared/issues/1247)) ([f7d194d](https://github.com/adobe/spacecat-shared/commit/f7d194d2a8d23426c9dd66aae33f1118d226e827))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-utils-v1.86.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.85.2...@adobe/spacecat-shared-utils-v1.86.0) (2025-12-12)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/cdn-helpers.js
CHANGED
|
@@ -152,6 +152,17 @@ const CDN_TRANSFORMATIONS = {
|
|
|
152
152
|
'Compress logs': 'Yes',
|
|
153
153
|
HelpUrl: 'https://docs-cybersec.thalesgroup.com/bundle/cloud-application-security/page/siem-log-configuration.htm',
|
|
154
154
|
}),
|
|
155
|
+
'byocdn-other': (payload) => ({
|
|
156
|
+
'Bucket name': payload.bucketName,
|
|
157
|
+
Region: payload.region,
|
|
158
|
+
Path: `${payload.allowedPaths?.[0] || ''}<year>/<month>/<day>`,
|
|
159
|
+
'Access Key': payload.accessKey,
|
|
160
|
+
'Secret Key': payload.secretKey,
|
|
161
|
+
'Timestamp format': 'RFC3339',
|
|
162
|
+
'Log format': 'JSON lines (one log per line)',
|
|
163
|
+
Compression: 'Optional, but prefered. Please use Gzip compression if you decide to compress the log files.',
|
|
164
|
+
'Example of valid log line': '{"timestamp":"2025-12-01T13:00:05Z","host":"www.example.com","url":"/docs/getting-started","request_method":"GET","request_user_agent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.0; +https://openai.com/gptbot)","response_status":200,"request_referer":"https://www.chatgpt.com/","response_content_type":"text/html; charset=utf-8","time_to_first_byte":123}',
|
|
165
|
+
}),
|
|
155
166
|
};
|
|
156
167
|
|
|
157
168
|
/**
|
|
@@ -164,7 +175,8 @@ const CDN_TRANSFORMATIONS = {
|
|
|
164
175
|
*
|
|
165
176
|
* @param {Object} payload - The result from CDN-Logs-Infrastructure-Provisioning API
|
|
166
177
|
* @param {string} payload.logSource - The CDN type ('byocdn-fastly' | 'byocdn-akamai'
|
|
167
|
-
* | 'byocdn-cloudflare' | 'byocdn-cloudfront' | 'ams-cloudfront' | 'byocdn-imperva'
|
|
178
|
+
* | 'byocdn-cloudflare' | 'byocdn-cloudfront' | 'ams-cloudfront' | 'byocdn-imperva'
|
|
179
|
+
* | 'byocdn-other')
|
|
168
180
|
* @returns {Object} - The prepared log forwarding configuration parameters
|
|
169
181
|
* @throws {Error} - If logSource is not supported or missing
|
|
170
182
|
*/
|
|
@@ -193,7 +205,7 @@ const prettifyLogForwardingConfig = (payload) => {
|
|
|
193
205
|
throw new Error('allowedPaths is required in payload');
|
|
194
206
|
}
|
|
195
207
|
|
|
196
|
-
if (payload.logSource === 'byocdn-fastly' || payload.logSource === 'byocdn-akamai') {
|
|
208
|
+
if (payload.logSource === 'byocdn-fastly' || payload.logSource === 'byocdn-akamai' || payload.logSource === 'byocdn-other') {
|
|
197
209
|
if (!payload.accessKey) {
|
|
198
210
|
throw new Error('accessKey is required in payload');
|
|
199
211
|
}
|
package/src/log-wrapper.js
CHANGED
|
@@ -43,8 +43,9 @@ export function logWrapper(fn) {
|
|
|
43
43
|
markers.push(`[jobId=${jobId}]`);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// Extract traceId from
|
|
47
|
-
|
|
46
|
+
// Extract traceId: prioritize context.traceId (from SQS message propagation)
|
|
47
|
+
// over X-Ray segment (which is new for each Lambda invocation)
|
|
48
|
+
const traceId = context.traceId || getTraceId();
|
|
48
49
|
if (traceId) {
|
|
49
50
|
markers.push(`[traceId=${traceId}]`);
|
|
50
51
|
}
|