Skip to content

Commit 0db1d65

Browse files
deprecate serverless mini agent (#5751)
1 parent 1c17b95 commit 0db1d65

File tree

3 files changed

+0
-169
lines changed

3 files changed

+0
-169
lines changed

packages/dd-trace/src/proxy.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ class Tracer extends NoopProxy {
152152
}
153153
}
154154

155-
if (config.isGCPFunction || config.isAzureFunction) {
156-
require('./serverless').maybeStartServerlessMiniAgent(config)
157-
}
158-
159155
if (config.profiling.enabled !== 'false') {
160156
const { SSIHeuristics } = require('./profiling/ssi-heuristics')
161157
const ssiHeuristics = new SSIHeuristics(config)
Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,5 @@
11
'use strict'
22

3-
const log = require('./log')
4-
5-
function maybeStartServerlessMiniAgent (config) {
6-
if (process.platform !== 'win32' && process.platform !== 'linux') {
7-
log.error('Serverless Mini Agent is only supported on Windows and Linux.')
8-
return
9-
}
10-
11-
const rustBinaryPath = getRustBinaryPath(config)
12-
13-
const fs = require('fs')
14-
15-
log.debug(`Trying to spawn the Serverless Mini Agent at path: ${rustBinaryPath}`)
16-
17-
// trying to spawn with an invalid path will return a non-descriptive error, so we want to catch
18-
// invalid paths and log our own error.
19-
if (!fs.existsSync(rustBinaryPath)) {
20-
log.error('Serverless Mini Agent did not start. Could not find mini agent binary.')
21-
return
22-
}
23-
try {
24-
require('child_process').spawn(rustBinaryPath, { stdio: 'inherit' })
25-
} catch (err) {
26-
log.error('Error spawning mini agent process: %s', err.message)
27-
}
28-
}
29-
30-
function getRustBinaryPath (config) {
31-
if (process.env.DD_MINI_AGENT_PATH !== undefined) {
32-
return process.env.DD_MINI_AGENT_PATH
33-
}
34-
35-
const rustBinaryPathRoot = config.isGCPFunction ? '/workspace' : '/home/site/wwwroot'
36-
const rustBinaryPathOsFolder = process.platform === 'win32'
37-
? 'datadog-serverless-agent-windows-amd64'
38-
: 'datadog-serverless-agent-linux-amd64'
39-
40-
const rustBinaryExtension = process.platform === 'win32' ? '.exe' : ''
41-
42-
const rustBinaryPath =
43-
`${rustBinaryPathRoot}/node_modules/@datadog/sma/${rustBinaryPathOsFolder}/\
44-
datadog-serverless-trace-mini-agent${rustBinaryExtension}`
45-
46-
return rustBinaryPath
47-
}
48-
493
function getIsGCPFunction () {
504
const isDeprecatedGCPFunction = process.env.FUNCTION_NAME !== undefined && process.env.GCP_PROJECT !== undefined
515
const isNewerGCPFunction = process.env.K_SERVICE !== undefined && process.env.FUNCTION_TARGET !== undefined
@@ -69,9 +23,7 @@ function isInServerlessEnvironment () {
6923
}
7024

7125
module.exports = {
72-
maybeStartServerlessMiniAgent,
7326
getIsGCPFunction,
7427
getIsAzureFunction,
75-
getRustBinaryPath,
7628
isInServerlessEnvironment
7729
}

packages/dd-trace/test/serverless.spec.js

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)