Skip to content

feat(telemetry): enable audit mode for telemetry - #1858

Merged
Hweinstock merged 5 commits into
aws:refactorfrom
Hweinstock:feat/audit-mode
Jul 29, 2026
Merged

feat(telemetry): enable audit mode for telemetry#1858
Hweinstock merged 5 commits into
aws:refactorfrom
Hweinstock:feat/audit-mode

Conversation

@Hweinstock

@Hweinstock Hweinstock commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Problem

The current CLI does not support audit mode. Audit mode allows customers to inspect the telemetry sent without enabling telemetry.

Solution

  • implement a MetricSink that continually appends data to a file.
  • audit mode relies on a global config flag that defaults to false.

Tests and Verification

  • updated unit tests to cover both sinks and verify that audit respects customer's settings.
> rm -rf ~/.agentcore/telemetry
> agentcore config telemetry.audit true
true 
> cat ~/.agentcore/telemetry/* | jq
{
  "metricName": "cli.command_run",
  "value": 29,
  "attrs": {
    "service.name": "agentcore-cli",
    "service.version": "0.0.0",
    "agentcore-cli.installation_id": "42edb4ee-1d41-42cf-96ab-195b0356e05a",
    "agentcore-cli.session_id": "61670d19-1359-46ab-98f9-226db0638353",
    "os.type": "Linux",
    "os.version": "6.12.94-123.190.amzn2023.x86_64",
    "host.arch": "x64",
    "node.version": "v24.3.0",
    "exit_reason": "success"
  }
}

@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Jul 29, 2026
@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.02%. Comparing base (21353dd) to head (fb6882e).
⚠️ Report is 2 commits behind head on refactor.

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1858      +/-   ##
============================================
+ Coverage     95.00%   95.02%   +0.01%     
============================================
  Files           161      161              
  Lines          7691     7720      +29     
============================================
+ Hits           7307     7336      +29     
  Misses          384      384              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Hweinstock
Hweinstock force-pushed the feat/audit-mode branch 2 times, most recently from cf993cb to ea92723 Compare July 29, 2026 16:42
@Hweinstock
Hweinstock marked this pull request as ready for review July 29, 2026 17:11

@notgitika notgitika left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one issue otherwise LGTM!

Comment thread src/telemetry/client.tsx Outdated

@notgitika notgitika left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@aidandaly24 aidandaly24 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. All makes sense and works well from my manual testing.

@Hweinstock
Hweinstock merged commit 034ad39 into aws:refactor Jul 29, 2026
8 checks passed
@Hweinstock
Hweinstock deleted the feat/audit-mode branch July 29, 2026 22:26
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.

4 participants