mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
fix go lint
Signed-off-by: Marcin Skalski <skalskimarcin33@gmail.com>
This commit is contained in:
parent
d12ccf9fa2
commit
0af810aa71
2
config/testdata/conf.good.yml
vendored
2
config/testdata/conf.good.yml
vendored
|
@ -221,7 +221,7 @@ scrape_configs:
|
|||
|
||||
kuma_sd_configs:
|
||||
- server: http://kuma-control-plane.kuma-system.svc:5676
|
||||
clientId: main-prometheus
|
||||
client_id: main-prometheus
|
||||
|
||||
- job_name: service-marathon
|
||||
marathon_sd_configs:
|
||||
|
|
2
config/testdata/roundtrip.good.yml
vendored
2
config/testdata/roundtrip.good.yml
vendored
|
@ -108,7 +108,7 @@ scrape_configs:
|
|||
|
||||
kuma_sd_configs:
|
||||
- server: http://kuma-control-plane.kuma-system.svc:5676
|
||||
clientId: main-prometheus
|
||||
client_id: main-prometheus
|
||||
|
||||
marathon_sd_configs:
|
||||
- servers:
|
||||
|
|
|
@ -179,10 +179,10 @@ func kumaMadsV1ResourceParser(resources []*anypb.Any, typeURL string) ([]model.L
|
|||
func NewKumaHTTPDiscovery(conf *KumaSDConfig, logger log.Logger) (discovery.Discoverer, error) {
|
||||
// Default to "prometheus" if hostname is unavailable.
|
||||
var clientID string
|
||||
if conf.ClientId == "" {
|
||||
clientID = defaultClientId(logger)
|
||||
if conf.ClientID == "" {
|
||||
clientID = defaultClientID(logger)
|
||||
} else {
|
||||
clientID = conf.ClientId
|
||||
clientID = conf.ClientID
|
||||
}
|
||||
|
||||
clientConfig := &HTTPResourceClientConfig{
|
||||
|
@ -217,7 +217,7 @@ func NewKumaHTTPDiscovery(conf *KumaSDConfig, logger log.Logger) (discovery.Disc
|
|||
return d, nil
|
||||
}
|
||||
|
||||
func defaultClientId(logger log.Logger) string {
|
||||
func defaultClientID(logger log.Logger) string {
|
||||
clientID, err := osutil.GetFQDN()
|
||||
if err != nil {
|
||||
level.Debug(logger).Log("msg", "error getting FQDN", "err", err)
|
||||
|
|
|
@ -204,7 +204,7 @@ func TestNewKumaHTTPDiscovery(t *testing.T) {
|
|||
require.True(t, ok)
|
||||
require.Equal(t, kumaConf.Server, resClient.Server())
|
||||
require.Equal(t, KumaMadsV1ResourceTypeURL, resClient.ResourceTypeURL())
|
||||
require.Equal(t, kumaConf.ClientId, resClient.ID())
|
||||
require.Equal(t, kumaConf.ClientID, resClient.ID())
|
||||
require.Equal(t, KumaMadsV1ResourceType, resClient.config.ResourceType)
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ type SDConfig struct {
|
|||
RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"`
|
||||
FetchTimeout model.Duration `yaml:"fetch_timeout,omitempty"`
|
||||
Server string `yaml:"server,omitempty"`
|
||||
ClientId string `yaml:"clientId,omitempty"`
|
||||
ClientID string `yaml:"client_id,omitempty"`
|
||||
}
|
||||
|
||||
// mustRegisterMessage registers the provided message type in the typeRegistry, and panics
|
||||
|
|
|
@ -36,7 +36,7 @@ var (
|
|||
sdConf = SDConfig{
|
||||
Server: "http://127.0.0.1",
|
||||
RefreshInterval: model.Duration(10 * time.Second),
|
||||
ClientId: "test-id",
|
||||
ClientID: "test-id",
|
||||
}
|
||||
|
||||
testFetchFailuresCount = prometheus.NewCounter(
|
||||
|
|
|
@ -2233,7 +2233,7 @@ server: <string>
|
|||
# Client id is used by Kuma Control Plane to compute Monitoring Assignment for specific Prometheus backend.
|
||||
# This is useful when migrating between multiple Prometheus backends, or having separate backend for each Mesh
|
||||
# When not specified, system hostname/fqdn will be used if available, if not `prometheus` will be used.
|
||||
clientId: <string>
|
||||
client_id: <string>
|
||||
|
||||
# The time to wait between polling update requests.
|
||||
[ refresh_interval: <duration> | default = 30s ]
|
||||
|
|
Loading…
Reference in a new issue