Skip to content

Commit

Permalink
Clean up isNewExporterRequired
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Anderson committed Oct 23, 2020
1 parent 211b2be commit c7d694f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions metrics/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,17 @@ func isNewExporterRequired(newConfig *metricsConfig) bool {
return true
}

// If the OpenCensus address has changed, restart the exporter.
// TODO(evankanderson): Should we just always restart the opencensus agent?
if newConfig.backendDestination == openCensus {
switch newConfig.backendDestination {
case openCensus:
// If the OpenCensus address has changed, restart the exporter.
// TODO(evankanderson): Should we just always restart the opencensus agent?
return newConfig.collectorAddress != cc.collectorAddress || newConfig.requireSecure != cc.requireSecure
}

if newConfig.backendDestination == prometheus {
case prometheus:
return newConfig.prometheusPort != cc.prometheusPort
case stackdriver:
return newConfig.stackdriverClientConfig != cc.stackdriverClientConfig
}

return newConfig.backendDestination == stackdriver && newConfig.stackdriverClientConfig != cc.stackdriverClientConfig
return false
}

// newMetricsExporter gets a metrics exporter based on the config.
Expand Down

0 comments on commit c7d694f

Please sign in to comment.