Skip to content

Commit

Permalink
commit cd83df9
Browse files Browse the repository at this point in the history
Merge: 32683b4 5bdb83b
Author: Thomas Boerger <[email protected]>
Date:   Thu Jan 10 16:32:57 2019 +0100

    Merge pull request #3 from promhippie/updates

    Multiple fixes, for changes look at the commits
  • Loading branch information
tboerger committed Jan 10, 2019
1 parent dedf182 commit d21d727
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<html id="html" lang="en-us">
<head>
<meta name="generator" content="Hugo 0.39" />
<meta name="generator" content="Hugo 0.46" />
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width"/>

Expand Down Expand Up @@ -412,6 +412,10 @@ <h2 id="installation">Installation</h2>

<script src="//gist.github.com/tboerger/4f445d609f0894a5fe40c20e7a42d565.js?file=tag.diff"></script>

<p>Depending on how you have launched and configured <a href="https://prometheus.io">Prometheus</a> it&rsquo;s possible that it&rsquo;s running as user <code>nobody</code>, in that case you should run the service discovery as this user as well, otherwise <a href="https://prometheus.io">Prometheus</a> won&rsquo;t be able to read the generated JSON file:</p>

<script src="//gist.github.com/tboerger/4f445d609f0894a5fe40c20e7a42d565.js?file=userid.diff"></script>

<p>Finally the service discovery should be configured fine, let&rsquo;s start this stack with <a href="https://docs.docker.com/compose/">docker-compose</a>, you just need to execute <code>docker-compose up</code> within the directory where you have stored <code>prometheus.yml</code> and <code>docker-compose.yml</code>.</p>

<script src="//gist.github.com/tboerger/4f445d609f0894a5fe40c20e7a42d565.js?file=output.log"></script>
Expand Down Expand Up @@ -475,8 +479,10 @@ <h2 id="labels">Labels</h2>
<li><code>__meta_scaleway_image_id</code><br /></li>
<li><code>__meta_scaleway_image_name</code><br /></li>
<li><code>__meta_scaleway_public_ipv4</code><br /></li>
<li><code>__meta_scaleway_public_host</code><br /></li>
<li><code>__meta_scaleway_state</code><br /></li>
<li><code>__meta_scaleway_private_ipv4</code><br /></li>
<li><code>__meta_scaleway_private_host</code><br /></li>
<li><code>__meta_scaleway_hostname</code><br /></li>
<li><code>__meta_scaleway_org</code><br /></li>
<li><code>__meta_scaleway_commercial_type</code><br /></li>
Expand Down Expand Up @@ -517,21 +523,21 @@ <h1>

<p>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 <a href="https://golang.org/doc/install">official documentation</a>. After the installation of Go you need to get the sources:</p>

<div class="highlight"><pre class="chroma"><code class="language-txt" data-lang="txt">go get -d github<span class="p">.</span><span class="s">com/promhippie/prometheus-scw-sd
</span><span class="s"></span>cd <span class="err">$</span>GOPATH/src/github<span class="p">.</span>com/promhippie/prometheus-scw-sd</code></pre></div>
<div class="highlight"><pre class="chroma"><code class="language-txt" data-lang="txt">go get -d github.com/promhippie/prometheus-scw-sd
cd $GOPATH/src/github.com/promhippie/prometheus-scw-sd</code></pre></div>

<p>All required tool besides Go itself are bundled or getting automatically installed within the <code>GOPATH</code>. We are using <a href="https://github.com/twitchtv/retool">retool</a> to keep the used tools consistent and <a href="https://github.com/golang/dep">dep</a> to manage the dependencies. All commands to build this project are part of our <code>Makefile</code>.</p>

<div class="highlight"><pre class="chroma"><code class="language-txt" data-lang="txt"><span class="c"># install retool</span>
<div class="highlight"><pre class="chroma"><code class="language-txt" data-lang="txt"># install retool
make retool

<span class="c"># sync dependencies</span>
# sync dependencies
make sync

<span class="c"># generate code</span>
# generate code
make generate

<span class="c"># build binary</span>
# build binary
make build</code></pre></div>

<p>Finally you should have the binary within the <code>bin/</code> folder now, give it a try with <code>./bin/prometheus-scw-sd -h</code> to see all available options.</p>
Expand Down

0 comments on commit d21d727

Please sign in to comment.