Skip to content

Add SendPromptInInvokeAgentScopes option to OpenAI span processor - #181

Closed
Sergio Escalera (sergioescalera) with Copilot wants to merge 4 commits into
mainfrom
copilot/update-dotnet-sdk-parity
Closed

Add SendPromptInInvokeAgentScopes option to OpenAI span processor#181
Sergio Escalera (sergioescalera) with Copilot wants to merge 4 commits into
mainfrom
copilot/update-dotnet-sdk-parity

Conversation

Copilot AI commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

SDK parity with Node.js PR #121. Adds configuration to suppress LLM prompt content in InvokeAgent telemetry spans for privacy/security compliance.

Changes

  • OpenAISpanProcessorOptions: New configuration class with SendPromptInInvokeAgentScopes (defaults true)
  • OpenAISpanProcessor: Conditionally removes gen_ai.input.messages tag from InvokeAgent spans when option is false
  • BuilderExtensions.WithOpenAI(): Accepts optional OpenAISpanProcessorOptions parameter
  • Tests: 11 unit tests covering default behavior, suppression, scope filtering, edge cases

Usage

// Suppress prompt content in InvokeAgent telemetry
var options = new OpenAISpanProcessorOptions 
{ 
    SendPromptInInvokeAgentScopes = false 
};
builder.WithOpenAI(enableRelatedSources: true, options: options);

Scope is limited to InvokeAgent operations. Other scopes (ExecuteInference, ExecuteTool) remain unaffected. Backward compatible - defaults to current behavior.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/microsoft/Agent365-nodejs/pulls/121/files
    • Triggering command: /usr/bin/curl curl -s -H Accept: application/vnd.github.v3+json REDACTED (http block)
  • il-000000000000000000000000000000.00.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenan.t1.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant1.23.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.appsplatform.us
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.gov.powerplatform.microsoft.us
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.high.powerplatform.microsoft.us
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.powerplatform.eaglex.ic.gov
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.powerplatform.microsoft.scloud
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenant12.3.tenant.api.powerplatform.partner.microsoftonline.cn
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenantdiscoverynos.et.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • il-tenante.nv.tenant.api.powerplatform.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)
  • override.example.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/Microsoft.Agents.A365.Observability.Runtime.Tests.deps.json /home/REDACTED/work/Agent365-dotnet/Agent365-dotnet/src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/bin/Debug/net8.0/testhost.dll --port 34355 --endpoint 127.0.0.1:034355 --role client --parentprocessid 5013 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[SDK Parity] .NET/C# for PR microsoft/Agent365-nodejs#121</issue_title>
<issue_description>## SDK Parity Update Required

This issue was automatically created by the AI-First Polling workflow to maintain SDK parity.

Source PR Information

Original PR: microsoft/Agent365-nodejs#121 - Add option to auto instrumentation to prevent sending the LLM [FILTERED] …
PR URL: microsoft/Agent365-nodejs#121
PR Author: PengF (@fpfp100)

PR Description

[Node.js SDK] Add option to auto instrumentation to prevent sending the LLM [FILTERED] on InvokeAgent scopes.


Parity Task

Changes detected in: Node.js/TypeScript SDK
Target SDK: .NET/C#

Action Required

Please apply the changes described in the original PR (microsoft/Agent365-nodejs#121) to the .NET/C# SDK to maintain feature parity across all SDKs.

Before implementing:

  • First, check if this feature already exists in the .NET/C# SDK
  • If the feature is already implemented, close this issue with the wontfix label and add a comment explaining that parity already exists

For bug fixes (IMPORTANT):

  • Bug fixes require extra caution - only act if the same bug exists in the .NET/C# SDK
  • Carefully analyze whether the bug described in the original PR replicates in the target platform
  • If the bug does NOT exist in the .NET/C# SDK, close this issue with the wontfix label and explain that the bug is not present
  • Stay strictly in context - only fix the specific bug described, do not make additional changes or "improvements"
  • Do not port bug fixes that are specific to the source SDK's language or platform constraints

When creating the PR for this implementation:

  • Assign the PR to PengF (@fpfp100) (the author of the original PR)
  • Reference this issue in the PR description
  • Ensure the PR description explains what parity changes were made

Implementation Guidelines for .NET/C#

When implementing this feature in the .NET SDK:

  • Review existing code in dotnet/sdk/ to understand the codebase structure and patterns
  • Follow the coding style, naming conventions, and architectural patterns used in the .NET SDK
  • Check for configuration files (e.g., .editorconfig, Directory.Build.props) that define coding standards
  • Ensure your implementation is consistent with existing SDK components
  • Include appropriate tests following the testing patterns in the .NET SDK

Related Information


This is an automated issue. Please close with wontfix label if parity is not needed.</issue_description>

Comments on the Issue (you are Copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@sergioescalera

Copy link
Copy Markdown

🤖 Auto-Assignment

This PR was automatically assigned to PengF (@fpfp100) for review.

Reason: This is a parity implementation for issue #180, which was triggered by PengF (@fpfp100)'s original PR (microsoft/Agent365-nodejs#121).

Next Steps:

  • PengF (@fpfp100): Please review this implementation to ensure it matches your intent
  • Validate the parity changes are correct and complete
  • Approve and merge when satisfied

Automated by AI-First Polling Workflow

Copilot AI and others added 3 commits January 9, 2026 18:08
… processor

Co-authored-by: sergioescalera <8428450+sergioescalera@users.noreply.github.com>
…feature

Co-authored-by: sergioescalera <8428450+sergioescalera@users.noreply.github.com>
Co-authored-by: sergioescalera <8428450+sergioescalera@users.noreply.github.com>
Copilot AI changed the title [WIP] Update .NET/C# SDK for auto instrumentation feature Add SendPromptInInvokeAgentScopes option to OpenAI span processor Jan 9, 2026
@sergioescalera
Sergio Escalera (sergioescalera) deleted the copilot/update-dotnet-sdk-parity branch January 9, 2026 19:14
Copilot AI added a commit that referenced this pull request Feb 24, 2026
Port of Python PR #181. Enables explicit span timestamps for operations
recorded after completion (e.g., LangChain tracer using run.start_time/run.end_time).

Changes:
- OpenTelemetryScope: Add endTime constructor param to complement existing startTime
- ExecuteToolScope: Add startTime/endTime params to Start() method
- InferenceScope: Add startTime/endTime params to Start() method
- InvokeAgentScope: Add startTime/endTime params to Start() method
- OutputScope: Add startTime/endTime params to Start() method
- Added unit tests for custom time functionality

Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Nikhil Navakiran (nikhilNava) added a commit that referenced this pull request Feb 27, 2026
…205)

* Initial plan

* Add startTime and endTime parameters to OpenTelemetry scope classes

Port of Python PR #181. Enables explicit span timestamps for operations
recorded after completion (e.g., LangChain tracer using run.start_time/run.end_time).

Changes:
- OpenTelemetryScope: Add endTime constructor param to complement existing startTime
- ExecuteToolScope: Add startTime/endTime params to Start() method
- InferenceScope: Add startTime/endTime params to Start() method
- InvokeAgentScope: Add startTime/endTime params to Start() method
- OutputScope: Add startTime/endTime params to Start() method
- Added unit tests for custom time functionality

Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nikhilNava <211831449+nikhilNava@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDK Parity] .NET/C# for PR microsoft/Agent365-nodejs#121

3 participants