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

Disable Zipkin server if port/address is not configured #2554

Merged
merged 5 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/collector/app/builder_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func AddOTELJaegerFlags(flags *flag.FlagSet) {

// AddOTELZipkinFlags adds flag that are exposed by OTEL Zipkin receiver
func AddOTELZipkinFlags(flags *flag.FlagSet) {
flags.String(CollectorZipkinHTTPHostPort, ports.PortToHostPort(0), "The host:port (e.g. 127.0.0.1:9411 or :9411) of the collector's Zipkin server")
flags.String(CollectorZipkinHTTPHostPort, "", "The host:port (e.g. 127.0.0.1:9411 or :9411) of the collector's Zipkin server (disabled by default)")
}

// InitFromViper initializes CollectorOptions with properties from viper
Expand Down
3 changes: 2 additions & 1 deletion cmd/collector/app/server/zipkin.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type ZipkinServerParams struct {

// StartZipkinServer based on the given parameters
func StartZipkinServer(params *ZipkinServerParams) (*http.Server, error) {
if params.HostPort == "" {
if params.HostPort == "" || params.HostPort == ":" {
params.Logger.Info("Not listening for Zipkin HTTP traffic, port not configured")
return nil, nil
}

Expand Down