Skip to content

Persist AiGateway quota telemetry#67

Merged
Pigbibi merged 1 commit into
mainfrom
codex/persist-ai-gateway-observability
Jul 3, 2026
Merged

Persist AiGateway quota telemetry#67
Pigbibi merged 1 commit into
mainfrom
codex/persist-ai-gateway-observability

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • persist AiGateway quota telemetry under the service job directory
  • record accepted async Codex jobs and sync Codex executions in health metrics
  • configure the VPS unit with a stable quota store path

Why

The dashboard was operational but showed no quota/health activity after deploy because quota data was in-memory only and async job submissions were not represented in health endpoint metrics.

Validation

  • python3 -m ruff check .
  • python3 -m pytest tests -q
  • bash -n scripts/deploy_codex_audit_service.sh
  • git diff --check

Co-Authored-By: Codex <noreply@openai.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🤖 Codex PR Review

⚠️ Review skipped: The Codex review could not be completed.

Codex service request failed: 401 {"status": "error", "error": "OIDC repository is not allowed"}

Please ensure a human reviewer checks this PR before merging.

@Pigbibi Pigbibi merged commit 3b1cf96 into main Jul 3, 2026
4 checks passed
@Pigbibi Pigbibi deleted the codex/persist-ai-gateway-observability branch July 3, 2026 20:22

@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: 64c3918cfc

ℹ️ 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 service/quota.py
return
path.parent.mkdir(mode=0o700, parents=True, exist_ok=True)
payload = json.dumps(
{"records": {repo: record.to_dict() for repo, record in self._records.items()}},

This comment was marked as off-topic.

Comment thread service/quota.py
if not isinstance(records, dict):
return
self._records = {
repo: QuotaRecord.from_dict(item)

This comment was marked as off-topic.

reasoning_effort=reasoning_effort,
timeout=req.timeout_seconds,
)
get_health_monitor().record("/v1/ai/execute", time.time() - started, result.success, result.error if not result.success else "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record sync Codex exceptions in health metrics

Because the new health sample is written only after adapter.execute() returns, exceptions raised before a CodexResult is produced — for example the RuntimeError path when the codex CLI is missing on the service host — skip this call and are handled by the outer generic 500 path. In that dependency-failure scenario /v1/ai/execute failures do not appear in the health dashboard at all, so record the failed sample in an exception/finally path as well.

Useful? React with 👍 / 👎.

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