Ana içeriğe geç
Listelenmeyen sayfa
Bu sayfa listelenmemiş. Arama motorları dizine eklemez ve yalnızca doğrudan bağlantısı olan kullanıcılar buna erişebilir.

2026.09.0 — Log Table ALTER Scripts

This page is unlisted — it is not linked from the sidebar or search, and is intended to be reached only via a direct link from the 2026.09.0 release notes.

Who needs this

This script is only relevant if your Apinizer installation writes API proxy traffic logs to a relational database via the SQL/JDBC traffic-log connector (Oracle, MySQL, PostgreSQL, or SQL Server).

If you use the Elasticsearch or MongoDB traffic-log connector, skip this page entirely — those connectors already carry the new columns and require no manual step.

What changed

Apinizer 2026.09.0 adds the AI Gateway, MCP Gateway, A2A Gateway, and routing-diagnostics observability columns to the log_ApiProxyTraffic table. These columns did not exist in 2026.04.0 (or any earlier version). New installations get them automatically via the CREATE TABLE script. Existing installations upgrading from 2026.04.0 (or an earlier 2026.04.x patch) must run the ALTER script below once, per environment database, before or during the 2026.09.0 rollout.

All new columns are nullable and sparse (NULL for traffic that doesn't involve AI/MCP/A2A features or routing diagnostics), so the ALTER is non-blocking and safe to run against a live table — no default backfill is required. The gateway write path is fail-soft: if a column is temporarily missing, that field is skipped rather than failing the log write.

When to run it

Run this once, against each configured SQL/JDBC traffic-log database, any time before or during the 2026.09.0 upgrade — it does not need to be run inside a maintenance window. Because the columns are nullable, older gateway workers still writing pre-upgrade log rows are unaffected. Test in a non-production environment first if you use a change-control process for DDL.

Oracle

ALTER TABLE log_ApiProxyTraffic ADD (
-- AI Gateway core request/response metrics
ai_provider VARCHAR2(64),
ai_model VARCHAR2(128),
ai_token_input NUMBER(19),
ai_token_output NUMBER(19),
ai_token_cached NUMBER(19),
ai_cost_micro NUMBER(19),
ai_first_token_ms NUMBER(19),
ai_tpot_ms NUMBER(19),
ai_total_latency_ms NUMBER(19),
ai_semantic_cache_hit NUMBER(1),
ai_guardrail_hit VARCHAR2(64),
ai_pii_detected NUMBER(1),
ai_finish_reason VARCHAR2(64),
ai_streaming NUMBER(1),
ai_tenant_credential_id VARCHAR2(64),
ai_trace_id VARCHAR2(64),
ai_failover_from VARCHAR2(64),
-- AI cost breakdown (input/output/cached)
ai_cost_input_micro NUMBER(19),
ai_cost_output_micro NUMBER(19),
ai_cost_cached_micro NUMBER(19),
-- MCP Gateway
mcp_tool_name VARCHAR2(128),
mcp_jsonrpc_id VARCHAR2(64),
-- Cloud vs On-Premise deployment type
ai_deployment_type VARCHAR2(32),
-- AI stage latency breakdown
ai_guardrail_total_ms NUMBER(19),
ai_inference_ms NUMBER(19),
ai_overhead_ms NUMBER(19),
-- Routing diagnostics
routing_failure_reason VARCHAR2(64),
routing_confidence VARCHAR2(16),
routing_exception_class VARCHAR2(255),
routing_exception_detail VARCHAR2(256),
rd_selection_ns NUMBER(19),
rd_dns_ns NUMBER(19),
rd_tcp_connect_ns NUMBER(19),
rd_tls_handshake_ns NUMBER(19),
rd_ttfb_ns NUMBER(19),
rd_body_read_ns NUMBER(19),
rd_pool_wait_ns NUMBER(19),
upstream_status_code NUMBER(5),
upstream_ip_port VARCHAR2(64),
connection_reused NUMBER(1),
ttfb_reached NUMBER(1),
gateway_worker VARCHAR2(128),
pool_leased NUMBER(5),
pool_pending NUMBER(5),
pool_available NUMBER(5),
pool_max NUMBER(5),
cfg_connect_timeout NUMBER(10),
cfg_read_timeout NUMBER(10),
cfg_conn_req_timeout NUMBER(10),
client_write_ms NUMBER(10),
-- A2A Gateway
a2a_task_id VARCHAR2(64),
a2a_context_id VARCHAR2(128),
a2a_task_state VARCHAR2(32),
-- AI quota overflow signals
ai_quota_soft_cap_hit NUMBER(10),
ai_quota_alert_hit NUMBER(1),
-- AI Guardrail category (jailbreak / safety-bypass classification)
ai_guardrail_category VARCHAR2(64),
-- AI Guardrail external service verdict (SAFE / UNSAFE / TIMEOUT)
ai_guardrail_verdict VARCHAR2(32)
);

MySQL

ALTER TABLE log_ApiProxyTraffic
ADD COLUMN ai_provider VARCHAR(64),
ADD COLUMN ai_model VARCHAR(128),
ADD COLUMN ai_token_input BIGINT,
ADD COLUMN ai_token_output BIGINT,
ADD COLUMN ai_token_cached BIGINT,
ADD COLUMN ai_cost_micro BIGINT,
ADD COLUMN ai_first_token_ms BIGINT,
ADD COLUMN ai_tpot_ms BIGINT,
ADD COLUMN ai_total_latency_ms BIGINT,
ADD COLUMN ai_semantic_cache_hit BOOLEAN,
ADD COLUMN ai_guardrail_hit VARCHAR(64),
ADD COLUMN ai_pii_detected BOOLEAN,
ADD COLUMN ai_finish_reason VARCHAR(64),
ADD COLUMN ai_streaming BOOLEAN,
ADD COLUMN ai_tenant_credential_id VARCHAR(64),
ADD COLUMN ai_trace_id VARCHAR(64),
ADD COLUMN ai_failover_from VARCHAR(64),
ADD COLUMN ai_cost_input_micro BIGINT,
ADD COLUMN ai_cost_output_micro BIGINT,
ADD COLUMN ai_cost_cached_micro BIGINT,
ADD COLUMN mcp_tool_name VARCHAR(128),
ADD COLUMN mcp_jsonrpc_id VARCHAR(64),
ADD COLUMN ai_deployment_type VARCHAR(32),
ADD COLUMN ai_guardrail_total_ms BIGINT,
ADD COLUMN ai_inference_ms BIGINT,
ADD COLUMN ai_overhead_ms BIGINT,
ADD COLUMN routing_failure_reason VARCHAR(64),
ADD COLUMN routing_confidence VARCHAR(16),
ADD COLUMN routing_exception_class VARCHAR(255),
ADD COLUMN routing_exception_detail VARCHAR(256),
ADD COLUMN rd_selection_ns BIGINT,
ADD COLUMN rd_dns_ns BIGINT,
ADD COLUMN rd_tcp_connect_ns BIGINT,
ADD COLUMN rd_tls_handshake_ns BIGINT,
ADD COLUMN rd_ttfb_ns BIGINT,
ADD COLUMN rd_body_read_ns BIGINT,
ADD COLUMN rd_pool_wait_ns BIGINT,
ADD COLUMN upstream_status_code SMALLINT,
ADD COLUMN upstream_ip_port VARCHAR(64),
ADD COLUMN connection_reused BOOLEAN,
ADD COLUMN ttfb_reached BOOLEAN,
ADD COLUMN gateway_worker VARCHAR(128),
ADD COLUMN pool_leased SMALLINT,
ADD COLUMN pool_pending SMALLINT,
ADD COLUMN pool_available SMALLINT,
ADD COLUMN pool_max SMALLINT,
ADD COLUMN cfg_connect_timeout INT,
ADD COLUMN cfg_read_timeout INT,
ADD COLUMN cfg_conn_req_timeout INT,
ADD COLUMN client_write_ms INT,
ADD COLUMN a2a_task_id VARCHAR(64),
ADD COLUMN a2a_context_id VARCHAR(128),
ADD COLUMN a2a_task_state VARCHAR(32),
ADD COLUMN ai_quota_soft_cap_hit INT,
ADD COLUMN ai_quota_alert_hit BOOLEAN,
ADD COLUMN ai_guardrail_category VARCHAR(64),
ADD COLUMN ai_guardrail_verdict VARCHAR(32);

PostgreSQL

ALTER TABLE log_ApiProxyTraffic
ADD COLUMN ai_provider VARCHAR(64),
ADD COLUMN ai_model VARCHAR(128),
ADD COLUMN ai_token_input BIGINT,
ADD COLUMN ai_token_output BIGINT,
ADD COLUMN ai_token_cached BIGINT,
ADD COLUMN ai_cost_micro BIGINT,
ADD COLUMN ai_first_token_ms BIGINT,
ADD COLUMN ai_tpot_ms BIGINT,
ADD COLUMN ai_total_latency_ms BIGINT,
ADD COLUMN ai_semantic_cache_hit BOOLEAN,
ADD COLUMN ai_guardrail_hit VARCHAR(64),
ADD COLUMN ai_pii_detected BOOLEAN,
ADD COLUMN ai_finish_reason VARCHAR(64),
ADD COLUMN ai_streaming BOOLEAN,
ADD COLUMN ai_tenant_credential_id VARCHAR(64),
ADD COLUMN ai_trace_id VARCHAR(64),
ADD COLUMN ai_failover_from VARCHAR(64),
ADD COLUMN ai_cost_input_micro BIGINT,
ADD COLUMN ai_cost_output_micro BIGINT,
ADD COLUMN ai_cost_cached_micro BIGINT,
ADD COLUMN mcp_tool_name VARCHAR(128),
ADD COLUMN mcp_jsonrpc_id VARCHAR(64),
ADD COLUMN ai_deployment_type VARCHAR(32),
ADD COLUMN ai_guardrail_total_ms BIGINT,
ADD COLUMN ai_inference_ms BIGINT,
ADD COLUMN ai_overhead_ms BIGINT,
ADD COLUMN routing_failure_reason VARCHAR(64),
ADD COLUMN routing_confidence VARCHAR(16),
ADD COLUMN routing_exception_class VARCHAR(255),
ADD COLUMN routing_exception_detail VARCHAR(256),
ADD COLUMN rd_selection_ns BIGINT,
ADD COLUMN rd_dns_ns BIGINT,
ADD COLUMN rd_tcp_connect_ns BIGINT,
ADD COLUMN rd_tls_handshake_ns BIGINT,
ADD COLUMN rd_ttfb_ns BIGINT,
ADD COLUMN rd_body_read_ns BIGINT,
ADD COLUMN rd_pool_wait_ns BIGINT,
ADD COLUMN upstream_status_code SMALLINT,
ADD COLUMN upstream_ip_port VARCHAR(64),
ADD COLUMN connection_reused BOOLEAN,
ADD COLUMN ttfb_reached BOOLEAN,
ADD COLUMN gateway_worker VARCHAR(128),
ADD COLUMN pool_leased SMALLINT,
ADD COLUMN pool_pending SMALLINT,
ADD COLUMN pool_available SMALLINT,
ADD COLUMN pool_max SMALLINT,
ADD COLUMN cfg_connect_timeout INTEGER,
ADD COLUMN cfg_read_timeout INTEGER,
ADD COLUMN cfg_conn_req_timeout INTEGER,
ADD COLUMN client_write_ms INTEGER,
ADD COLUMN a2a_task_id VARCHAR(64),
ADD COLUMN a2a_context_id VARCHAR(128),
ADD COLUMN a2a_task_state VARCHAR(32),
ADD COLUMN ai_quota_soft_cap_hit INTEGER,
ADD COLUMN ai_quota_alert_hit BOOLEAN,
ADD COLUMN ai_guardrail_category VARCHAR(64),
ADD COLUMN ai_guardrail_verdict VARCHAR(32);

SQL Server (MSSQL)

ALTER TABLE log_ApiProxyTraffic ADD
ai_provider NVARCHAR(64),
ai_model NVARCHAR(128),
ai_token_input BIGINT,
ai_token_output BIGINT,
ai_token_cached BIGINT,
ai_cost_micro BIGINT,
ai_first_token_ms BIGINT,
ai_tpot_ms BIGINT,
ai_total_latency_ms BIGINT,
ai_semantic_cache_hit BIT,
ai_guardrail_hit NVARCHAR(64),
ai_pii_detected BIT,
ai_finish_reason NVARCHAR(64),
ai_streaming BIT,
ai_tenant_credential_id NVARCHAR(64),
ai_trace_id NVARCHAR(64),
ai_failover_from NVARCHAR(64),
ai_cost_input_micro BIGINT,
ai_cost_output_micro BIGINT,
ai_cost_cached_micro BIGINT,
mcp_tool_name NVARCHAR(128),
mcp_jsonrpc_id NVARCHAR(64),
ai_deployment_type NVARCHAR(32),
ai_guardrail_total_ms BIGINT,
ai_inference_ms BIGINT,
ai_overhead_ms BIGINT,
routing_failure_reason NVARCHAR(64),
routing_confidence NVARCHAR(16),
routing_exception_class NVARCHAR(255),
routing_exception_detail NVARCHAR(256),
rd_selection_ns BIGINT,
rd_dns_ns BIGINT,
rd_tcp_connect_ns BIGINT,
rd_tls_handshake_ns BIGINT,
rd_ttfb_ns BIGINT,
rd_body_read_ns BIGINT,
rd_pool_wait_ns BIGINT,
upstream_status_code SMALLINT,
upstream_ip_port NVARCHAR(64),
connection_reused BIT,
ttfb_reached BIT,
gateway_worker NVARCHAR(128),
pool_leased SMALLINT,
pool_pending SMALLINT,
pool_available SMALLINT,
pool_max SMALLINT,
cfg_connect_timeout INT,
cfg_read_timeout INT,
cfg_conn_req_timeout INT,
client_write_ms INT,
a2a_task_id NVARCHAR(64),
a2a_context_id NVARCHAR(128),
a2a_task_state NVARCHAR(32),
ai_quota_soft_cap_hit INT,
ai_quota_alert_hit BIT,
ai_guardrail_category NVARCHAR(64),
ai_guardrail_verdict NVARCHAR(32);

Verification

After running the script, confirm the column count on log_ApiProxyTraffic increased by 57 and that a new AI/MCP/A2A traffic entry (once one occurs) populates the relevant columns instead of being silently skipped. No data backfill for historical rows is needed or possible — the new columns are NULL for all traffic logged before the ALTER ran.