APISIX 变量
描述#
APISIX 除了支持 NGINX 变量外,自身也提供了一些变量。
变量列表#
| 变量名称 | 来源 | 描述 | 示例 |
|---|---|---|---|
| balancer_ip | core | 上游服务器的 IP 地址。 | 192.168.1.2 |
| balancer_port | core | 上游服务器的端口。 | 80 |
| consumer_name | core | 消费者的名称。 | |
| consumer_group_id | core | 消费者所在的组的 ID。 | |
| graphql_name | core | GraphQL 的 operation name。 | HeroComparison |
| graphql_operation | core | GraphQL 的操作类型。 | mutation |
| graphql_root_fields | core | GraphQL 最高级别的字段。 | ["hero"] |
| mqtt_client_id | mqtt-proxy | MQTT 协议中的客户端 ID。 | |
| route_id | core | APISIX 路由的 ID。 | |
| route_name | core | APISIX 路由的名称。 | |
| service_id | core | APISIX 服务的 ID。 | |
| service_name | core | APISIX 服务的名称。 | |
| redis_cmd_line | Redis | Redis 命令的内容。 | |
| rpc_time | xRPC | 在 RPC 请求级别所花费的时间。 |
当然,除上述变量外,你也可以创建自定义变量。