Put tool payload capture config under plugin namespace

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2026-05-19 09:23:35 +02:00
parent 0422010a37
commit 828d3d4282
3 changed files with 20 additions and 23 deletions
+3 -3
View File
@@ -326,13 +326,13 @@ This flag is honored by every plugin that creates spans through the [Tracing Ser
### Capturing tool arguments and results
When `backend.tracing.capture.mcpActionsToolPayloads` is enabled, the tool's input arguments and output result are recorded on the span as `gen_ai.tool.call.arguments` and `gen_ai.tool.call.result`.
When `mcpActions.tracing.capture.toolPayload` is enabled, the tool's input arguments and output result are recorded on the span as `gen_ai.tool.call.arguments` and `gen_ai.tool.call.result`.
```yaml title="app-config.yaml"
backend:
mcpActions:
tracing:
capture:
mcpActionsToolPayloads: true # defaults to false
toolPayload: true # defaults to false
```
:::warning
+15 -17
View File
@@ -15,23 +15,6 @@
*/
export interface Config {
backend?: {
tracing?: {
capture?: {
/**
* When true, the MCP tool call's input arguments and output result
* are included on the MCP `tools/call` server span as
* `gen_ai.tool.call.arguments` and `gen_ai.tool.call.result`.
* These attributes are marked Opt-In by the OpenTelemetry GenAI
* semantic conventions because they may contain sensitive
* information (entity payloads, scaffolder inputs, free-form
* text). Defaults to false.
*/
mcpActionsToolPayloads?: boolean;
};
};
};
mcpActions?: {
/**
* Display name for the MCP server. Defaults to "backstage".
@@ -53,6 +36,21 @@ export interface Config {
*/
namespacedToolNames?: boolean;
tracing?: {
capture?: {
/**
* When true, the MCP tool call's input arguments and output result
* are included on the MCP `tools/call` server span as
* `gen_ai.tool.call.arguments` and `gen_ai.tool.call.result`.
* These attributes are marked Opt-In by the OpenTelemetry GenAI
* semantic conventions because they may contain sensitive
* information (entity payloads, scaffolder inputs, free-form
* text). Defaults to false.
*/
toolPayload?: boolean;
};
};
/**
* Named MCP servers, each exposed at /api/mcp-actions/v1/{key}.
* When not configured, the plugin serves a single server at /api/mcp-actions/v1.
+2 -3
View File
@@ -68,9 +68,8 @@ export const mcpPlugin = createBackendPlugin({
'mcpActions.namespacedToolNames',
);
const captureToolPayloads =
config.getOptionalBoolean(
'backend.tracing.capture.mcpActionsToolPayloads',
) ?? false;
config.getOptionalBoolean('mcpActions.tracing.capture.toolPayload') ??
false;
const mcpService = await McpService.create({
actions,