{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "description": "Codex monitoring dashboard using OTLP-ingested metrics queried via CloudWatch PromQL", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, "id": null, "links": [], "liveNow": false, "panels": [ { "gridPos": { "h": 2, "w": 24, "x": 0, "y": 0 }, "id": 1, "options": { "content": "## Overview", "mode": "markdown" }, "title": "", "transparent": true, "type": "text" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 6, "x": 0, "y": 2 }, "id": 2, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "title": "Total Tokens", "type": "stat", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Tokens" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 6, "x": 6, "y": 2 }, "id": 3, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "title": "API Requests", "type": "stat", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.api_request\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Requests" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 6, "x": 12, "y": 2 }, "id": 4, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "title": "Active Users", "type": "stat", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "count(count by (\"@resource.user.email\")({__name__=\"codex.api_request\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "Users" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 6, "x": 18, "y": 2 }, "id": 5, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "title": "Conversation Turns", "type": "stat", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.conversation.turn.count\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Turns" } ] }, { "gridPos": { "h": 2, "w": 24, "x": 0, "y": 6 }, "id": 6, "options": { "content": "## Token Usage", "mode": "markdown" }, "title": "", "transparent": true, "type": "text" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 8 }, "id": 7, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage Over Time", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Tokens" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 8 }, "id": 8, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage by Type", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", token_type=\"input\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Input" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", token_type=\"output\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "B", "legendFormat": "Output" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", token_type=\"cached_input\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "C", "legendFormat": "Cached Input" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", token_type=\"reasoning_output\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "D", "legendFormat": "Reasoning Output" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 14 }, "id": 9, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage by Model", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (model)({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{model}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 14 }, "id": 10, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Top Users by Token Usage", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.user.email\")({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.user.email}}" } ] }, { "gridPos": { "h": 2, "w": 24, "x": 0, "y": 20 }, "id": 11, "options": { "content": "## API & Tool Activity", "mode": "markdown" }, "title": "", "transparent": true, "type": "text" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 0, "y": 22 }, "id": 12, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "API Requests by Outcome", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.api_request\", success=\"true\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Success" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.api_request\", success=\"false\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "B", "legendFormat": "Failure" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 8, "y": 22 }, "id": 13, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "API Requests by Model", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (model)({__name__=\"codex.api_request\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{model}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 16, "y": 22 }, "id": 14, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Conversation Turns Over Time", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.conversation.turn.count\", \"@resource.service.name\"=~\"codex.*\"})", "refId": "A", "legendFormat": "Turns" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "pieType": "donut" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 0, "y": 28 }, "id": 15, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" }, "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false } }, "title": "Tool Calls by Tool", "type": "piechart", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (tool)({__name__=\"codex.tool.call\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{tool}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 8, "y": 28 }, "id": 16, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Tool Call Outcomes", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (success)({__name__=\"codex.tool.call\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{success}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 8, "x": 16, "y": 28 }, "id": 17, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Approval Decisions", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (decision)({__name__=\"codex.approval.requested\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{decision}}" } ] }, { "gridPos": { "h": 2, "w": 24, "x": 0, "y": 34 }, "id": 18, "options": { "content": "## Performance & Latency", "mode": "markdown" }, "title": "", "transparent": true, "type": "text" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 6, "x": 0, "y": 36 }, "id": 19, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "title": "Cache Hit Rate", "type": "stat", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "sum({__name__=\"codex.turn.token_usage\", token_type=\"cached_input\", \"@resource.service.name\"=~\"codex.*\"}) / (sum({__name__=\"codex.turn.token_usage\", token_type=\"input\", \"@resource.service.name\"=~\"codex.*\"}) + sum({__name__=\"codex.turn.token_usage\", token_type=\"cached_input\", \"@resource.service.name\"=~\"codex.*\"})) * 100", "refId": "A", "legendFormat": "Cache Hit %" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 6, "w": 9, "x": 6, "y": 36 }, "id": 20, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Turn Latency (ms)", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.5, sum({__name__=\"codex.turn.e2e_duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "p50" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.9, sum({__name__=\"codex.turn.e2e_duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "B", "legendFormat": "p90" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.99, sum({__name__=\"codex.turn.e2e_duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "C", "legendFormat": "p99" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 6, "w": 9, "x": 15, "y": 36 }, "id": 21, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Time to First Token (ms)", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.5, sum({__name__=\"codex.turn.ttft.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "p50" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.9, sum({__name__=\"codex.turn.ttft.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "B", "legendFormat": "p90" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.99, sum({__name__=\"codex.turn.ttft.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "C", "legendFormat": "p99" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 42 }, "id": 22, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "API Request Latency p90 by Model (ms)", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.9, sum by (model)({__name__=\"codex.api_request.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{model}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 0, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "ms" }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 42 }, "id": 23, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Tool Call Latency (ms)", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.5, sum({__name__=\"codex.tool.call.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "p50" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.9, sum({__name__=\"codex.tool.call.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "B", "legendFormat": "p90" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "histogram_quantile(0.99, sum({__name__=\"codex.tool.call.duration_ms\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "C", "legendFormat": "p99" } ] }, { "gridPos": { "h": 2, "w": 24, "x": 0, "y": 48 }, "id": 24, "options": { "content": "## Organizational Breakdown", "mode": "markdown" }, "title": "", "transparent": true, "type": "text" }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 50 }, "id": 25, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage by Department", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.department\")({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.department}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 50 }, "id": 26, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage by Team", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.team.id\")({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.team.id}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 56 }, "id": 27, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "API Requests by Department", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.department\")({__name__=\"codex.api_request\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.department}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 56 }, "id": 28, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "API Requests by Team", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.team.id\")({__name__=\"codex.api_request\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.team.id}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 62 }, "id": 29, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage by Cost Center", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.cost_center\")({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.cost_center}}" } ] }, { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisPlacement": "auto", "drawStyle": "line", "fillOpacity": 10, "lineWidth": 2, "pointSize": 5, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 62 }, "id": 30, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "single" } }, "title": "Token Usage by Environment", "type": "timeseries", "targets": [ { "datasource": { "type": "grafana-amazonprometheus-datasource", "uid": "$datasource" }, "expr": "topk(10, sum by (\"@resource.environment\")({__name__=\"codex.turn.token_usage\", \"@resource.service.name\"=~\"codex.*\"}))", "refId": "A", "legendFormat": "{{@resource.environment}}" } ] } ], "schemaVersion": 36, "style": "dark", "tags": [ "codex", "otlp", "cloudwatch" ], "templating": { "list": [ { "current": {}, "hide": 0, "includeAll": false, "label": "Prometheus Datasource", "multi": false, "name": "datasource", "options": [], "query": "grafana-amazonprometheus-datasource", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Codex Dashboard", "uid": "codex-otlp", "version": 1, "weekStart": "" }