proposal: Extracting/injecting trace info from/to headers#24
Conversation
753cf28 to
f724828
Compare
f724828 to
3fed19a
Compare
|
|
||
| object GrpcRequestHandler { | ||
| object keys { | ||
| val correlationId = io.grpc.Metadata.Key.of("X-Correlation-ID", io.grpc.Metadata.ASCII_STRING_MARSHALLER) |
There was a problem hiding this comment.
I think these fields should be configurable as well
There was a problem hiding this comment.
OK, I will add separate config for it.
There was a problem hiding this comment.
Oh, it's from previous changes. It is not actual for now. I misunderstood you. Now HTTP and gRPC have the same configuration, see file backend/mockingbird/src/main/scala/ru/tinkoff/tcb/mockingbird/api/Tracing.scala line 20. So, I will delete object keys, because it is unused.
There was a problem hiding this comment.
Removed, tracing for gRPC and HTTP have the same configuration. If you think that adding the separate config for extracting/injecting gRPC I will do it.
danslapman
left a comment
There was a problem hiding this comment.
GRPC headers should be configurable as well
3fed19a to
ab1b54f
Compare
Adding extracting tracing info from headers of HTTP and gRPC calls and
adding them to response headers.
The configuration example:
```
{
"tracing": {
"required": ["correlationId", "traceId"],
"incomingHeaders": {
"X-Trace-ID": "traceId",
"X-Request-ID": "traceId"
},
"outcomingHeaders": {
"correlationId": "X-Correlation-ID",
"traceId": "X-Trace-ID"
}
}
}
```
The required field contains the list of obligated tracing fields.
These fields always exist, it means when a client calls, the
mockingbird generates for these fields unique ID (UUID).
The incomingHeaders set matching between request headers that contain
tracing info and tracing field on the Mockingbird side. Comparing the
headers is case-insensitive. For the config above, if request contains
"X-Trace-ID" or "X-Request-ID", its value overrides generated value of
traceId field.
The outcomingHeaders specified which tracing fields should be returned
in response headers.
7825248 to
2067157
Compare
Adding extracting tracing info from headers of HTTP and gRPC calls and adding them to response headers.
The configuration example:
{ "tracing": { "required": ["correlationId", "traceId"], "incomingHeaders": { "X-Trace-ID": "traceId", "X-Request-ID": "traceId" }, "outcomingHeaders": { "correlationId": "X-Correlation-ID", "traceId": "X-Trace-ID" } } }The required field contains the list of obligated tracing fields. These fields always exist, it means when a client calls, the mockingbird generates for these fields unique ID (UUID).
The incomingHeaders set matching between request headers that contain tracing info and tracing field on the Mockingbird side. Comparing the headers is case-insensitive. For the config above, if request contains "X-Trace-ID" or "X-Request-ID", its value overrides generated value of traceId field.
The outcomingHeaders specified which tracing fields should be returned in response headers.
@mockingbird/maintainers