You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6e3f4eb
Browse filesBrowse the repository at this point in the historyBrowse files
docs(api): send directives as call metadata on a gRPC listener (MAG-3814)
The Directives page said directives are HTTP headers, and every example
was curl, so a gRPC client had no way to tell that lava-select-provider
works for it. It does: the gRPC listener passes call metadata through the
same directive parsing as an HTTP request (smart-router#415 adds the
regression test). The page now says so and shows the grpcurl / Go /
Python forms, plus that response headers come back as lowercase metadata.
Copy file name to clipboardExpand all lines: docs/api/directives.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: "Per-request header directives to bypass the cache, pin a specific
5
5
6
6
# Directives
7
7
8
-
Override Smart Router's default behaviour for a single request by setting HTTP headers. Use them when the default routing, caching, or timeout policy isn't what you want for this specific call.
8
+
Override Smart Router's default behaviour for a single request by setting request headers: HTTP headers, or call metadata on a gRPC listener ([Over gRPC](#over-grpc)). Use them when the default routing, caching, or timeout policy isn't what you want for this specific call.
9
9
10
10
## Request headers at a glance
11
11
@@ -44,6 +44,8 @@ curl -X POST http://127.0.0.1:3360 \
A gRPC listener reads the same directives from **call metadata**. gRPC sends metadata as HTTP/2 headers, and the router passes it through the same directive parsing as an HTTP request. Use the names above unchanged:
The [response headers](#response-headers) come back as response metadata with lowercase names. `lava-provider-address` names the upstream that served the call, and `grpcurl -v` prints it.
169
+
140
170
## Response headers
141
171
142
172
Smart Router annotates every response with metadata about how the relay was served. These are the primary signal for debugging routing and failover from the client side.
0 commit comments