Skip to content

Commit

Permalink
Remove collector from tchannel reporter flag (#1174)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay authored Nov 13, 2018
1 parent 680b996 commit f2eb7d1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following agent flags has has been deprecated in order to support multiple r
```
New flags:
```bash
--reporter.tchannel.collector.host-port
--reporter.tchannel.host-port
--reporter.tchannel.discovery.conn-check-timeout
--reporter.tchannel.discovery.min-peers
```
Expand Down
7 changes: 4 additions & 3 deletions cmd/agent/app/reporter/tchannel/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ const (
defaultConnCheckTimeout = 250 * time.Millisecond
tchannelPrefix = "reporter.tchannel."
collectorHostPort = "collector.host-port"
hostPort = "host-port"
discoveryMinPeers = "discovery.min-peers"
discoveryConnCheckTimeout = "discovery.conn-check-timeout"
)

// AddFlags adds flags for Builder.
func AddFlags(flags *flag.FlagSet) {
flags.String(
tchannelPrefix+collectorHostPort,
tchannelPrefix+hostPort,
"",
"comma-separated string representing host:ports of a static list of collectors to connect to directly (e.g. when not using service discovery)")
flags.Int(
Expand Down Expand Up @@ -75,8 +76,8 @@ func (b *Builder) InitFromViper(v *viper.Viper, logger *zap.Logger) *Builder {
logger.Warn("Using deprecated configuration", zap.String("option", discoveryConnCheckTimeout))
}

if len(v.GetString(tchannelPrefix+collectorHostPort)) > 0 {
b.CollectorHostPorts = strings.Split(v.GetString(tchannelPrefix+collectorHostPort), ",")
if len(v.GetString(tchannelPrefix+hostPort)) > 0 {
b.CollectorHostPorts = strings.Split(v.GetString(tchannelPrefix+hostPort), ",")
}
b.DiscoveryMinPeers = v.GetInt(tchannelPrefix + discoveryMinPeers)
b.ConnCheckTimeout = v.GetDuration(tchannelPrefix + discoveryConnCheckTimeout)
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent/app/reporter/tchannel/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestBingFlags(t *testing.T) {
builder Builder
}{
{flags: []string{
"--reporter.tchannel.collector.host-port=1.2.3.4:555,1.2.3.4:666",
"--reporter.tchannel.host-port=1.2.3.4:555,1.2.3.4:666",
"--reporter.tchannel.discovery.min-peers=42",
"--reporter.tchannel.discovery.conn-check-timeout=85s",
}, builder: Builder{ConnCheckTimeout: time.Second * 85, DiscoveryMinPeers: 42, CollectorHostPorts: []string{"1.2.3.4:555", "1.2.3.4:666"}},
Expand All @@ -55,7 +55,7 @@ func TestBingFlags(t *testing.T) {
"--collector.host-port=1.2.3.4:555,1.2.3.4:666",
"--discovery.min-peers=42",
"--discovery.conn-check-timeout=85s",
"--reporter.tchannel.collector.host-port=1.2.3.4:5556,1.2.3.4:6667",
"--reporter.tchannel.host-port=1.2.3.4:5556,1.2.3.4:6667",
"--reporter.tchannel.discovery.min-peers=43",
"--reporter.tchannel.discovery.conn-check-timeout=86s",
},
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/jaeger-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:

jaeger-agent:
image: jaegertracing/jaeger-agent
command: ["--reporter.tchannel.collector.host-port=jaeger-collector:14267"]
command: ["--reporter.tchannel.host-port=jaeger-collector:14267"]
ports:
- "5775:5775/udp"
- "6831:6831/udp"
Expand Down

0 comments on commit f2eb7d1

Please sign in to comment.