GithubHelp home page GithubHelp logo

clhernandez / huaweicloud-prometheus-discovery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huaweicloud/huaweicloud-prometheus-discovery

0.0 0.0 0.0 1.58 MB

License: Apache License 2.0

Go 100.00%

huaweicloud-prometheus-discovery's Introduction

huaweicloud-prometheus-discovery

Prometheus filed service discovery for Huaweicloud.

Install

Download the binary from the Releases page.

wget https://github.com/huaweicloud/huaweicloud-prometheus-discovery/releases/download/1.0.0/huaweicloud-prometheus-discovery-1.0.0.linux-amd64.tar.gz
tar -zxvf huaweicloud-prometheus-discovery-1.0.0.linux-amd64.tar.gz

Usage

 ./huaweicloud-prometheus-discovery  -config.projectName="cn-north-1" -config.userName=username -config.domain=domainname -config.accessKey=access_key  -config.secretKey=secret_key -config.region="cn-north-1"

Building The Discovery with Exact steps on clean Ubuntu 16.04

$ wget https://dl.google.com/go/go1.12.5.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.12.5.linux-amd64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin # You should put in your .profile or .bashrc
$ go version # to verify it runs and version #

$ go get https://github.com/huaweicloud/huaweicloud-prometheus-discovery
$ cd ~/go/src/github.com/huaweicloud/huaweicloud-prometheus-discovery
$ go build

Help

Usage of ./huaweicloud-prometheus-discovery:
  -accessKey string
        The access key of the HuaweiCloud to use (optional)
  -debug
        If debug the code.
  -domain string
        The Name of the Domain to scope to (Identity v3).
  -interval int
        interval at which to scrape the Huaweicloud API for ECS service discovery information, The unit is seconds (default 60)
  -model
        If the config.model is set to true, the model LabelName will added MetaLabelPrefix(__meta_huaweicloud_)
  -password string
        The Password to login with.
  -port string
         (default "9100")
  -projectName string
        The Name of the Tenant (Identity v2) or Project (Identity v3) to login with.
  -region string
        The region of the HuaweiCloud to use
  -secretKey string
        The secret key of the HuaweiCloud to use.
  -times int
        how many times to scrape before exiting (0 = infinite)
  -userName string
        The Username to login with.
  -write-to string
        path of file to write ECS service discovery information to (default "ecs_file_sd.yml")

Example of file(ecs_file_sd.yml)

[
 {
  "targets": [
   "10.0.0.1:9100"
  ],
  "labels": {
   "name": "demo152"
  }
 },
 {
  "targets": [
   "10.0.0.2:9100"
  ],
  "labels": {
   "name": "ECS_TEST"
  }
 }
]

Example prometheus setting

scrape_configs:
- job_name: ecs
  file_sd_configs:
    - files:
      - /path/to/ecs_file_sd.yml
      refresh_interval: 10m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.