-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] edit w3c tracing context configurations on account and enable tracing into service exports #638
Conversation
…tracing into service exports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes needed, but also you need to add the allow trace for the stream import (with similar checks that will fail allow-trace on service import). See JWT pr for details: nats-io/jwt#216
cmd/editaccount.go
Outdated
} else { | ||
p.claim.Trace = &jwt.MsgTrace{} | ||
p.claim.Trace.Destination = jwt.Subject(p.traceContextSubject) | ||
r.AddOK("changed trace context subject to %d", p.claim.Trace.Sampling) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are supposed to show the change of the subject, but you use %d
and show the sampling value.
cmd/editaccount.go
Outdated
} | ||
// we already validated that the subject is there either existing or new | ||
p.claim.Trace.Sampling = int(p.traceContextSampling.Int64()) | ||
r.AddOK("changed trace context sampling to %d", p.claim.Trace.Sampling) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add to %d%%
to show it as a percentage, but it is ok this way too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some issues and tests missing. Also, do we need to add an "edit import" file? If not, does it mean that currently you can't modify a stream import, you would need to do what? delete and recreate?
@@ -542,7 +552,10 @@ func (p *AddImportParams) createImport() *jwt.Import { | |||
if p.service { | |||
im.Type = jwt.Service | |||
im.Share = p.share | |||
} else if p.allowTrace { | |||
im.AllowTrace = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it would not be im.AllowTrace = p.allowTrace
instead of true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the other functions are managing the flags, the import creation happens in createImport() which then sets it to be as it needs to be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry... I saw the else
of the if p.service
and I thought you were just processing stream properties here and always setting to true
without seeing that the else if p.allowTrace
. My bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -542,7 +552,10 @@ func (p *AddImportParams) createImport() *jwt.Import { | |||
if p.service { | |||
im.Type = jwt.Service | |||
im.Share = p.share | |||
} else if p.allowTrace { | |||
im.AllowTrace = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry... I saw the else
of the if p.service
and I thought you were just processing stream properties here and always setting to true
without seeing that the else if p.allowTrace
. My bad.
Fix #636