-
Notifications
You must be signed in to change notification settings - Fork 7.2k
feat: metrics capabilities #8318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # codex-rs/core/tests/chat_completions_payload.rs # codex-rs/core/tests/chat_completions_sse.rs # codex-rs/core/tests/responses_headers.rs
There was a problem hiding this 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.
ℹ️ 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".
# Conflicts: # codex-rs/core/src/codex.rs
# Conflicts: # codex-rs/core/Cargo.toml
# Conflicts: # codex-rs/otel/src/traces/otel_provider.rs # docs/config.md # docs/example-config.md
codex-rs/otel/src/lib.rs
Outdated
| } | ||
| } | ||
|
|
||
| pub fn counter(&self, name: &str, inc: i64, tags: &[(&str, &str)]) -> MetricsResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we almost always ignore the return value of this method. Is it better to log internally and not force consumers to let _ =..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can make a wrapper yep
| - `auth_mode`: `swic` (AuthMode::ChatGPT) | `api` (AuthMode::ApiKey) | `unknown`. | ||
| - `model`: name of the model used. | ||
|
|
||
| ## Metrics catalog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is nice to have these in one place -- is there something we can do to prevent it getting stale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was thinking of that... I don't think this is trivial but we can probably build a build time checker
Will think on this...
| | `feature.duration_ms` | histogram | `feature`, `status` | End-to-end feature latency. | | ||
| | `feature.used` | counter | `feature` | Feature usage through `/` (e.g., `/undo`, `/review`, ...). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you derive counts from a histogram? Is there a reason to have both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite standard actually
Those are ingested "as-is" by statsig
# Conflicts: # codex-rs/core/src/client.rs # codex-rs/core/tests/chat_completions_payload.rs # codex-rs/core/tests/chat_completions_sse.rs # codex-rs/core/tests/responses_headers.rs # codex-rs/core/tests/suite/client.rs # codex-rs/otel/src/traces/otel_manager.rs
Add metrics capabilities to Codex. The
README.mdis up to date.This will not be merged with the metrics before this PR of course: #8350