Skip to content
14 changes: 9 additions & 5 deletions metrics/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +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
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
1 change: 0 additions & 1 deletion metrics/opencensus_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func newOpenCensusExporter(config *metricsConfig, logger *zap.SugaredLogger) (vi
return nil, nil, err
}
logger.Infow("Created OpenCensus exporter with config:", zap.Any("config", *config))
view.RegisterExporter(e)
return e, getFactory(e, opts), nil
}

Expand Down
Loading