nomad: Fix documentation and comments.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
Julien Pivotto 2022-06-30 14:13:49 +02:00
parent 4456dcc26e
commit d9347bf128
2 changed files with 6 additions and 8 deletions

View file

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

View file

@ -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_dc`: the datacenter name for 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_address`: the service address of the target
* `__meta_nomad_service_id`: the service ID of the target