You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "timw (via GitHub)" <gi...@apache.org> on 2026/08/31 03:17:36 UTC

Re: [PR] gRPC directives for pekko-http [pekko-grpc]

timw commented on PR #615:
URL: https://github.com/apache/pekko-grpc/pull/615#issuecomment-5473258180

   Roughly the guts of our server route looks like this:
   
   ```
   concat(
   
     grpc {
       nocache {
         grpcSpan(otelTracer) {
             grpcServicesRoute
         }
       }
     },
   
     grpcWeb {
       nocache {
         handleRejections(corsRejectionHandler) {
           cors(corsSettings) {
             requireSTS {
               grpcSpan(otelTracer) {
                 grpcServicesRoute
               }
             }
           }
         }
       }
     },
   
     httpRoutes // <-- includes HTTP tracing around specific non-gRPC HTTP services
   )
   ```
   
   Ultimately this is just an ergonomic mapping on media types, so I can just internalise in my app, but as you can see you can quite quickly run into cases where particular directives should/must be applied to particular media type branches.
   
   For some it's correctness/safety (i.e. I don't want to apply STS headers and CORS for `grpc` requests), but some directives require up-front work and have a penalty if an inner route rejects a request (e.g. there's no API to cancel an OTEL span once create/registered, so you have to mark it as discarded and filter it in the exporter to suppress it).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org