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

add env var JAEGER_DISABLED #1285

Merged
merged 3 commits into from
Nov 10, 2020

Conversation

sschne
Copy link
Contributor

@sschne sschne commented Oct 31, 2020

Adds option to set the environment variable JAEGER_DISABLED to query or all-in-one deployment.

Closes: #1148

Signed-off-by: Simon Schneider github@simon-schneider.eu

Signed-off-by: Simon Schneider <github@simon-schneider.eu>
@codecov
Copy link

codecov bot commented Oct 31, 2020

Codecov Report

Merging #1285 (67a11d6) into master (c418931) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1285      +/-   ##
==========================================
+ Coverage   87.32%   87.36%   +0.03%     
==========================================
  Files          89       89              
  Lines        4947     4970      +23     
==========================================
+ Hits         4320     4342      +22     
- Misses        464      465       +1     
  Partials      163      163              
Impacted Files Coverage Δ
pkg/apis/jaegertracing/v1/jaeger_types.go 100.00% <ø> (ø)
pkg/deployment/all_in_one.go 100.00% <100.00%> (ø)
pkg/deployment/query.go 100.00% <100.00%> (ø)
pkg/strategy/production.go 97.10% <100.00%> (+0.08%) ⬆️
pkg/strategy/streaming.go 96.99% <100.00%> (+0.04%) ⬆️
pkg/controller/jaeger/jaeger_controller.go 36.87% <0.00%> (+1.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c418931...67a11d6. Read the comment docs.

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well as adding theJAEGER_DISABLED flag, it would be good to avoid injecting the agent with the query service.

// JaegerDisabled adds the JAEGER_DISABLED environment flag to the
// query component to prevent it from adding its own traces.
// The default, if ommited, is false
JaegerDisabled *bool `json:"jaegerDisabled,omitempty"`
Copy link
Contributor

@objectiser objectiser Nov 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better calling it tracingEnabled - with a default of true?

// JaegerDisabled adds the JAEGER_DISABLED environment flag to the
// query component to prevent it from adding its own traces.
// The default, if ommited, is false
JaegerDisabled *bool `json:"jaegerDisabled,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Signed-off-by: Simon Schneider <github@simon-schneider.eu>
@sschne
Copy link
Contributor Author

sschne commented Nov 8, 2020

As well as adding theJAEGER_DISABLED flag, it would be good to avoid injecting the agent with the query service.

Where should this be implemented? Directly in inject.Sidecar()?

@objectiser
Copy link
Contributor

@sschne Just don't include the sidecar.jaegertracing.io/inject annotation in the query and all-in-one deployments.

Signed-off-by: Simon Schneider <github@simon-schneider.eu>
@mergify mergify bot requested a review from jpkrohling November 9, 2020 20:37
@sschne
Copy link
Contributor Author

sschne commented Nov 9, 2020

@objectiser thanks for the hint, but that was not enough. The Strategy would inject the sidecar regardless of the annotation, so there is will be a race between the Strategy and namespace controller. Now i also prevented the strategy from injecting the sidecar.

queryDep := inject.Sidecar(jaeger, inject.OAuthProxy(jaeger, query.Get()))
queryDep := inject.OAuthProxy(jaeger, query.Get())
if jaeger.Spec.Query.TracingEnabled == nil || *jaeger.Spec.Query.TracingEnabled == true {
queryDep = inject.Sidecar(jaeger, queryDep)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpkrohling should it be necessary to explicitly add the sidecar if the annotation has been defined? If so, what is the purpose of adding the annotation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can then avoid the query deployment from being created without the sidecar, only to get the sidecar injected on the next reconciliation for the Deployment resource.

@objectiser
Copy link
Contributor

Thanks @sschne

@mergify mergify bot merged commit 1c1e75d into jaegertracing:master Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jaeger operator: set env var JAEGER_DISABLED
3 participants