-
Notifications
You must be signed in to change notification settings - Fork 592
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
Configuration for tracing in sources #3026
Configuration for tracing in sources #3026
Conversation
/hold requires pkg update after this one is merged knative/pkg#1228 |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
dad2909
to
14c5d86
Compare
/retest |
1 similar comment
/retest |
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.
A few nits.
My only real concerns are the obfuscated defaulting behind tracingconfig.JsonToTracingConfig
, and the fact that we require yet another env var to be set (I'd like optional better).
pkg/adapter/v2/config.go
Outdated
func (e *EnvConfig) SetupTracing(logger *zap.SugaredLogger) error { | ||
config, err := tracingconfig.JsonToTracingConfig(e.TracingConfigJson) | ||
if err != nil { | ||
logger.Error("Tracing configuration is invalid, using the no-op default", zap.Error(err)) |
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.
I see this message, but I don't see config = defaultNoopTracingConfig
. If this is hidden behind tracingconfig.JsonToTracingConfig
, I believe the method should be renamed to reflect the intention, or the API should be improved to avoid obfuscating the defaulting.
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.
For now it's godoc-ed that the method returns a default no-op configuration and I wanted to keep the consistency with the names of metrics and logging config. Since knative/pkg#1228 is already merged, if for you is fine, we can change this in a followup
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.
Sure that's fine for me, just wanted to point it out.
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Now it's optional and the default is a no-op valid configuration. |
/lgtm |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
The following is the coverage report on the affected files.
|
/retest |
/lgtm remove the hold if you are ready. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: n3wscott, slinkydeveloper The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
Signed-off-by: Francesco Guardiani francescoguard@gmail.com
Fixes #2978, depends on knative/pkg#1228
Proposed Changes
adapter.Main
(we have 3 of these) has a new tracing config getter. Controllers of sources should populate the tracing environment variable with the contents ofconfig-tracing
config map. By default the tracing configuration is no-op.ApiServerSource
, follow-up PRs will fix it for other sourcesRelease Note