Skip to content

feat: expose ability to publish otel metrics to remote endpoint#1244

Open
Hweinstock wants to merge 2 commits into
aws:mainfrom
Hweinstock:feat/allow-otel-endpoint-inject
Open

feat: expose ability to publish otel metrics to remote endpoint#1244
Hweinstock wants to merge 2 commits into
aws:mainfrom
Hweinstock:feat/allow-otel-endpoint-inject

Conversation

@Hweinstock
Copy link
Copy Markdown
Contributor

Description

Wire up the OtelMetricSink to the telemetry client when AGENTCORE_TELEMETRY_ENDPOINT is set (via env var or global config). This enables publishing CLI metrics to a remote OTLP-compatible endpoint. The endpoint can also be configured via telemetry.endpoint in the global config file.

Note: this is not enabling telemetry! The intent is to allow the team to manually add the endpoint to their config to start collecting some real data, users that do not explicitly edit their config with an endpoint will be unaffected.

Testing

verified metrics are making to to collector when injecting the endpoint. They are currently being dropped due to an issue in validation that has its own fix.

Related Issue

Closes #

Documentation PR

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions Bot added the size/m PR size: M label May 14, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.13.1.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-1244-tarball/aws-agentcore-0.13.1.tgz

Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

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

Thanks for wiring this up — the helper extraction and tests are nice. One concern that I think should be addressed before merge: the new isTelemetryEnabled duplicates and diverges from the existing resolveTelemetryPreference in src/cli/telemetry/config.ts, which is the source of truth used by the agentcore telemetry command. See inline comment for details.

Comment thread src/cli/telemetry/client-accessor.ts Outdated
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 14, 2026
@Hweinstock Hweinstock force-pushed the feat/allow-otel-endpoint-inject branch from 41eb4ad to 8285a60 Compare May 14, 2026 01:07
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels May 14, 2026
@Hweinstock Hweinstock force-pushed the feat/allow-otel-endpoint-inject branch from 8285a60 to 07bec2a Compare May 14, 2026 01:10
@Hweinstock Hweinstock closed this May 14, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels May 14, 2026
@Hweinstock Hweinstock reopened this May 14, 2026
@github-actions github-actions Bot added size/m PR size: M agentcore-harness-reviewing AgentCore Harness review in progress and removed size/m PR size: M labels May 14, 2026
Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

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

Looks good overall — the previous comment about reusing resolveTelemetryPreference has been addressed cleanly, and the test refactor away from temp config files is a nice simplification.

One issue worth thinking about before this gets used in practice: the validated endpoint and the OTLP exporter URL construction don't agree on what "the endpoint" means. See inline comment.

Comment thread src/cli/telemetry/config.ts
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 14, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels May 14, 2026
@Hweinstock Hweinstock marked this pull request as ready for review May 14, 2026 12:49
@Hweinstock Hweinstock requested a review from a team May 14, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants