Closed mahadzaryab1 closed 1 day ago
We create a migration guide document with a table that lists v1 CLI flags and the corresponding v2 config fields
this box is checked, is it correct?
We create a migration guide document with a table that lists v1 CLI flags and the corresponding v2 config fields
this box is checked, is it correct?
@yurishkuro The migration guide is linked in the PR description. Is that what you were asking? Let me know if I misunderstood.
@yurishkuro Should we do the migration for v1 to OTEL HTTP/GRPC configurations as part of this issue?
Sorry, not seeing migration guide.
On migrating servers - would be nice, minimize the differences. But ok to leave as is too.
Sorry, not seeing migration guide.
@yurishkuro Here it is. It was linked in the PR. My apologies if it wasn't very visible.
On migrating servers - would be nice, minimize the differences. But ok to leave as is too.
@yurishkuro It looks pretty doable for the most part. There's just one part that isn't super compatible. AdditionalHeaders
in v1 is of type map[string][]string
. On the other hand, ResponseHeaders
is of type map[string]configopaque.String
. Do you have any thoughts on this and if there's a way to consolidate them?
We can converge to OTEL ones. I doubt if our cli actually allows to specify []string for each header.
It was linked in the PR. My apologies if it wasn't very visible.
Thanks, I copied the migration guide to a document I own https://docs.google.com/document/d/1ydTrEtIqJZxGb0RBkUAW-ZIaHNijo1pZSrn1TDSK-LU/edit#
It was linked in the PR. My apologies if it wasn't very visible.
Thanks, I copied the migration guide to a document I own https://docs.google.com/document/d/1ydTrEtIqJZxGb0RBkUAW-ZIaHNijo1pZSrn1TDSK-LU/edit#
No worries! I've done the same for the rest of the PRs in case you wanted to copy those over as well.
It was linked in the PR. My apologies if it wasn't very visible.
Thanks, I copied the migration guide to a document I own https://docs.google.com/document/d/1ydTrEtIqJZxGb0RBkUAW-ZIaHNijo1pZSrn1TDSK-LU/edit#
@yurishkuro This is how the flag is specified
flagSet.Var(&config.StringSlice{}, queryAdditionalHeaders, `Additional HTTP response headers. Can be specified multiple times. Format: "Key: Value"`)
And initialized as follows:
stringSlice := v.GetStringSlice(queryAdditionalHeaders)
headers, err := stringSliceAsHeader(stringSlice)
if err != nil {
logger.Error("Failed to parse headers", zap.Strings("slice", stringSlice), zap.Error(err))
} else {
qOpts.AdditionalHeaders = headers
}
For mapping purposes, is it safe to only take the first element of the slice?
Format: "Key: Value"
I added a log statement and tried this:
$ SPAN_STORAGE_TYPE=memory go run ./cmd/query --query.additional-headers 'k:v' --query.additional-headers 'k1:v1,v2'
logged:
"msg":"Using response headers","headers":{"K":["v"],"K1":["v1,v2"]}}
So CLI allows giving the flag multiple times, and as a result it does not use ,
to split entries, but uses it to split values for a key (effectively replicating HTTP parsing, even uses the parser internally).
The OTEL's implementation does not really check what's inside the string, so it probably also supports multiple values. The response headers handler is automatically mounted by confighttp.ServerConfig.ToServer() - are we actually using this in query service? I think it would be nice if we did, but that might be a much bigger change (although worth it going forward).
@yurishkuro I see. So for mapping from CLI to v2, can we just take the first element of the slice and populate it in OTEL's response headers?
We currently aren't using ToServer
in the query service. Is that something that we want to tackle in this issue?
So for mapping from CLI to v2, can we just take the first element of the slice and populate it in OTEL's response headers?
No, you can join all values in a slice with a comma, that's how HTTP supports multi-valued headers
We currently aren't using ToServer in the query service. Is that something that we want to tackle in this issue?
I think it's interesting to see how well this change would work. We may actually run into functional gap - we allow running http and grpc server on the same port, but OTEL does not. This will be a breaking change for v2 anyway, we might as well do it now.
@yurishkuro anything else that we want to address as part of this issue? do we want to make the ToServer
change here or track that separately?
yes, we can track that separately, it's not a high priority. https://github.com/jaegertracing/jaeger/issues/6026
perfect! can we close this issue out then?
yes, thanks!
Requirement
In this issue, we want to align the configuration for the query service with OTEL (part of https://github.com/jaegertracing/jaeger/issues/5229)
Tasks / outcomes