-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disableSend boolean config option to work, but not communicate …
…with APM server (#2127) Env var is ELASTIC_APM_DISABLE_SEND. Default is false. This feature is useful to use the APM agent for async context tracking, distributed tracing context propagation, and/or log enrichment with trace.id. When disableSend=true, attempts are made to limit unnecessary processing (like calculating metrics, encoding stacktraces, etc.). This also includes an improvement to the `agent configured correctly` log.trace that dumps the agent config.
- Loading branch information
Showing
13 changed files
with
337 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use strict' | ||
|
||
// A no-op (does nothing) Agent transport -- i.e. the APM server client API | ||
// provided by elastic-apm-http-client. This is used when `disableSend=true`. | ||
|
||
class NoopTransport { | ||
config (opts) {} | ||
|
||
addMetadataFilter (fn) {} | ||
|
||
sendSpan (span, cb) { | ||
if (cb) { | ||
process.nextTick(cb) | ||
} | ||
} | ||
|
||
sendTransaction (transaction, cb) { | ||
if (cb) { | ||
process.nextTick(cb) | ||
} | ||
} | ||
|
||
sendError (_error, cb) { | ||
if (cb) { | ||
process.nextTick(cb) | ||
} | ||
} | ||
|
||
sendMetricSet (metricset, cb) { | ||
if (cb) { | ||
process.nextTick(cb) | ||
} | ||
} | ||
|
||
flush (cb) { | ||
if (cb) { | ||
process.nextTick(cb) | ||
} | ||
} | ||
|
||
// Inherited from Writable, called in agent.js. | ||
destroy () {} | ||
} | ||
|
||
module.exports = { | ||
NoopTransport | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.