mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Check syntax of example configurations (#10753)
* Check syntax of example configurations Fix a mistake in the hetzner and vultr configs. Also it's easier not to fight the build system, and this will lint example code, so ignore a lint issue in custom-sd. Signed-off-by: David Leadbeater <dgl@dgl.cx> * No need to import Makefile.common, it just complicates things Signed-off-by: David Leadbeater <dgl@dgl.cx>
This commit is contained in:
parent
0505ba81e1
commit
fba3e847dc
|
@ -38,6 +38,7 @@ jobs:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
- run: go test ./tsdb/ -test.tsdb-isolation=false
|
- run: go test ./tsdb/ -test.tsdb-isolation=false
|
||||||
- run: make -C documentation/examples/remote_storage
|
- run: make -C documentation/examples/remote_storage
|
||||||
|
- run: make -C documentation/examples
|
||||||
- prometheus/check_proto:
|
- prometheus/check_proto:
|
||||||
version: "3.15.8"
|
version: "3.15.8"
|
||||||
- prometheus/store_artifact:
|
- prometheus/store_artifact:
|
||||||
|
|
20
documentation/examples/Makefile
Normal file
20
documentation/examples/Makefile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: check-examples-syntax
|
||||||
|
|
||||||
|
.PHONY: check-examples-syntax
|
||||||
|
check-examples-syntax: prometheus-*.yml
|
||||||
|
@echo ">> check example configurations syntax"
|
||||||
|
@set -e; for file in $^; do ../../promtool check config --syntax-only $$file; done
|
|
@ -155,6 +155,7 @@ func (a *Adapter) runCustomSD(ctx context.Context) {
|
||||||
|
|
||||||
// Run starts a Discovery Manager and the custom service discovery implementation.
|
// Run starts a Discovery Manager and the custom service discovery implementation.
|
||||||
func (a *Adapter) Run() {
|
func (a *Adapter) Run() {
|
||||||
|
//nolint:errcheck
|
||||||
go a.manager.Run()
|
go a.manager.Run()
|
||||||
a.manager.StartCustomProvider(a.ctx, a.name, a.disc)
|
a.manager.StartCustomProvider(a.ctx, a.name, a.disc)
|
||||||
go a.runCustomSD(a.ctx)
|
go a.runCustomSD(a.ctx)
|
||||||
|
|
|
@ -13,7 +13,7 @@ scrape_configs:
|
||||||
hetzner_sd_configs:
|
hetzner_sd_configs:
|
||||||
- authorization:
|
- authorization:
|
||||||
credentials: "<replace with a Hetzner Cloud API Token>"
|
credentials: "<replace with a Hetzner Cloud API Token>"
|
||||||
platform: "hcloud"
|
role: "hcloud"
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
# Use the public IPv4 and port 9100 to scrape the target.
|
# Use the public IPv4 and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_hetzner_public_ipv4]
|
- source_labels: [__meta_hetzner_public_ipv4]
|
||||||
|
@ -26,7 +26,7 @@ scrape_configs:
|
||||||
hetzner_sd_configs:
|
hetzner_sd_configs:
|
||||||
- authorization:
|
- authorization:
|
||||||
credentials: "<replace with a Hetzner Cloud API Token>"
|
credentials: "<replace with a Hetzner Cloud API Token>"
|
||||||
platform: "hcloud"
|
role: "hcloud"
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
# Use the private IPv4 within the Hetzner Cloud Network and port 9100 to scrape the target.
|
# Use the private IPv4 within the Hetzner Cloud Network and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_hetzner_hcloud_private_ipv4_mynet]
|
- source_labels: [__meta_hetzner_hcloud_private_ipv4_mynet]
|
||||||
|
@ -40,7 +40,7 @@ scrape_configs:
|
||||||
- basic_auth:
|
- basic_auth:
|
||||||
username: "<replace with a Hetzner Robot API username>"
|
username: "<replace with a Hetzner Robot API username>"
|
||||||
password: "<replace with a Hetzner Robot API password>"
|
password: "<replace with a Hetzner Robot API password>"
|
||||||
platform: "robot"
|
role: "robot"
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
# Use the public IPv4 and port 9100 to scrape the target.
|
# Use the public IPv4 and port 9100 to scrape the target.
|
||||||
- source_labels: [__meta_hetzner_public_ipv4]
|
- source_labels: [__meta_hetzner_public_ipv4]
|
||||||
|
|
Loading…
Reference in a new issue