Closed AlvinRamoutar closed 3 years ago
ive had other problems with Viper, i plan on dropping it in a future release. Using kingpin like some of the official Prometheus exporters do or even just native go commands. Thank-you so much for finding that and offering a fix. working on the merge now.
Thanks for merging, will work with this some more tomorrow and close the ticket then. Viper's not a bad choice - lots of activity over there in comparison to kingpin. By the way @bryanklewis , do you have an estimate release date for v0.4.2? Would like to deploy via docker :)
@AlvinRamoutar, today actually. Should see it there now.
Hey @bryanklewis ,
Noticing that passing commandline flags pertaining to
hub.EventHubConfig
are not being stored inadapterConfig.writeHub
. This results in the following error below:There is a connection between
viper.RegisterAlias
- possibly mutating the config in memory (would need to read into Viper more). Commenting out https://github.com/bryanklewis/prometheus-eventhubs-adapter/blob/130b0eb599726f8691d4f1c6d79d23223b0c4ce9/config.go#L84 fixes the issue:This was discovered by observing pflags via inserting
pflag.Lookup("write_connstring").Value.String()
inmain()
afterhub.NewClient()
call. Lookup was successful, whileviper.GetString()
was empty.