Skip to content

Conversation

sanjuyadav24
Copy link
Contributor

@sanjuyadav24 sanjuyadav24 commented Aug 21, 2025

Context

This PR updates the Tracing class to support operation names, this is a prerequisite for the Enhanced Tracing class


Description

  • Updated Tracing class to accept and propagate operation names.
  • Updated all relevant trace calls to include operation names where applicable.
[Agent Code]
    |
    v
+---------------------+
| Tracing.Verbose()   |  (agent/src/Microsoft.VisualStudio.Services.Agent/Tracing.cs)
+---------------------+
    |
    v
+---------------------+
| Tracing.Trace()     |  (protected method in Tracing.cs)
+---------------------+
    |
    v
+---------------------+
| _traceSource.TraceEvent() |  (System.Diagnostics.TraceSource)
+---------------------+
    |
    v
+---------------------+
| TraceSource.Switch.ShouldTrace(eventType) | (System.Diagnostics.SourceSwitch)
|   - Compares eventType (Verbose, Info, etc.)
|   - To SourceSwitch.Level (set from TraceSetting)
+---------------------+
    |
   / \
  /   \
Yes    No
 |      |
 v      v
+---------------------+    (Message is ignored)
| Forwards to         |
| TraceListener(s)    |  (e.g., HostTraceListener, Console, File)
+---------------------+
    |
    v
+---------------------+
| Output to log file, |
| console, etc.       |
+---------------------+

Risk Assessment (Low)

  • Low risk: Changes are mostly additive and backward compatible.
  • The update touches core tracing infrastructure, but usage is well-covered by existing tests and is not expected to impact agent runtime behavior.

Unit Tests Added or Updated (No)


Additional Testing Performed

  • Manual validation of trace output in local and test environments.
  • Ran integration and scenario tests to ensure no regressions in logging behavior.

Change Behind Feature Flag (No)

  • This change is not behind a feature flag as it is a core infrastructure improvement and does not alter user-facing features or APIs.

Tech Design / Approach


Documentation Changes Required (No)

  • No user-facing documentation changes are required.
  • Internal developer documentation on tracing has been updated as part of the code comments.

Logging Added/Updated (Yes)

  • Logging has been enhanced to include operation names in trace messages.
  • Log statements have been reviewed to ensure no sensitive data is exposed.
  • Log levels are used appropriately (info, warn, error).

Telemetry Added/Updated (No)

  • No new telemetry events were added as part of this change.
  • Existing telemetry remains unaffected.

Rollback Scenario and Process (Yes)

  • The change can be rolled back by reverting the commit if any issues are discovered.
  • No data migrations or irreversible changes are involved.

Dependency Impact Assessed and Regression Tested (Yes)

  • All impacted modules and dependencies were reviewed.
  • Regression tests were executed to confirm no breakage in existing functionality.

@sanjuyadav24
Copy link
Contributor Author

/azp run

@sanjuyadav24 sanjuyadav24 marked this pull request as ready for review August 21, 2025 08:26
@sanjuyadav24 sanjuyadav24 requested review from a team as code owners August 21, 2025 08:26
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sanjuyadav24
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sanjuyadav24
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sanjuyadav24
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sanjuyadav24
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sanjuyadav24 sanjuyadav24 merged commit f4175a3 into master Sep 2, 2025
22 checks passed
@sanjuyadav24 sanjuyadav24 deleted the user/sanjuyadav/logging_enhancement_base branch September 2, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants