Skip to content

Commit 6ce9c23

Browse files
sarah-wittAAraKKehestonhoffman
authored
Update Fly.io docs to recommend using readonly auth token (DataDog#21264)
* update fly.io docs * Update fly_io/README.md Co-authored-by: Heston Hoffman <heston.hoffman@datadoghq.com> --------- Co-authored-by: Juanpe Araque <juanpedro.araque@datadoghq.com> Co-authored-by: Heston Hoffman <heston.hoffman@datadoghq.com>
1 parent a5c52c1 commit 6ce9c23

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

fly_io/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@ The Fly.io check is included in the [Datadog Agent][2] package. We recommend dep
2727
2828
2. Set a [secret][17] for your Datadog API key called `DD_API_KEY`, and optionally your [site][14] as `DD_SITE`.
2929
30-
3. In your app's directory, create a `conf.yaml` file for the Fly.io integration, [configure](#Configuration) the integration, and mount it in the Agent's `conf.d/fly_io.d/` directory as `conf.yaml`:
30+
3. Create a [read-only][23] authentication token.
31+
32+
4. In your app's directory, create a `conf.yaml` file for the Fly.io integration, [configure](#configuration) the integration, and mount it in the Agent's `conf.d/fly_io.d/` directory as `conf.yaml`:
3133
3234
```
3335
instances:
3436
- empty_default_hostname: true
3537
headers:
36-
Authorization: Bearer <YOUR_FLY_TOKEN>
38+
Authorization: FlyV1 <YOUR_FLY_TOKEN>
3739
machines_api_endpoint: http://_api.internal:4280
3840
org_slug: <YOUR_ORG_SLUG>
3941
```
4042
41-
4. [Deploy][16] your app.
43+
5. [Deploy][16] your app.
4244
4345
**Note**: To collect traces and custom metrics from your applications, see [Application traces](#Application-traces).
4446
@@ -166,3 +168,4 @@ Need help? Contact [Datadog support][9].
166168
[20]: https://fly.io/docs/machines/api/
167169
[21]: https://docs.datadoghq.com/logs/log_configuration/pipelines/?tab=source#integration-pipeline-library
168170
[22]: https://vector.dev/docs/reference/configuration/transforms/lua/
171+
[23]: https://fly.io/docs/flyctl/tokens-create-readonly/

fly_io/assets/configuration/spec.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ files:
1818
for authentication for both the OpenMetrics endpoint and REST API.
1919
You can alternatively use the `auth_token` option.
2020
21-
You can create an access token with this command:
22-
`TOKEN=$(flyctl auth token)`
21+
You can create a read-only token with this command:
22+
`fly tokens create readonly`
23+
24+
Alternatively, you can use the `flyctl auth token` command to create a token. If using this
25+
type of token, the header value should be: `Authorization: "Bearer <FLY_ACCESS_TOKEN>"`. Note this
26+
option is no longer recommended: https://fly.io/docs/security/tokens/.
2327
headers.value.example:
24-
Authorization: "Bearer <FLY_ACCESS_TOKEN>"
28+
Authorization: "FlyV1 <FLY_ACCESS_TOKEN>"
2529
auth_token.display_priority: 2
2630
empty_default_hostname.display_priority: 1
2731
empty_default_hostname.required: true

fly_io/datadog_checks/fly_io/data/conf.yaml.example

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ instances:
5656
## for authentication for both the OpenMetrics endpoint and REST API.
5757
## You can alternatively use the `auth_token` option.
5858
##
59-
## You can create an access token with this command:
60-
## `TOKEN=$(flyctl auth token)`
59+
## You can create a read-only token with this command:
60+
## `fly tokens create readonly`
61+
##
62+
## Alternatively, you can use the `flyctl auth token` command to create a token. If using this
63+
## type of token, the header value should be: `Authorization: "Bearer <FLY_ACCESS_TOKEN>"`. Note this
64+
## option is no longer recommended: https://fly.io/docs/security/tokens/.
6165
#
6266
headers:
63-
Authorization: Bearer <FLY_ACCESS_TOKEN>
67+
Authorization: FlyV1 <FLY_ACCESS_TOKEN>
6468

6569
## @param machines_api_endpoint - string - optional
6670
## Endpoint of the Fly.io Machines Restful API.

0 commit comments

Comments
 (0)