@testdriverai/runner 7.11.71-test → 7.11.73-test
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/lib/ably-service.js +2 -4
- package/package.json +1 -9
- package/sandbox-agent.js +0 -46
package/lib/ably-service.js
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
*/
|
|
21
21
|
const Ably = require('ably');
|
|
22
22
|
const Sentry = require('@sentry/node');
|
|
23
|
-
const betterstack = require('../../shared/betterstack-otel');
|
|
24
23
|
const http = require('http');
|
|
25
24
|
const https = require('https');
|
|
26
25
|
const { EventEmitter } = require('events');
|
|
@@ -56,11 +55,10 @@ async function uploadToS3(apiRoot, apiKey, sandboxId, payload, label = 'screensh
|
|
|
56
55
|
const fileName = `${label}-${Date.now()}.png`;
|
|
57
56
|
|
|
58
57
|
// Get presigned upload URL from API
|
|
59
|
-
// Propagate Sentry trace context (sentry-trace + baggage)
|
|
60
|
-
//
|
|
58
|
+
// Propagate Sentry trace context (sentry-trace + baggage) so this request
|
|
59
|
+
// appears under the active span in Sentry.
|
|
61
60
|
const traceHeaders = {
|
|
62
61
|
...(Sentry.getTraceData ? Sentry.getTraceData() : {}),
|
|
63
|
-
...betterstack.getTraceparentHeaders(sandboxId),
|
|
64
62
|
};
|
|
65
63
|
const uploadUrlResponse = await httpPost(apiRoot, '/api/v7/runner/upload-url', {
|
|
66
64
|
apiKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testdriverai/runner",
|
|
3
|
-
"version": "7.11.
|
|
3
|
+
"version": "7.11.73-test",
|
|
4
4
|
"description": "TestDriver Runner - Ably-based remote automation agent with Node.js automation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -28,14 +28,6 @@
|
|
|
28
28
|
"test:auto-upgrade": "cd ../sdk && npx vitest run --config vitest.runner.config.mjs runner/packer/test/auto-upgrade.test.mjs"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@opentelemetry/api": "^1.9.0",
|
|
32
|
-
"@opentelemetry/api-logs": "^0.208.0",
|
|
33
|
-
"@opentelemetry/exporter-logs-otlp-http": "^0.208.0",
|
|
34
|
-
"@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
|
|
35
|
-
"@opentelemetry/resources": "^2.2.0",
|
|
36
|
-
"@opentelemetry/sdk-logs": "^0.208.0",
|
|
37
|
-
"@opentelemetry/sdk-trace-base": "^2.2.0",
|
|
38
|
-
"@opentelemetry/sdk-trace-node": "^2.2.0",
|
|
39
31
|
"@sentry/node": "^10.37.0",
|
|
40
32
|
"ably": "^2.6.0",
|
|
41
33
|
"dashcam": "beta",
|
package/sandbox-agent.js
CHANGED
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
*/
|
|
34
34
|
require('dotenv').config();
|
|
35
35
|
const Sentry = require('@sentry/node');
|
|
36
|
-
const betterstack = require('../shared/betterstack-otel');
|
|
37
36
|
const crypto = require('crypto');
|
|
38
37
|
const fs = require('fs');
|
|
39
38
|
const os = require('os');
|
|
@@ -192,29 +191,6 @@ async function main() {
|
|
|
192
191
|
// for stable) BEFORE writing the config, so by this point we're up to date.
|
|
193
192
|
const config = await waitForConfig(300000);
|
|
194
193
|
|
|
195
|
-
// Propagate BetterStack OTLP credentials from the API-supplied config into the
|
|
196
|
-
// process env so betterstack-otel's createSpanProcessor()/init() can pick them
|
|
197
|
-
// up (the sandbox VM has no .env of its own).
|
|
198
|
-
if (config.betterstackSourceToken && !process.env.BETTERSTACK_SOURCE_TOKEN) {
|
|
199
|
-
process.env.BETTERSTACK_SOURCE_TOKEN = config.betterstackSourceToken;
|
|
200
|
-
}
|
|
201
|
-
if (config.betterstackIngestUrl && !process.env.BETTERSTACK_INGEST_URL) {
|
|
202
|
-
process.env.BETTERSTACK_INGEST_URL = config.betterstackIngestUrl;
|
|
203
|
-
}
|
|
204
|
-
if (config.betterstackErrorDsn && !process.env.BETTERSTACK_ERROR_DSN) {
|
|
205
|
-
process.env.BETTERSTACK_ERROR_DSN = config.betterstackErrorDsn;
|
|
206
|
-
}
|
|
207
|
-
if (config.betterstackForce && !process.env.TD_BETTERSTACK_FORCE) {
|
|
208
|
-
process.env.TD_BETTERSTACK_FORCE = 'true';
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Build BetterStack's span processor before Sentry.init so it attaches to
|
|
212
|
-
// Sentry's OTel provider (openTelemetrySpanProcessors) and mirrors 100% of spans.
|
|
213
|
-
const betterstackSpanProcessor = betterstack.createSpanProcessor({
|
|
214
|
-
service: 'runner',
|
|
215
|
-
version: require('./package.json').version,
|
|
216
|
-
});
|
|
217
|
-
|
|
218
194
|
// Initialize Sentry for distributed tracing
|
|
219
195
|
const sentryDsn = process.env.SENTRY_DSN || config.sentryDsn || 'https://452bd5a00dbd83a38ee8813e11c57694@o4510262629236736.ingest.us.sentry.io/4510480443637760';
|
|
220
196
|
const runnerChannel = config.sentryChannel || process.env.TD_CHANNEL;
|
|
@@ -223,7 +199,6 @@ async function main() {
|
|
|
223
199
|
const { version } = require('./package.json');
|
|
224
200
|
Sentry.init({
|
|
225
201
|
dsn: sentryDsn,
|
|
226
|
-
openTelemetrySpanProcessors: [betterstackSpanProcessor].filter(Boolean),
|
|
227
202
|
// Use tracesSampler to inherit parent sampling decisions
|
|
228
203
|
// This ensures SDK → API → Runner traces stay connected
|
|
229
204
|
tracesSampler: (samplingContext) => {
|
|
@@ -274,26 +249,6 @@ async function main() {
|
|
|
274
249
|
|
|
275
250
|
Sentry.setTag('sandbox', config.sandboxId);
|
|
276
251
|
log('Sentry initialized');
|
|
277
|
-
|
|
278
|
-
// Attach BetterStack after Sentry so it shares Sentry's OTel provider and
|
|
279
|
-
// the runner.session span/trace id above is exported to both backends.
|
|
280
|
-
betterstack.init({
|
|
281
|
-
service: 'runner',
|
|
282
|
-
version: require('./package.json').version,
|
|
283
|
-
attributes: {
|
|
284
|
-
'sandbox.id': config.sandboxId,
|
|
285
|
-
...(config.sessionId ? { 'session.id': config.sessionId } : {}),
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
// Forward errors to BetterStack's error app so releases populate.
|
|
289
|
-
betterstack.initErrorReporting({
|
|
290
|
-
service: 'runner',
|
|
291
|
-
version: require('./package.json').version,
|
|
292
|
-
attributes: {
|
|
293
|
-
'sandbox.id': config.sandboxId,
|
|
294
|
-
...(config.sessionId ? { 'session.id': config.sessionId } : {}),
|
|
295
|
-
},
|
|
296
|
-
});
|
|
297
252
|
}
|
|
298
253
|
log(`Sandbox ID: ${config.sandboxId}`);
|
|
299
254
|
log(`Transport: Ably`);
|
|
@@ -335,7 +290,6 @@ async function main() {
|
|
|
335
290
|
}
|
|
336
291
|
await ablyService.close();
|
|
337
292
|
automation.cleanup();
|
|
338
|
-
await betterstack.flush(2000);
|
|
339
293
|
await Sentry.close(2000);
|
|
340
294
|
process.exit(0);
|
|
341
295
|
};
|