Skip to content

[codex] Add latency phase metrics#634

Merged
winhowes merged 5 commits intomainfrom
codex/add-latency-phase-metrics
Apr 24, 2026
Merged

[codex] Add latency phase metrics#634
winhowes merged 5 commits intomainfrom
codex/add-latency-phase-metrics

Conversation

@winhowes
Copy link
Copy Markdown
Owner

@winhowes winhowes commented Apr 23, 2026

What changed

  • renamed the old upstream latency metric to authtranslator_upstream_roundtrip_duration_seconds
  • added authtranslator_end_to_end_duration_seconds
  • added authtranslator_pre_proxy_duration_seconds
  • added authtranslator_response_processing_duration_seconds
  • updated the duration recorder, Prometheus export, tests, and observability docs to match the new metric model

Why

The old authtranslator_request_duration_seconds name implied total request latency, but the implementation only measured proxy handoff until an upstream response was received. That made it hard to reason about total client-visible latency versus latency AuthTranslator itself introduces.

Impact

  • dashboards and alerts using authtranslator_request_duration_seconds need to migrate to the new metric names
  • callers can now break latency down into request-side AuthTranslator overhead, upstream wait time, response-side AuthTranslator processing, and full end-to-end latency

Root cause

The existing metric name was broader than the timing window it actually captured, and the proxy did not emit separate timings for pre-proxy or response-side processing.

Validation

  • go test ./...

@winhowes winhowes marked this pull request as ready for review April 23, 2026 23:33
Copy link
Copy Markdown

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

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: 6c35e7a997

ℹ️ 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 app/main.go Outdated
@winhowes
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ 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".

@winhowes winhowes merged commit 6747e0f into main Apr 24, 2026
1 check passed
@winhowes winhowes deleted the codex/add-latency-phase-metrics branch April 24, 2026 01:06
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

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.

1 participant