diff --git a/doc/api/errors.md b/doc/api/errors.md
index f54ba1d9058c..458f7013b6a3 100644
--- a/doc/api/errors.md
+++ b/doc/api/errors.md
@@ -3381,7 +3381,8 @@ category.
### `ERR_TRACE_EVENTS_UNAVAILABLE`
The `node:trace_events` module could not be loaded because Node.js was compiled
-with the `--without-v8-platform` flag.
+with the `--without-v8-platform` flag, or because the process was initialized by
+an embedder that provides its own V8 platform.
diff --git a/lib/trace_events.js b/lib/trace_events.js
index b4b9be242737..c3645de66982 100644
--- a/lib/trace_events.js
+++ b/lib/trace_events.js
@@ -15,10 +15,14 @@ const {
} = require('internal/errors').codes;
const { ownsProcessState } = require('internal/worker');
-if (!hasTracing || !ownsProcessState)
+const {
+ CategorySet,
+ getEnabledCategories,
+ hasAgent,
+} = internalBinding('trace_events');
+if (!hasTracing || !ownsProcessState || !hasAgent())
throw new ERR_TRACE_EVENTS_UNAVAILABLE();
-const { CategorySet, getEnabledCategories } = internalBinding('trace_events');
const { customInspectSymbol } = require('internal/util');
const { format } = require('internal/util/inspect');
const {
diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc
index db0a37b85e13..5bddd7413e54 100644
--- a/src/node_trace_events.cc
+++ b/src/node_trace_events.cc
@@ -113,6 +113,10 @@ void NodeCategorySet::Disable(const FunctionCallbackInfo& args) {
}
}
+static void HasAgent(const FunctionCallbackInfo& args) {
+ args.GetReturnValue().Set(tracing::Agent::GetInstance() != nullptr);
+}
+
void GetEnabledCategories(const FunctionCallbackInfo& args) {
Environment* env = Environment::GetCurrent(args);
std::string categories =
@@ -162,6 +166,7 @@ void NodeCategorySet::Initialize(Local