Skip to content

Commit

Permalink
Update and lint discovery.azure to discovery.dockerswarm (#2403)
Browse files Browse the repository at this point in the history
* Update discover azure and consul topics

* Update dogitalocean, dns, and docker topics

* Additional style cleanup

* Linting updates and edits

* Syntax and mardown cleanup

* Minor updates from review

* Add missing descriptions and add OSS badge

* Fix a typo and two sentences

* Simplify link definitions

* Fix typo and remove duplicated frontmatter

* Fix literal string quoting in examples

(cherry picked from commit 63ba016)
  • Loading branch information
clayton-cornell authored and grafanabot committed Jan 22, 2025
1 parent 717c993 commit 0a2b72e
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 367 deletions.
2 changes: 1 addition & 1 deletion docs/sources/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
canonical: https://grafana.com/docs/alloy/latest/
title: Grafana Alloy
description: Grafana Alloy is a a vendor-neutral distribution of the OTel Collector
description: Grafana Alloy is a vendor-neutral distribution of the OTel Collector
weight: 350
cascade:
ALLOY_RELEASE: v1.5.1
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
canonical: https://grafana.com/docs/alloy/latest/
title: Grafana Alloy
description: Grafana Alloy is a a vendor-neutral distribution of the OTel Collector
description: Grafana Alloy is a vendor-neutral distribution of the OTel Collector
weight: 350
cascade:
ALLOY_RELEASE: $ALLOY_VERSION
Expand Down
106 changes: 56 additions & 50 deletions docs/sources/reference/components/discovery/discovery.azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,60 @@ discovery.azure "<LABEL>" {

## Arguments

The following arguments are supported:
You can use the following arguments with `discovery.azure`:

Name | Type | Description | Default | Required
-------------------------|---------------------|--------------------------------------------------------------------------------------------------|----------------------|---------
`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | no
`environment` | `string` | Azure environment. | `"AzurePublicCloud"` | no
`port` | `number` | Port to be appended to the `__address__` label for each target. | `80` | no
`subscription_id` | `string` | Azure subscription ID. | | no
`refresh_interval` | `duration` | Interval at which to refresh the list of targets. | `5m` | no
`proxy_url` | `string` | HTTP proxy to send requests through. | | no
`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | 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 appended to the `__address__` label for each target. | `80` | no
`proxy_connect_header` | `map(list(secret))` | Specifies headers to send to proxies during CONNECT requests. | | no
`follow_redirects` | `bool` | Whether redirects returned by the server should be followed. | `true` | no
`enable_http2` | `bool` | Whether HTTP2 is supported for requests. | `true` | 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. | `5m` | no
`subscription_id` | `string` | Azure subscription ID. | | no

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

## Blocks
The following blocks are supported inside the definition of
`discovery.azure`:

Hierarchy | Block | Description | Required
-----------------|----------------------|--------------------------------------------------|---------
oauth | [oauth][] | OAuth configuration for Azure API. | no
managed_identity | [managed_identity][] | Managed Identity configuration for Azure API. | no
tls_config | [tls_config][] | TLS configuration for requests to the Azure API. | no
You can use the following blocks with `discovery.azure`:

Exactly one of the `oauth` or `managed_identity` blocks must be specified.
Block | Description | Required
---------------------|--------------------------------------------------|---------
[managed_identity][] | Managed Identity configuration for Azure API. | no
[oauth][] | OAuth 2.0 configuration for Azure API. | no
[tls_config][] | TLS configuration for requests to the Azure API. | no

[oauth]: #oauth-block
[managed_identity]: #managed_identity-block
[tls_config]: #tls_config-block
You must specify exactly one of the `oauth` or `managed_identity` blocks.

### oauth block
The `oauth` block configures OAuth authentication for the Azure API.
[managed_identity]: #managed_identity
[oauth]: #oauth
[tls_config]: #tls_config

Name | Type | Description | Default | Required
----------------|----------|----------------------|---------|---------
`client_id` | `string` | OAuth client ID. | | yes
`client_secret` | `string` | OAuth client secret. | | yes
`tenant_id` | `string` | OAuth tenant ID. | | yes
### managed_identity

### managed_identity block
The `managed_identity` block configures Managed Identity authentication for the Azure API.

Name | Type | Description | Default | Required
------------|----------|-----------------------------|---------|---------
`client_id` | `string` | Managed Identity client ID. | | yes

### tls_config block
### oauth

The `oauth` block configures OAuth 2.0 authentication for the Azure API.

Name | Type | Description | Default | Required
----------------|----------|--------------------------|---------|---------
`client_id` | `string` | OAuth 2.0 client ID. | | yes
`client_secret` | `string` | OAuth 2.0 client secret. | | yes
`tenant_id` | `string` | OAuth 2.0 tenant ID. | | yes

### tls_config

The `tls_config` block configures TLS settings for requests to the Azure API.

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

Expand All @@ -84,21 +88,22 @@ Name | Type | Description

Each target includes the following labels:

* `__meta_azure_subscription_id`: The Azure subscription ID.
* `__meta_azure_tenant_id`: The Azure tenant ID.
* `__meta_azure_machine_id`: The UUID of the Azure VM.
* `__meta_azure_machine_resource_group`: The name of the resource group the VM is in.
* `__meta_azure_machine_name`: The name of the VM.
* `__meta_azure_machine_computer_name`: The host OS name of the VM.
* `__meta_azure_machine_os_type`: The OS the VM is running (either `Linux` or `Windows`).
* `__meta_azure_machine_id`: The UUID of the Azure VM.
* `__meta_azure_machine_location`: The region the VM is in.
* `__meta_azure_machine_name`: The name of the VM.
* `__meta_azure_machine_os_type`: The OS the VM is running, either `Linux` or `Windows`.
* `__meta_azure_machine_private_ip`: The private IP address of the VM.
* `__meta_azure_machine_public_ip`: The public IP address of the VM.
* `__meta_azure_machine_tag_*`: A tag on the VM. There will be one label per tag.
* `__meta_azure_machine_resource_group`: The name of the resource group the VM is in.
* `__meta_azure_machine_scale_set`: The name of the scale set the VM is in.
* `__meta_azure_machine_size`: The size of the VM.
* `__meta_azure_machine_tag_*`: A tag on the VM. There is one label per tag.
* `__meta_azure_subscription_id`: The Azure subscription ID.
* `__meta_azure_tenant_id`: The Azure tenant ID.

Each discovered VM maps to a single target. The `__address__` label is set to the `private_ip:port` (`[private_ip]:port` if the private IP is an IPv6 address) of the VM.
Each discovered VM maps to a single target.
The `__address__` label is set to the `private_ip:port` of the VM if the private IP is an IPv4 address, or `[private_ip]:port` if the private IP of the VM is an IPv6 address.

## Component health

Expand All @@ -118,11 +123,11 @@ In those cases, exported fields retain their last healthy values.
```alloy
discovery.azure "example" {
port = 80
subscription_id = <AZURE_SUBSCRIPTION_ID>
subscription_id = "<AZURE_SUBSCRIPTION_ID>"
oauth {
client_id = <AZURE_CLIENT_ID>
client_secret = <AZURE_CLIENT_SECRET>
tenant_id = <AZURE_TENANT_ID>
client_id = "<AZURE_CLIENT_ID>"
client_secret = "<AZURE_CLIENT_SECRET>"
tenant_id = "<AZURE_TENANT_ID>"
}
}
Expand All @@ -133,24 +138,25 @@ prometheus.scrape "demo" {
prometheus.remote_write "demo" {
endpoint {
url = <PROMETHEUS_REMOTE_WRITE_URL>
url = "<PROMETHEUS_REMOTE_WRITE_URL>"
basic_auth {
username = <USERNAME>
password = <PASSWORD>
username = "<USERNAME>"
password = "<PASSWORD>"
}
}
}
```

Replace the following:
- _`<AZURE_SUBSCRIPTION_ID>`_: Your Azure subscription ID.
- _`<AZURE_CLIENT_ID>`_: Your Azure client ID.
- _`<AZURE_CLIENT_SECRET>`_: Your Azure client secret.
- _`<AZURE_TENANT_ID>`_: Your Azure tenant ID.
- _`<PROMETHEUS_REMOTE_WRITE_URL>`_: The URL of the Prometheus remote_write-compatible server to send metrics to.
- _`<USERNAME>`_: The username to use for authentication to the remote_write API.
- _`<PASSWORD>`_: The password to use for authentication to the remote_write API.

* _`<AZURE_SUBSCRIPTION_ID>`_: Your Azure subscription ID.
* _`<AZURE_CLIENT_ID>`_: Your Azure client ID.
* _`<AZURE_CLIENT_SECRET>`_: Your Azure client secret.
* _`<AZURE_TENANT_ID>`_: Your Azure tenant ID.
* _`<PROMETHEUS_REMOTE_WRITE_URL>`_: The URL of the Prometheus remote_write-compatible server to send metrics to.
* _`<USERNAME>`_: The username to use for authentication to the `remote_write` API.
* _`<PASSWORD>`_: The password to use for authentication to the `remote_write` API.

<!-- START GENERATED COMPATIBLE COMPONENTS -->

Expand Down
Loading

0 comments on commit 0a2b72e

Please sign in to comment.