Skip to content

Commit

Permalink
README: fixes and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed Jul 19, 2019
1 parent 42e3d99 commit 3f27b80
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions README.md
Expand Up @@ -10,6 +10,12 @@ to service metadata like name and version.

## Getting

### Binary

Go to the [releases page][releases].

[releases]: https://github.com/peterbourgon/fastly-exporter/releases

### Docker

Avaliable as [mrnetops/fastly-exporter][container] from [Docker Hub][hub].
Expand All @@ -21,18 +27,12 @@ Avaliable as [mrnetops/fastly-exporter][container] from [Docker Hub][hub].
docker pull mrnetops/fastly-exporter
```

### Binary

Go to the [releases page][releases].

[releases]: https://github.com/peterbourgon/fastly-exporter/releases

### Source

If you have a working Go installation, you can install the latest revision from HEAD.

```
go get github.com/peterbourgon/fastly-exporter
go get github.com/peterbourgon/fastly-exporter/cmd/fastly-exporter
```

## Using
Expand All @@ -54,53 +54,55 @@ FLAGS
-version false print version information and exit
```

A valid Fastly API token is mandatory. [See this link][token] for information on
A valid Fastly API token is required. [See this link][token] for information on
creating API tokens. The token can be provided via the `-token` flag or the
FASTLY_API_TOKEN environment variable.

[token]: https://docs.fastly.com/guides/account-management-and-security/using-api-tokens#creating-api-tokens
[db]: https://manage.fastly.com/services/all

There are a number of ways to determine which services are exported. By default,
all services available to your token will be exported. You can specify an
explicit set of service IDs by using the `-service xxx` flag. (Service IDs are
available at the top of your [Fastly dashboard][db].) You can also specify only
those services whose user-defined name matches a regex by using the
By default, all services available to your token will be exported. You can
specify an explicit set of service IDs by using the `-service xxx` flag.
(Service IDs are available at the top of your [Fastly dashboard][db].) You can
also specify only those services whose name matches a regex by using the
`-name-regex '^Production'` flag.

[db]: https://manage.fastly.com/services/all

For tokens with access to a lot of services, it's possible to "shard" the
services among different instances of the fastly-exporter by using the `-shard`
flag. For example, to shard all services between 3 expoters, you would start
each exporter as

```
fastly-exporter ... -shard 1/3
fastly-exporter ... -shard 2/3
fastly-exporter ... -shard 3/3
fastly-exporter [common flags] -shard 1/3
fastly-exporter [common flags] -shard 2/3
fastly-exporter [common flags] -shard 3/3
```

Flags which restrict the services that are exported combine with AND semantics.
That is, `-service A -service B -name-regex 'Foo'` would only export data for
service A or service B if their names also matched 'Foo'.
service A and/or B if their names also matched 'Foo'.

### Docker

This repo contains a Dockerfile if you want to build and package it yourself.
You can also use a third-party Docker image.

```
docker run -p 8080:8080 mrnetops/fastly-exporter -token $FASTLY_API_TOKEN
docker run -p 8080:8080 mrnetops/fastly-exporter -token $MY_TOKEN
```

### Docker Compose

[Docker Compose][compose] for a full fastly-exporter + [Prometheus][prom] +
[Grafana][grafana] + Fastly dashboard stack
This repo also contains a [Docker Compose][compose] file, which boots up a full
fastly-exporter + [Prometheus][prom] + [Grafana][grafana] + Fastly dashboard
stack.

[compose]: https://github.com/docker/compose
[grafana]: https://grafana.com

```
FASTLY_API_TOKEN=${FASTLY_API_TOKEN} docker-compose up
env FASTLY_API_TOKEN=$MY_TOKEN docker-compose up
```

Access the [Grafana][grafana] dashboard via http://localhost:3000.
Access the Grafana dashboard at http://localhost:3000.

![Fastly Dashboard in Grafana](https://raw.githubusercontent.com/peterbourgon/fastly-exporter/master/compose/Fastly-Dashboard.png)

0 comments on commit 3f27b80

Please sign in to comment.