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

Configure Jaeger receiver and exporter by flags #2241

Merged
merged 11 commits into from
May 15, 2020

Conversation

pavolloffay
Copy link
Member

@pavolloffay pavolloffay commented May 12, 2020

This PR makes Jaeger receiver and exporter fully configurable by flags.

Resolves #2181

In a nutshell:

  • Each component exposes its flags via AddFlags()
  • There is a high level AddComponentFlags() that adds flags for all components except storage exporters. This is used in every main to add flags to cobra
  • AddFlags from legacy jaeger packages are split into AddOTELFlags to make sure we add only flags that are needed
  • Bumps OTEL version that contains TLS fixes for Jaeger exporter/receiver.

Todos:

@pavolloffay
Copy link
Member Author

I have moved TLS test to OTEL collector open-telemetry/opentelemetry-collector#962

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay marked this pull request as ready for review May 14, 2020 15:19
@pavolloffay pavolloffay requested a review from a team as a code owner May 14, 2020 15:19
Signed-off-by: Pavol Loffay <[email protected]>
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.

A couple of comments - will continue review tomorrow.

"--collector.grpc.tls.cert=cacert.crt",
"--collector.grpc.tls.key=keycert.crt",
"--collector.http-server.host-port=host2:22",
"--reporter.grpc.host-port=coll:33",
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be missing something, but why would these reporter flags be defined on the collector? They are normally only supported to an agent.
I'm guessing its for when the collector maybe forwarding data to another collector using those reporter (or exporter) details - but think it may need some explanation of why these exporter connection details are being used for the receiver/remote sampling endpoint?

Copy link
Member Author

@pavolloffay pavolloffay May 14, 2020

Choose a reason for hiding this comment

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

Collector and agent use OTEL Jaeger receiver. Jaeger receiver exposes HTTP sampling endpoint. It can be configured to get the strategies from a remote server via gRPC. Legacy collector was using the reporter (and its flags) to get the data from the collector.

I can update the test and move the flags to agent test, but it really does not matter in the end.

"--reporter.grpc.tls.cert=cert.pem",
"--reporter.grpc.tls.key=key.key",
},
zipkinHostPort: "localhost:55",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the zipkin host/port being provided separately - couldn't it be taken from the --collector.zipkin.host-port flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we parse the flag in main and enable the receiver only in the default config.

The zipkin receiver is different to Jaeger components, we do not wrap and we enable it only in the default config. I will create a separate issue for this.

Signed-off-by: Pavol Loffay <[email protected]>
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.

LGTM - just a couple of questions.

if v.IsSet(thriftCompactHostPort) {
cfg.Protocols["thrift_compact"] = &receiver.SecureReceiverSettings{
ReceiverSettings: configmodels.ReceiverSettings{
// TODO OTEL does not expose number of workers and queue length
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't these be handled by the processors, e.g. queued_retry? So possibly they are not going to be supported by flags going forward - or possibly new flags that can be used to configure the processors?

Copy link
Member Author

Choose a reason for hiding this comment

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

the workers and queue length are used on agent implementation it's agnostic to the queued_retry processor.

}
if cOpts.TLS.CertPath != "" && cOpts.TLS.KeyPath != "" {
cfg.Protocols["grpc"].TLSCredentials = &receiver.TLSCredentials{
// TODO client-ca is missing in OTEL
Copy link
Contributor

Choose a reason for hiding this comment

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

Has an issue been created to track this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
@codecov
Copy link

codecov bot commented May 15, 2020

Codecov Report

Merging #2241 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2241   +/-   ##
=======================================
  Coverage   96.18%   96.18%           
=======================================
  Files         219      219           
  Lines       10640    10648    +8     
=======================================
+ Hits        10234    10242    +8     
+ Misses        351      350    -1     
- Partials       55       56    +1     
Impacted Files Coverage Δ
cmd/agent/app/flags.go 92.85% <100.00%> (+0.54%) ⬆️
cmd/agent/app/reporter/grpc/flags.go 100.00% <100.00%> (ø)
cmd/collector/app/builder_flags.go 100.00% <100.00%> (ø)
plugin/sampling/strategystore/static/options.go 100.00% <100.00%> (ø)
plugin/storage/badger/spanstore/reader.go 96.79% <0.00%> (ø)

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 0fe3e75...b936830. Read the comment docs.

@pavolloffay pavolloffay merged commit 75a1d93 into jaegertracing:master May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants