From 787ea3c247959b0cd8b827def938fd6e4329c3f5 Mon Sep 17 00:00:00 2001 From: Peter Bourgon Date: Wed, 17 Jun 2020 17:10:18 +0200 Subject: [PATCH] Fix a few missed strings --- README.md | 17 ++++++++--------- pkg/api/cache_test.go | 6 +++--- pkg/filter/doc.go | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 98d7bf6..deba111 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ go get github.com/peterbourgon/fastly-exporter/cmd/fastly-exporter ### Basic For simple use cases, all you need is a Fastly API token. -[See this link][token] for information on creating API tokens. -The token can be provided via the `-token` flag or the +[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 @@ -59,8 +59,8 @@ By default, all services available to your token will be exported. You can specify an explicit set of service IDs to export by using the `-service xxx` flag. (Service IDs are available at the top of your [Fastly dashboard][db].) You can also include only those services whose name matches a regex by using the -`-service-whitelist '^Production'` flag, or skip any service whose name matches -a regex by using the `-service-blacklist '.*TEST.*'` flag. +`-service-allowlist '^Production'` flag, or skip any service whose name matches +a regex by using the `-service-blocklist '.*TEST.*'` flag. [db]: https://manage.fastly.com/services/all @@ -79,19 +79,19 @@ fastly-exporter [common flags] -service-shard 3/3 By default, all metrics provided by the Fastly real-time stats API are exported as Prometheus metrics. You can export only those metrics whose name matches a -regex by using the `-metric-whitelist 'bytes_total$'` flag, or elide any metric -whose name matches a regex by using the `-metric-blacklist imgopto` flag. +regex by using the `-metric-allowlist 'bytes_total$'` flag, or elide any metric +whose name matches a regex by using the `-metric-blocklist imgopto` flag. ### Filter semantics All flags that restrict services or metrics are repeatable. Repeating the same flag causes its condition to be combined with OR semantics. For example, `-service A -service B` would include both services A and B (but not service C). -Or, `-service-blacklist Test -service-blacklist Staging` would skip any service +Or, `-service-blocklist Test -service-blocklist Staging` would skip any service whose name contained Test or Staging. Different flags (for the same filter target) combine with AND semantics. For -example, `-metric-whitelist 'bytes_total$' -metric-blacklist imgopto` would only +example, `-metric-allowlist 'bytes_total$' -metric-blocklist imgopto` would only export metrics whose names ended in bytes_total, but didn't include imgopto. ### Docker @@ -117,4 +117,3 @@ env FASTLY_API_TOKEN=$MY_TOKEN docker-compose up Access the Grafana dashboard at http://localhost:3000. ![Fastly Dashboard in Grafana](https://raw.githubusercontent.com/peterbourgon/fastly-exporter/master/compose/Fastly-Dashboard.png) - diff --git a/pkg/api/cache_test.go b/pkg/api/cache_test.go index 0f6b9b3..be3d784 100644 --- a/pkg/api/cache_test.go +++ b/pkg/api/cache_test.go @@ -27,17 +27,17 @@ func TestCache(t *testing.T) { want: []api.Service{s1, s2}, }, { - name: "whitelist both", + name: "allowlist both", options: []api.CacheOption{api.WithExplicitServiceIDs(s1.ID, s2.ID, "additional service ID")}, want: []api.Service{s1, s2}, }, { - name: "whitelist one", + name: "allowlist one", options: []api.CacheOption{api.WithExplicitServiceIDs(s1.ID)}, want: []api.Service{s1}, }, { - name: "whitelist none", + name: "allowlist none", options: []api.CacheOption{api.WithExplicitServiceIDs("nonexistant service ID")}, want: []api.Service{}, }, diff --git a/pkg/filter/doc.go b/pkg/filter/doc.go index 7ba6a76..4900bf3 100644 --- a/pkg/filter/doc.go +++ b/pkg/filter/doc.go @@ -1,2 +1,2 @@ -// Package filter provides whitelist- and blacklist-based string filtering. +// Package filter provides allowlist- and blocklist-based string filtering. package filter