nomad: Fix documentation and comments.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
pull/10915/head
Julien Pivotto 2 years ago
parent 4456dcc26e
commit d9347bf128

@ -1,4 +1,4 @@
// Copyright 2015 The Prometheus Authors // Copyright 2022 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
@ -44,18 +44,18 @@ func NewSDMock(t *testing.T) *SDMock {
} }
} }
// Endpoint returns the URI to the mock server // Endpoint returns the URI to the mock server.
func (m *SDMock) Endpoint() string { func (m *SDMock) Endpoint() string {
return m.Server.URL + "/" return m.Server.URL + "/"
} }
// Setup creates the mock server // Setup creates the mock server.
func (m *SDMock) Setup() { func (m *SDMock) Setup() {
m.Mux = http.NewServeMux() m.Mux = http.NewServeMux()
m.Server = httptest.NewServer(m.Mux) m.Server = httptest.NewServer(m.Mux)
} }
// ShutdownServer creates the mock server // ShutdownServer creates the mock server.
func (m *SDMock) ShutdownServer() { func (m *SDMock) ShutdownServer() {
m.Server.Close() m.Server.Close()
} }
@ -128,9 +128,7 @@ func TestConfiguredService(t *testing.T) {
Server: "http://localhost:4646", Server: "http://localhost:4646",
} }
_, err := NewDiscovery(conf, nil) _, err := NewDiscovery(conf, nil)
if err != nil { require.NoError(t, err)
t.Errorf("Unexpected error when initializing discovery %v", err)
}
} }
func TestNomadSDRefresh(t *testing.T) { func TestNomadSDRefresh(t *testing.T) {

@ -2188,7 +2188,7 @@ The following meta labels are available on targets during [relabeling](#relabel_
* `__meta_nomad_address`: the service address of the target * `__meta_nomad_address`: the service address of the target
* `__meta_nomad_dc`: the datacenter name for the target * `__meta_nomad_dc`: the datacenter name for the target
* `__meta_nomad_namespace`: the namespace of the target * `__meta_nomad_namespace`: the namespace of the target
* `__meta_nomad_node`: the node name defined for the target * `__meta_nomad_node_id`: the node name defined for the target
* `__meta_nomad_service`: the name of the service the target belongs to * `__meta_nomad_service`: the name of the service the target belongs to
* `__meta_nomad_service_address`: the service address of the target * `__meta_nomad_service_address`: the service address of the target
* `__meta_nomad_service_id`: the service ID of the target * `__meta_nomad_service_id`: the service ID of the target

Loading…
Cancel
Save