Skip to content

Commit

Permalink
fix(bootstrap): allow custom pyroscope server name
Browse files Browse the repository at this point in the history
  • Loading branch information
geoah committed Feb 14, 2021
1 parent f586301 commit 1287370
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cmd/bootstrap/main.go
Expand Up @@ -33,8 +33,9 @@ type config struct {
Bootstraps []peer.Shorthand `envconfig:"BOOTSTRAPS"`
} `envconfig:"PEER"`
Metrics struct {
PyroscopeServerURL string `envconfig:"PYROSCOPE_SERVER_URL"`
BindAddress string `envconfig:"BIND_ADDRESS" default:"0.0.0.0:0"`
PyroscopeServerName string `envconfig:"PYROSCOPE_SERVER_NAME"`
PyroscopeServerURL string `envconfig:"PYROSCOPE_SERVER_URL"`
BindAddress string `envconfig:"BIND_ADDRESS" default:"0.0.0.0:0"`
} `envconfig:"METRICS"`
}

Expand All @@ -56,9 +57,10 @@ func main() {

if cfg.Metrics.PyroscopeServerURL != "" {
applicationName := "bootstrap"
if cfg.Peer.AnnounceAddress != "" {
applicationName += "." + cfg.Peer.AnnounceAddress
if cfg.Metrics.PyroscopeServerName != "" {
applicationName = cfg.Metrics.PyroscopeServerName
}
// nolint: errcheck
profiler.Start(profiler.Config{
ApplicationName: applicationName,
ServerAddress: cfg.Metrics.PyroscopeServerURL,
Expand Down
Expand Up @@ -35,7 +35,9 @@
NIMONA_METRICS_BIND_ADDRESS: >-
0.0.0.0:{{ nimona_bootstrap_metrics_port }}
NIMONA_METRICS_PYROSCOPE_SERVER_URL: >-
"https://{{ groups['metrics_root'][0] }}/pyroscope/"
https://{{ groups['metrics_root'][0] }}/pyroscope/
NIMONA_METRICS_PYROSCOPE_SERVER_NAME: >-
{{ inventory_hostname }}
published_ports:
- "0.0.0.0:{{ nimona_bootstrap_peer_port }}:{{ nimona_bootstrap_peer_port }}"
- "127.0.0.1:{{ nimona_bootstrap_metrics_port }}:{{ nimona_bootstrap_metrics_port }}"
Expand Down

0 comments on commit 1287370

Please sign in to comment.