Skip to content
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

Merged
merged 4 commits into from
Apr 29, 2020

Conversation

slinkydeveloper
Copy link
Contributor

@slinkydeveloper slinkydeveloper commented Apr 21, 2020

Signed-off-by: Francesco Guardiani francescoguard@gmail.com

Fixes #2978, depends on knative/pkg#1228

Proposed Changes

  • 🧽 Now 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 of config-tracing config map. By default the tracing configuration is no-op.
  • Configured tracing via config map for ApiServerSource, follow-up PRs will fix it for other sources

Release Note

- Configuration of tracing for sources does not default anymore to the zipkin included in istio
- Configuration of tracing for sources now uses config-tracing config map

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 21, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 21, 2020
@slinkydeveloper
Copy link
Contributor Author

/hold requires pkg update after this one is merged knative/pkg#1228

@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 21, 2020
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 25, 2020
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 27, 2020
@slinkydeveloper
Copy link
Contributor Author

/retest

1 similar comment
@slinkydeveloper
Copy link
Contributor Author

/retest

Copy link
Contributor

@antoineco antoineco left a 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 Show resolved Hide resolved
pkg/adapter/v2/config.go Outdated Show resolved Hide resolved
pkg/adapter/v2/config.go Outdated Show resolved Hide resolved
pkg/adapter/main.go Outdated Show resolved Hide resolved
pkg/adapter/main_message_adapter.go Outdated Show resolved Hide resolved
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))
Copy link
Contributor

@antoineco antoineco Apr 28, 2020

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.

pkg/adapter/v2/main.go Outdated Show resolved Hide resolved
pkg/reconciler/apiserversource/apiserversource.go Outdated Show resolved Hide resolved
pkg/reconciler/apiserversource/controller.go Outdated Show resolved Hide resolved
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper
Copy link
Contributor Author

the fact that we require yet another env var to be set (I'd like optional better).

Now it's optional and the default is a no-op valid configuration.

pkg/adapter/main.go Outdated Show resolved Hide resolved
@antoineco
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2020
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/config.go 66.7% 71.4% 4.8
pkg/adapter/main.go 62.2% 64.6% 2.4
pkg/adapter/main_message_adapter.go 58.1% 60.9% 2.7
pkg/adapter/v2/config.go 65.0% 70.8% 5.8
pkg/reconciler/apiserversource/apiserversource.go 75.2% 74.8% -0.4
pkg/reconciler/apiserversource/controller.go 93.3% 93.8% 0.4

@slinkydeveloper
Copy link
Contributor Author

/retest

@n3wscott
Copy link
Contributor

/lgtm
/approve

remove the hold if you are ready.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2020
@knative-prow-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2020
@slinkydeveloper
Copy link
Contributor Author

/unhold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard coded istio-system usage on tracing
6 participants