Skip to content

Commit

Permalink
Marshal server group inline configs.
Browse files Browse the repository at this point in the history
Currently, the /config page doesn't show service discovery
configuration, since it's an inline configuration and ignored by the
default yaml marshaller. This patch uses the MarshalYAMLWithInlineConfigs
helper from prometheus to include the service discovery configuration in the
marshalled yaml.
  • Loading branch information
jmcarp authored and jacksontj committed Jun 25, 2023
1 parent f6ab31d commit 8ecf2b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/servergroup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
return nil
}

// MarshalYAML implements the yaml.Marshaler interface.
func (c *Config) MarshalYAML() (interface{}, error) {
return discovery.MarshalYAMLWithInlineConfigs(c)
}

// HTTPClientConfig extends prometheus' HTTPClientConfig
type HTTPClientConfig struct {
DialTimeout time.Duration `yaml:"dial_timeout"`
Expand Down

0 comments on commit 8ecf2b5

Please sign in to comment.