Skip to content

Commit

Permalink
Merge pull request #3 from wenhuwang/fix-dsn
Browse files Browse the repository at this point in the history
metrics: fix the issue of special characters being escaped in passwords
  • Loading branch information
apetruhin authored Aug 19, 2024
2 parents 5730edb + c95844e commit c7e9b7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (ms *Metrics) createCollector(config ExporterConfig) (prometheus.Collector,
return collector, func() { _ = collector.Close() }, nil

case model.ApplicationTypeMysql:
userPass := url.UserPassword(config.Credentials.Username, config.Credentials.Password)
userPass := fmt.Sprintf("%s:%s", config.Credentials.Username, config.Credentials.Password)
query := url.Values{}
query.Set("timeout", fmt.Sprintf("%dms", timeout.Milliseconds()))
tls := config.Params["tls"]
Expand Down

0 comments on commit c7e9b7f

Please sign in to comment.