Skip to content

traces metrics: send OAuth bearer token, request apm_generate_metrics by default | DAL-744 - #694

Merged
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/traces-metrics-oauth
Jul 31, 2026
Merged

traces metrics: send OAuth bearer token, request apm_generate_metrics by default | DAL-744#694
platinummonkey merged 2 commits into
DataDog:mainfrom
srosenthal-dd:stephen.rosenthal/traces-metrics-oauth

Conversation

@srosenthal-dd

@srosenthal-dd srosenthal-dd commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Flip pup traces metrics {list,get,create,update,delete} from make_api_no_auth! to make_api! so the OAuth bearer is actually sent.
  • Add apm_generate_metrics to default_scopes().
  • Add an AUTHENTICATION section to the command's help text.

Scope check

  • apm_read (GET routes) is already in default_scopes() -- no change needed.
  • apm_generate_metrics (POST/PATCH/DELETE routes) was not in default_scopes() or read_only_scopes(). Unlike scopes such as user_access_manage or logs_delete_data (deliberately excluded as broad/sensitive), this is a narrowly-scoped write permission comparable to rum_generate_metrics/logs_generate_metrics, both already requested by default -- so this PR adds it to default_scopes() rather than requiring --extra-scopes.

Test plan

  • cargo test traces passes
  • CI passes
  • Manually verify pup traces metrics list works with OAuth login (default scopes)

Jira: DAL-744

… by default

Flip from make_api_no_auth! to make_api! so the OAuth bearer is actually
sent, and add apm_generate_metrics to default_scopes() alongside the
existing apm_read, consistent with how other product write scopes
(rum_generate_metrics, logs_generate_metrics) are already requested by
default.
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review July 29, 2026 05:19
@srosenthal-dd
srosenthal-dd requested a review from a team as a code owner July 29, 2026 05:19
@srosenthal-dd
srosenthal-dd marked this pull request as draft July 29, 2026 05:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c507e4c13

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/traces.rs
Comment thread src/auth/types.rs
Addresses review feedback: cover ValidOAuthAccessToken on span-metrics
requests, and assert apm_generate_metrics is default-scoped but
excluded from read-only scopes.
@srosenthal-dd
srosenthal-dd marked this pull request as ready for review July 31, 2026 15:18
@platinummonkey
platinummonkey merged commit de659a6 into DataDog:main Jul 31, 2026
6 checks passed
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.

2 participants