Skip to content

Commit

Permalink
Additional style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
clayton-cornell committed Jan 14, 2025
1 parent a91634a commit a9e00ee
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ tls_config | [tls_config][] | TLS configuration for requests to the

Exactly one of the `oauth` or `managed_identity` blocks must be specified.

[managed_identity]: #managed_identity-block
[oauth]: #oauth-block
[tls_config]: #tls_config-block
[managed_identity]: #managed_identity
[oauth]: #oauth
[tls_config]: #tls_config

### managed_identity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ tls_config | [tls_config][] | Configure TLS settings for connecting
The `>` symbol indicates deeper levels of nesting.
For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside an `oauth2` block.

[basic_auth]: #basic_auth-block
[authorization]: #authorization-block
[oauth2]: #oauth2-block
[tls_config]: #tls_config-block
[authorization]: #authorization
[basic_auth]: #basic_auth
[oauth2]: #oauth2
[tls_config]: #tls_config

### authorization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Hierarchy | Block | Description
-----------|----------------|--------------------------------------------------------|---------
tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no

[tls_config]: #tls_config-block
[tls_config]: #tls_config

### tls_config

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Name | Type | Description

The DigitalOcean API uses bearer tokens for authentication, see more about it in the [DigitalOcean API documentation](https://docs.digitalocean.com/reference/api/api-reference/#section/Authentication).

Exactly one of the [`bearer_token`](#arguments) and [`bearer_token_file`](#arguments) arguments must be specified to authenticate against DigitalOcean.
Exactly one of the [`bearer_token`][arguments] and [`bearer_token_file`][arguments] arguments must be specified to authenticate against DigitalOcean.

[arguments]: #arguments

Expand Down
14 changes: 7 additions & 7 deletions docs/sources/reference/components/discovery/discovery.docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Name | Type | Description

* [`authorization` block][authorization]
* [`basic_auth` block][basic_auth]
* [`bearer_token_file` argument](#arguments)
* [`bearer_token` argument](#arguments)
* [`bearer_token_file` argument][arguments]
* [`bearer_token` argument][arguments]
* [`oauth2` block][oauth2]

[arguments]: #arguments
Expand All @@ -67,11 +67,11 @@ tls_config | [tls_config][] | Configure TLS settings for connecting
The `>` symbol indicates deeper levels of nesting.
For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside an `oauth2` block.

[filter]: #filter-block
[basic_auth]: #basic_auth-block
[authorization]: #authorization-block
[oauth2]: #oauth2-block
[tls_config]: #tls_config-block
[filter]: #filter
[basic_auth]: #basic_auth
[authorization]: #authorization
[oauth2]: #oauth2
[tls_config]: #tls_config

### authorization

Expand Down
131 changes: 65 additions & 66 deletions docs/sources/reference/components/discovery/discovery.dockerswarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ title: discovery.dockerswarm
## Usage

```alloy
discovery.dockerswarm "LABEL" {
host = "DOCKER_DAEMON_HOST"
role = "SWARM_ROLE"
discovery.dockerswarm "<LABEL>" {
host = "<DOCKER_DAEMON_HOST>"
role = "<SWARM_ROLE>"
}
```

Expand All @@ -27,92 +27,91 @@ Name | Type | Description
-------------------------|---------------------|-------------------------------------------------------------------------------------------------------------------------------|---------|---------
`host` | `string` | Address of the Docker daemon. | | yes
`role` | `string` | Role of the targets to retrieve. Must be `services`, `tasks`, or `nodes`. | | yes
`port` | `number` | The port to scrape metrics from, when `role` is nodes, and for discovered tasks and services that don't have published ports. | `80` | no
`refresh_interval` | `duration` | Interval at which to refresh the list of targets. | `"60s"` | no
`bearer_token_file` | `string` | File containing a bearer token to authenticate with. | | no
`bearer_token` | `secret` | Bearer token to authenticate with. | | no
`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no
`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no
`proxy_url` | `string` | HTTP proxy to send requests through. | | no
`no_proxy` | `string` | Comma-separated list of IP addresses, CIDR notations, and domain names to exclude from proxying. | | no
`proxy_from_environment` | `bool` | Use the proxy URL indicated by environment variables. | `false` | no
`port` | `number` | The port to scrape metrics from, when `role` is nodes, and for discovered tasks and services that don't have published ports. | `80` | no
`proxy_connect_header` | `map(list(secret))` | Specifies headers to send to proxies during CONNECT requests. | | no
`proxy_from_environment` | `bool` | Use the proxy URL indicated by environment variables. | `false` | no
`proxy_url` | `string` | HTTP proxy to send requests through. | | no
`refresh_interval` | `duration` | Interval at which to refresh the list of targets. | `"60s"` | no

At most, one of the following can be provided:
- [`bearer_token` argument](#arguments).
- [`bearer_token_file` argument](#arguments).
- [`basic_auth` block][basic_auth].
- [`authorization` block][authorization].
- [`oauth2` block][oauth2].

* [`authorization` block][authorization]
* [`basic_auth` block][basic_auth]
* [`bearer_token_file` argument](#arguments)
* [`bearer_token` argument](#arguments)
* [`oauth2` block][oauth2]

{{< docs/shared lookup="reference/components/http-client-proxy-config-description.md" source="alloy" version="<ALLOY_VERSION>" >}}

[arguments]: #arguments

## Blocks

The following blocks are supported inside the definition of
`discovery.dockerswarm`:
The following blocks are supported inside the definition of `discovery.dockerswarm`:

| Hierarchy | Block | Description | Required |
| ------------------- | ----------------- | ---------------------------------------------------------------------------------- | -------- |
| filter | [filter][] | Optional filter to limit the discovery process to a subset of available resources. | no |
| basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the endpoint. | no |
| authorization | [authorization][] | Configure generic authorization to the endpoint. | no |
| oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no |
| oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no |
| tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no |
Hierarchy | Block | Description | Required
--------------------|-------------------|------------------------------------------------------------------------------------|---------
authorization | [authorization][] | Configure generic authorization to the endpoint. | no
basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the endpoint. | no
filter | [filter][] | Optional filter to limit the discovery process to a subset of available resources. | no
oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no
oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no
tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no

The `>` symbol indicates deeper levels of nesting. For example,
`oauth2 > tls_config` refers to a `tls_config` block defined inside
an `oauth2` block.
The `>` symbol indicates deeper levels of nesting.
For example, `oauth2 > tls_config` refers to a `tls_config` block defined inside an `oauth2` block.

[filter]: #filter-block
[basic_auth]: #basic_auth-block
[authorization]: #authorization-block
[oauth2]: #oauth2-block
[tls_config]: #tls_config-block
[filter]: #filter
[basic_auth]: #basic_auth
[authorization]: #authorization
[oauth2]: #oauth2
[tls_config]: #tls_config

### filter block
### authorization

Filters can be used to limit the discovery process to a subset of available resources.
It is possible to define multiple `filter` blocks within the `discovery.dockerswarm` block.
The list of available filters depends on the `role`:
{{< docs/shared lookup="reference/components/authorization-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

- [services filters](https://docs.docker.com/engine/api/v1.40/#operation/ServiceList)
- [tasks filters](https://docs.docker.com/engine/api/v1.40/#operation/TaskList)
- [nodes filters](https://docs.docker.com/engine/api/v1.40/#operation/NodeList)
### basic_auth

The following arguments can be used to configure a filter.
{{< docs/shared lookup="reference/components/basic-auth-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

| Name | Type | Description | Default | Required |
| -------- | -------------- | ------------------------------------------ | ------- | -------- |
| `name` | `string` | Name of the filter. | | yes |
| `values` | `list(string)` | List of values associated with the filter. | | yes |
### filter

### basic_auth block
Filters can be used to limit the discovery process to a subset of available resources.
It is possible to define multiple `filter` blocks within the `discovery.dockerswarm` block.
The list of available filters depends on the `role`:

{{< docs/shared lookup="reference/components/basic-auth-block.md" source="alloy" version="<ALLOY_VERSION>" >}}
* [nodes filters](https://docs.docker.com/engine/api/v1.40/#operation/NodeList)
* [services filters](https://docs.docker.com/engine/api/v1.40/#operation/ServiceList)
* [tasks filters](https://docs.docker.com/engine/api/v1.40/#operation/TaskList)

### authorization block
The following arguments can be used to configure a filter.

{{< docs/shared lookup="reference/components/authorization-block.md" source="alloy" version="<ALLOY_VERSION>" >}}
Name | Type | Description | Default | Required
---------|----------------|--------------------------------------------|---------|---------
`name` | `string` | Name of the filter. | | yes
`values` | `list(string)` | List of values associated with the filter. | | yes

### oauth2 block
### oauth2

{{< docs/shared lookup="reference/components/oauth2-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### tls_config block
### tls_config

{{< docs/shared lookup="reference/components/tls-config-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Exported fields

The following fields are exported and can be referenced by other components:

| Name | Type | Description |
| --------- | ------------------- | ----------------------------------------- |
| `targets` | `list(map(string))` | The set of targets discovered from Swarm. |
Name | Type | Description
----------|---------------------|------------------------------------------
`targets` | `list(map(string))` | The set of targets discovered from Swarm.

## Roles

Expand All @@ -126,21 +125,21 @@ If a service has no published ports, a target per service is created using the `

Available meta labels:

- `__meta_dockerswarm_service_id`: the ID of the service.
- `__meta_dockerswarm_service_name`: the name of the service.
- `__meta_dockerswarm_service_mode`: the mode of the service.
- `__meta_dockerswarm_service_endpoint_port_name`: the name of the endpoint port, if available.
- `__meta_dockerswarm_service_endpoint_port_publish_mode`: the publish mode of the endpoint port.
- `__meta_dockerswarm_service_label_<labelname>`: each label of the service.
- `__meta_dockerswarm_service_task_container_hostname`: the container hostname of the target, if available.
- `__meta_dockerswarm_service_task_container_image`: the container image of the target.
- `__meta_dockerswarm_service_updating_status`: the status of the service, if available.
- `__meta_dockerswarm_network_id`: the ID of the network.
- `__meta_dockerswarm_network_name`: the name of the network.
- `__meta_dockerswarm_network_ingress`: whether the network is ingress.
- `__meta_dockerswarm_network_internal`: whether the network is internal.
- `__meta_dockerswarm_network_label_<labelname>`: each label of the network.
- `__meta_dockerswarm_network_scope`: the scope of the network.
* `__meta_dockerswarm_network_id`: the ID of the network.
* `__meta_dockerswarm_network_ingress`: whether the network is ingress.
* `__meta_dockerswarm_network_internal`: whether the network is internal.
* `__meta_dockerswarm_network_label_<labelname>`: each label of the network.
* `__meta_dockerswarm_network_name`: the name of the network.
* `__meta_dockerswarm_network_scope`: the scope of the network.
* `__meta_dockerswarm_service_endpoint_port_name`: the name of the endpoint port, if available.
* `__meta_dockerswarm_service_endpoint_port_publish_mode`: the publish mode of the endpoint port.
* `__meta_dockerswarm_service_id`: the ID of the service.
* `__meta_dockerswarm_service_label_<labelname>`: each label of the service.
* `__meta_dockerswarm_service_mode`: the mode of the service.
* `__meta_dockerswarm_service_name`: the name of the service.
* `__meta_dockerswarm_service_task_container_hostname`: the container hostname of the target, if available.
* `__meta_dockerswarm_service_task_container_image`: the container image of the target.
* `__meta_dockerswarm_service_updating_status`: the status of the service, if available.

### tasks

Expand Down

0 comments on commit a9e00ee

Please sign in to comment.