isGrpcFilter is the simplest way to scope a Fluxzy rule to gRPC traffic. It checks the Content-Type header at the request stage and lets you attach any action to the matched exchanges. Use it as a building block when you want to debug, log or reshape RPC calls without affecting the rest of your HTTP traffic.
Reach for isGrpcFilter when you want to act on gRPC traffic specifically and leave plain HTTP or REST calls alone. gRPC sits on top of HTTP/2 with a Content-Type of application/grpc, and this filter inspects that header so you do not have to write a custom matcher.
Typical situations:
The filter evaluates on the requestHeaderReceivedFromClient scope, so the protocol decision is made before the body is forwarded. Combine it with hostFilter or pathFilter if you only want to scope to a specific service.
Apply a tag to all RPC calls so they appear grouped in the Fluxzy capture view, making it easier to filter them later.
rules:
- filter:
typeKind: IsGrpcFilter
actions:
- typeKind: ApplyTagAction
tag:
value: grpc
Some intermediaries silently downgrade to HTTP/1.1 which breaks gRPC. Force HTTP/2 on every RPC call to a specific host to make sure the framing stays intact.
rules:
- filter:
typeKind: FilterCollection
children:
- typeKind: IsGrpcFilter
- typeKind: HostFilter
pattern: rpc.example.com
actions:
- typeKind: ForceHttp2Action
Stream every gRPC exchange line to a separate log file so the RPC traffic is isolated from regular HTTP logs.
rules:
- filter:
typeKind: IsGrpcFilter
actions:
- typeKind: FileAppendAction
filename: /var/log/fluxzy/grpc.log
text: "{{exchange.url}} {{exchange.statusCode}}"
Select gRPC exchanges only. Filtering is made by inspecting value of Content-Type header.
Evaluation scope defines the timing where this filter will be applied.
requestHeaderReceivedFromClient This scope occurs the moment fluxzy parsed the request header receiveid from client
isGrpcFilter
This filter has no specific characteristic
The following table describes the customizable properties available for this filter:
| Property | Type | Description | DefaultValue |
|---|---|---|---|
| inverted | boolean | Negate the filter result | false |
The following examples apply a comment to the filtered exchange
Select only gRPC exchanges.
rules:
- filter:
typeKind: IsGrpcFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
Select all non-gRPC exchanges.
rules:
- filter:
typeKind: IsGrpcFilter
actions:
- typeKind: ApplyCommentAction
comment: filter was applied
View definition of IsGrpcFilter for .NET integration.
This filter has no related filter
It inspects the request Content-Type header. Any value starting with application/grpc is considered a gRPC exchange. This includes application/grpc+proto and application/grpc-web.
Yes. gRPC-Web sets Content-Type to application/grpc-web which still starts with application/grpc, so the filter matches. If you need to distinguish gRPC from gRPC-Web, use a requestHeaderFilter instead.
Yes. Set inverted: true to select every exchange that is not gRPC.
No. isGrpcFilter only looks at the Content-Type header, it does not decode the body. Use protobufRequestFilter or protobufResponseFilter when you need payload level matching.