From fa472f6202ac24b0f1dab9c22d63683f18ccc316 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 20 Apr 2020 22:47:31 +0000 Subject: [PATCH] commit 611186249e5e466c2b37e0e88bb04258e1bdf04c Merge: 7dd4522 a298ec2 Author: Thomas Boerger Date: Tue Apr 21 00:38:11 2020 +0200 Merge pull request #13 from promhippie/refactoring Code and project restructuring --- index.html | 48 ++++++++++++++++++++---------------------------- index.xml | 7 ++++--- sitemap.xml | 8 ++++---- 3 files changed, 28 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index 047cf7a..6e602f2 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + @@ -440,7 +440,7 @@

Envrionment variables

PROMETHEUS_HCLOUD_CONFIG
-
Path to HetznerCloud configuration file, optionally, required for muli credentials
+
Path to HetznerCloud configuration file, optionally, required for multi credentials

PROMETHEUS_HCLOUD_TOKEN
Access token for the HetznerCloud API, required for authentication
@@ -472,25 +472,27 @@

Configuration file

Labels

    -
  • __meta_hcloud_name
  • -
  • __meta_hcloud_status
  • -
  • __meta_hcloud_public_ipv4
  • -
  • __meta_hcloud_public_ipv6
  • -
  • __meta_hcloud_type
  • +
  • __address__
  • +
  • __meta_hcloud_city
  • __meta_hcloud_cores
  • -
  • __meta_hcloud_memory
  • -
  • __meta_hcloud_disk
  • -
  • __meta_hcloud_storage
  • +
  • __meta_hcloud_country
  • __meta_hcloud_cpu
  • __meta_hcloud_datacenter
  • -
  • __meta_hcloud_location
  • -
  • __meta_hcloud_city
  • -
  • __meta_hcloud_country
  • +
  • __meta_hcloud_disk
  • __meta_hcloud_image_name
  • __meta_hcloud_image_type
  • +
  • __meta_hcloud_label_<label>
  • +
  • __meta_hcloud_location
  • +
  • __meta_hcloud_memory
  • +
  • __meta_hcloud_name
  • __meta_hcloud_os_flavor
  • __meta_hcloud_os_version
  • -
  • __meta_hcloud_label_<label>
    +
  • __meta_hcloud_project
  • +
  • __meta_hcloud_public_ipv4
  • +
  • __meta_hcloud_public_ipv6
  • +
  • __meta_hcloud_status
  • +
  • __meta_hcloud_storage
  • +
  • __meta_hcloud_type

@@ -521,22 +523,12 @@

As this project is built with Go you need to install Go first. The installation of Go is out of the scope of this document, please follow the official documentation. After the installation of Go you need to get the sources:

-
go get -d github.com/promhippie/prometheus-hcloud-sd
-cd $GOPATH/src/github.com/promhippie/prometheus-hcloud-sd
- -

All required tool besides Go itself are bundled or getting automatically installed within the GOPATH. We are using retool to keep the used tools consistent and dep to manage the dependencies. All commands to build this project are part of our Makefile.

- -
# install retool
-make retool
-
-# sync dependencies
-make sync
+
git clone https://github.com/promhippie/prometheus-hcloud-sd.git
+cd prometheus-hcloud-sd/
-# generate code -make generate +

All required tool besides Go itself are bundled by Go modules, all you need is part of the Makfile:

-# build binary -make build
+
make generate build

Finally you should have the binary within the bin/ folder now, give it a try with ./bin/prometheus-hcloud-sd -h to see all available options.

diff --git a/index.xml b/index.xml index 688b674..bb58b70 100644 --- a/index.xml +++ b/index.xml @@ -6,7 +6,7 @@ Recent content on Prometheus HetznerCloud SD Hugo -- gohugo.io en-us - Wed, 02 May 2018 00:00:00 +0000 + Wed, 01 Apr 2020 00:00:00 +0000 @@ -25,11 +25,12 @@ First of all we need to prepare a configuration for Prometheus that includes the Building https://promhippie.github.io/prometheus-hcloud-sd/building/ - Wed, 02 May 2018 00:00:00 +0000 + Wed, 01 Apr 2020 00:00:00 +0000 https://promhippie.github.io/prometheus-hcloud-sd/building/ As this project is built with Go you need to install Go first. The installation of Go is out of the scope of this document, please follow the official documentation. After the installation of Go you need to get the sources: -go get -d github.com/promhippie/prometheus-hcloud-sd cd $GOPATH/src/github.com/promhippie/prometheus-hcloud-sd All required tool besides Go itself are bundled or getting automatically installed within the GOPATH. We are using retool to keep the used tools consistent and dep to manage the dependencies. +git clone https://github.com/promhippie/prometheus-hcloud-sd.git cd prometheus-hcloud-sd/ All required tool besides Go itself are bundled by Go modules, all you need is part of the Makfile: +make generate build Finally you should have the binary within the bin/ folder now, give it a try with . diff --git a/sitemap.xml b/sitemap.xml index ed8c8a0..e79cec3 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -9,7 +9,7 @@ https://promhippie.github.io/prometheus-hcloud-sd/building/ - 2018-05-02T00:00:00+00:00 + 2020-04-01T00:00:00+00:00 @@ -18,13 +18,13 @@ - https://promhippie.github.io/prometheus-hcloud-sd/categories/ + https://promhippie.github.io/prometheus-hcloud-sd/ + 2020-04-01T00:00:00+00:00 0 - https://promhippie.github.io/prometheus-hcloud-sd/ - 2018-05-02T00:00:00+00:00 + https://promhippie.github.io/prometheus-hcloud-sd/categories/ 0