Setting the file. One moment. Production · Apollo Router · apollographql/skills · Skills Docs ·
This file
- Number
- 8.17
- Position
- 17 of 27
- Type
- YAML
- Size
- 4 KB
- Lines
- 131
templates/v2/production.yaml
YAML·131 lines·4 KB
13
limit
:
512
14
15sandbox:
16 enabled: false
17
18homepage:
19 enabled: false
20
21health_check:
22 enabled: true
23 listen: 0.0.0.0:8088
24 path: /health
25
26include_subgraph_errors:
27 all: false
28
29# ── CORS (v2 policies schema) ──────────────────────────────────
30cors:
31 allow_credentials: true
32 methods:
33 - GET
34 - POST
35 - OPTIONS
36 max_age: 24h
37 policies:
38 - origins:
39 - https://app.example.com
40 - https://studio.apollographql.com
41 allow_headers:
42 - Content-Type
43 - Authorization
44
45# ── Authentication (v2: issuers is plural, array) ──────────────
46authentication:
47 router:
48 jwt:
49 jwks:
50 - url: ${env.JWKS_URL}
51 issuers:
52 - ${env.JWT_ISSUER}
53
54authorization:
55 require_authentication: true
56
57# ── Operation Limits ───────────────────────────────────────────
58# Tip: Start with warn_only: true to observe real traffic, then enforce.
59# Router default for max_depth is 100; 50 is a balanced starting point.
60limits:
61 http_max_request_bytes: 2000000
62 max_depth: 50
63 max_height: 200
64 max_aliases: 30
65 max_root_fields: 20
66 # warn_only: true # Uncomment during initial rollout to log without rejecting
67
68# ── Traffic Shaping ────────────────────────────────────────────
69# NOTE: global_rate_limit under `router:` limits CLIENT requests.
70# Under `all:` it limits SUBGRAPH requests from the router.
71traffic_shaping:
72 router:
73 timeout: 60s
74 global_rate_limit:
75 capacity: 1000
76 interval: 1s
77 all:
78 timeout: 30s
79
80# ── Header Propagation ─────────────────────────────────────────
81headers:
82 all:
83 request:
84 - propagate:
85 matching: "^(authorization|x-.*)$"
86
87# ── APQ ────────────────────────────────────────────────────────
88apq:
89 enabled: true
90 router:
91 cache:
92 in_memory:
93 limit: 512
94
95# ── Telemetry ──────────────────────────────────────────────────
96telemetry:
97 apollo:
98 client_name_header: apollographql-client-name
99 client_version_header: apollographql-client-version
100
101 exporters:
102 logging:
103 stdout:
104 enabled: true
105 format: json
106
107 metrics:
108 prometheus:
109 enabled: true
110 listen: 0.0.0.0:9090
111 path: /metrics
112
113 tracing:
114 otlp:
115 enabled: true
116 endpoint: ${env.OTEL_COLLECTOR_ENDPOINT:-http://otel-collector:4317}
117 protocol: grpc
118 common:
119 service_name: apollo-router
120 sampler: 0.1
121 propagation:
122 trace_context: true
123
124 instrumentation:
125 spans:
126 router:
127 attributes:
128 environment:
129 static_value: ${env.ENVIRONMENT:-production}
130 client:
131 request_header: x-client-id