From d9347bf12880e38e2ca0f63cead410b4ca6c01d9 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Thu, 30 Jun 2022 14:13:49 +0200 Subject: [PATCH] nomad: Fix documentation and comments. Signed-off-by: Julien Pivotto --- discovery/nomad/nomad_test.go | 12 +++++------- docs/configuration/configuration.md | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/discovery/nomad/nomad_test.go b/discovery/nomad/nomad_test.go index ab23f1fe4..40d412d74 100644 --- a/discovery/nomad/nomad_test.go +++ b/discovery/nomad/nomad_test.go @@ -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) { diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index d36db3359..a4f7cd5ea 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -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