Skip to content

Commit

Permalink
More lint cleanup and error fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
clayton-cornell committed Nov 28, 2024
1 parent 2632122 commit 4994501
Show file tree
Hide file tree
Showing 25 changed files with 80 additions and 87 deletions.
1 change: 1 addition & 0 deletions docs/sources/shared/reference/components/azuread-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description | Default | Required
`cloud` | `string` | The Azure Cloud. | `"AzurePublic"` | no

The supported values for `cloud` are:

* `"AzurePublic"`
* `"AzureChina"`
* `"AzureGovernment"`
14 changes: 8 additions & 6 deletions docs/sources/shared/reference/components/extract-field-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description
`tag_name` | `string` | The name of the resource attribute added to logs, metrics, or spans. | `""` | no

When you don't specify the `tag_name`, a default tag name is used with the format:

* `k8s.pod.annotations.<annotation key>`
* `k8s.pod.labels.<label key>`

Expand All @@ -23,19 +24,20 @@ For example, if `tag_name` isn't specified and the key is `git_sha`, the attribu
You can set either the `key` attribute or the `key_regex` attribute, but not both.
When `key_regex` is present, `tag_name` supports back reference to both named capturing and positioned capturing.

For example, assume your pod spec contains the following labels:
For example, assume your Pod spec contains the following labels:

* `app.kubernetes.io/component: mysql`
* `app.kubernetes.io/version: 5.7.21`

If you'd like to add tags for all labels with the prefix `app.kubernetes.io/` and trim the prefix, then you can specify the following extraction rules:

```alloy
extract {
label {
from = "pod"
key_regex = "kubernetes.io/(.*)"
tag_name = "$1"
}
label {
from = "pod"
key_regex = "kubernetes.io/(.*)"
tag_name = "$1"
}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name | Type | Description
`op` | `string` | The filter operation to apply on the given key: value pair. | `equals` | no

For `op`, the following values are allowed:

* `equals`: The field value must equal the provided value.
* `not-equals`: The field value must not be equal to the provided value.
* `exists`: The field value must exist. Only applicable to `annotation` fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ headless: true
`no_proxy` can contain IPs, CIDR notations, and domain names. IP and domain names can contain port numbers.
`proxy_url` must be configured if `no_proxy` is configured.

`proxy_from_environment` uses the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof).
`proxy_from_environment` uses the environment variables HTTP_PROXY, HTTPS_PROXY, and NO_PROXY (or the lowercase versions thereof).
Requests use the proxy from the environment variable matching their scheme, unless excluded by NO_PROXY.
`proxy_url` and `no_proxy` must not be configured if `proxy_from_environment` is configured.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Name | Type | Description
`listen_address` | `string` | Network address on which the server listens for new connections. It defaults to accepting all incoming connections. | `""` | no
`listen_port` | `int` | Port number on which the server listens for new connections. Defaults to a random free port. | `0` | no
`max_connection_age_grace` | `duration` | An additive period after `max_connection_age` after which the connection is forcibly closed. | `"infinity"` | no
`max_connection_age` | `duration` | The duration for the maximum time a connection may exist before it is closed. | `"infinity"` | no
`max_connection_age` | `duration` | The duration for the maximum time a connection may exist before it's closed. | `"infinity"` | no
`max_connection_idle` | `duration` | The duration after which an idle connection is closed. | `"infinity"` | no
`server_max_concurrent_streams` | `int` | Limit on the number of concurrent streams for gRPC calls (0 = unlimited). | `100` | no
`server_max_recv_msg_size` | `int` | Limit on the size of a gRPC message this server can receive (bytes). | `4MB` | no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Name | Type | Description
`client_id` | `string` | Client ID of the managed identity used to authenticate. | | yes

`client_id` should be a valid [UUID][] in one of the supported formats:

* `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
* `urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
* Microsoft encoding: `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ If configured, `disable_high_cardinality_metrics` only applies to `otelcol.expor
{{< /admonition >}}

`level` is the {{< param "PRODUCT_NAME" >}} equivalent to the `telemetry.metrics.level` feature gate in the OpenTelemetry Collector.
Possible values are `"none"`, `"basic"`, `"normal"` and `"detailed"`.
Possible values are `"none"`, `"basic"`, `"normal"` and `"detailed"`.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Name | Type | Description | Default | Required
`key` | `string` | The resource key. | | yes
`value` | `any` | The resource value to match against. | | no

If `value` is not set, any value will match.
If `value` isn't set, any value will match.
The type of `value` could be a number, a string, or a boolean.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ headless: true
---

The supported values for `balancer_name` are listed in the gRPC documentation on [Load balancing][]:

* `pick_first`: Tries to connect to the first address, uses it for all RPCs if it connects, or tries the next address if it fails (and keeps doing that until one connection is successful).
Because of this, all the RPCs will be sent to the same backend.
* `round_robin`: Connects to all the addresses it sees and sends an RPC to each backend one at a time in order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ description: Shared content, otelcol Kafka Kerberos authentication
headless: true
---

The `kerberos` block configures Kerberos authentication against the Kafka
broker.
The `kerberos` block configures Kerberos authentication against the Kafka broker.

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`service_name` | `string` | Kerberos service name. | | no
`realm` | `string` | Kerberos realm. | | no
`use_keytab` | `string` | Enables using keytab instead of password. | | no
`username` | `string` | Kerberos username to authenticate as. | | yes
`password` | `secret` | Kerberos password to authenticate with. | | no
`config_file` | `string` | Path to Kerberos location (for example, `/etc/krb5.conf`). | | no
`keytab_file` | `string` | Path to keytab file (for example, `/etc/security/kafka.keytab`). | | no
`disable_fast_negotiation` | `bool` | Disable PA-FX-FAST negotiation. | `false` | no
Name | Type | Description | Default | Required
---------------------------|----------|-----------------------------------------------------------------|---------|---------
`service_name` | `string` | Kerberos service name. | | no
`realm` | `string` | Kerberos realm. | | no
`use_keytab` | `string` | Enables using keytab instead of password. | | no
`username` | `string` | Kerberos username to authenticate as. | | yes
`password` | `secret` | Kerberos password to authenticate with. | | no
`config_file` | `string` | Path to Kerberos location, for example, `/etc/krb5.conf`. | | no
`keytab_file` | `string` | Path to keytab file, for example, `/etc/security/kafka.keytab`. | | no
`disable_fast_negotiation` | `bool` | Disable PA-FX-FAST negotiation. | `false` | no

When `use_keytab` is `false`, the `password` argument is required. When
`use_keytab` is `true`, the file pointed to by the `keytab_file` argument is
used for authentication instead. At most one of `password` or `keytab_file`
must be provided.
When `use_keytab` is `false`, the `password` argument is required.
When `use_keytab` is `true`, the file pointed to by the `keytab_file` argument is used for authentication instead.
At most one of `password` or `keytab_file` must be provided.

`disable_fast_negotiation` is useful for Kerberos implementations which do not support PA-FX-FAST (Pre-Authentication Framework - Fast) negotiation.
`disable_fast_negotiation` is useful for Kerberos implementations which don't support PA-FX-FAST (Pre-Authentication Framework - Fast) negotiation.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `plaintext` block configures plain text authentication against Kafka brokers

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`username` | `string` | Username to use for plain text authentication. | | yes
`password` | `secret` | Password to use for plain text authentication. | | yes
Name | Type | Description | Default | Required
-----------|----------|------------------------------------------------|---------|---------
`username` | `string` | Username to use for plain text authentication. | | yes
`password` | `secret` | Password to use for plain text authentication. | | yes
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ description: Shared content, otelcol Kafka SASL AWS_MSK authentication
headless: true
---

The `aws_msk` block configures extra parameters for SASL authentication when
using the `AWS_MSK_IAM` mechanism.
The `aws_msk` block configures extra parameters for SASL authentication when using the `AWS_MSK_IAM` mechanism.

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`region` | `string` | AWS region the MSK cluster is based in. | | yes
`broker_addr` | `string` | MSK address to connect to for authentication. | | yes
Name | Type | Description | Default | Required
--------------|----------|-----------------------------------------------|---------|---------
`region` | `string` | AWS region the MSK cluster is based in. | | yes
`broker_addr` | `string` | MSK address to connect to for authentication. | | yes
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ The `sasl` block configures SASL authentication against Kafka brokers.

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`username` | `string` | Username to use for SASL authentication. | | yes
`password` | `secret` | Password to use for SASL authentication. | | yes
`mechanism` | `string` | SASL mechanism to use when authenticating. | | yes
`version` | `number` | Version of the SASL Protocol to use when authenticating. | `0` | no
Name | Type | Description | Default | Required
------------|----------|----------------------------------------------------------|---------|---------
`username` | `string` | Username to use for SASL authentication. | | yes
`password` | `secret` | Password to use for SASL authentication. | | yes
`mechanism` | `string` | SASL mechanism to use when authenticating. | | yes
`version` | `number` | Version of the SASL Protocol to use when authenticating. | `0` | no

The `mechanism` argument can be set to one of the following strings:

Expand All @@ -23,4 +23,4 @@ The `mechanism` argument can be set to one of the following strings:

When `mechanism` is set to `"AWS_MSK_IAM"`, the `aws_msk` child block must also be provided.

The `version` argument can be set to either `0` or `1`.
You can set the `version` argument to either `0` or `1`.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ description: Shared content, otelcol Kafka authentication
headless: true
---

The `authentication` block holds the definition of different authentication
mechanisms to use when connecting to Kafka brokers. It doesn't support any
arguments and is configured fully through inner blocks.
The `authentication` block holds the definition of different authentication mechanisms to use when connecting to Kafka brokers.
It doesn't support any arguments and is configured fully through inner blocks.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ description: Shared content, otelcol Kafka metadata retry
headless: true
---

The `retry` block configures how to retry retrieving metadata when retrieval
fails.
The `retry` block configures how to retry retrieving metadata when retrieval fails.

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`max_retries` | `number` | How many times to reattempt retrieving metadata. | `3` | no
`backoff` | `duration` | Time to wait between retries. | `"250ms"` | no
Name | Type | Description | Default | Required
--------------|------------|--------------------------------------------------|-----------|---------
`max_retries` | `number` | How many times to reattempt retrieving metadata. | `3` | no
`backoff` | `duration` | Time to wait between retries. | `"250ms"` | no
20 changes: 8 additions & 12 deletions docs/sources/shared/reference/components/otelcol-kafka-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ description: Shared content, otelcol Kafka metadata
headless: true
---

The `metadata` block configures how to retrieve and store metadata from the
Kafka broker.
The `metadata` block configures how to retrieve and store metadata from the Kafka broker.

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`include_all_topics` | `bool` | When true, maintains metadata for all topics. | `true` | no
Name | Type | Description | Default | Required
---------------------|--------|-----------------------------------------------|---------|---------
`include_all_topics` | `bool` | When true, maintains metadata for all topics. | `true` | no

If the `include_all_topics` argument is `true`,
a full set of metadata for all topics is maintained rather than the minimal set
that has been necessary so far. Including the full set of metadata is more
convenient for users but can consume a substantial amount of memory if you have
many topics and partitions.
If the `include_all_topics` argument is `true`, a full set of metadata for all topics is maintained rather than the minimal set that has been necessary so far.
Including the full set of metadata is more convenient for users but can consume a substantial amount of memory if you have many topics and partitions.

Retrieving metadata may fail if the Kafka broker is starting up at the same
time as the Alloy component. The `retry` child block can be provided to customize retry behavior.
Retrieving metadata may fail if the Kafka broker is starting up at the same time as the {{< param "PRODUCT_NAME" >}} component.
The `retry` child block can be provided to customize retry behavior.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ The `max_interval` argument specifies the upper bound of how long to wait betwee
The `randomization_factor` argument is useful for adding jitter between retrying Alloy instances.
If `randomization_factor` is greater than `0`, the wait time before retries is multiplied by a random factor in the range `[ I - randomization_factor * I, I + randomization_factor * I]`, where `I` is the current interval.

If a batch hasn't been sent successfully, it is discarded after the time specified by `max_elapsed_time` elapses.
If a batch hasn't been sent successfully, it's discarded after the time specified by `max_elapsed_time` elapses.
If `max_elapsed_time` is set to `"0s"`, failed requests are retried forever until they succeed.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ The following pairs of arguments are mutually exclusive and can't both be set si
* `key_pem` and `key_file`

If `cipher_suites` is left blank, a safe default list is used.
See the [Go TLS documentation][golang-tls] for a list of supported cipher suites.
Refer to the [Go TLS documentation][golang-tls] for a list of supported cipher suites.

[golang-tls]: https://go.dev/src/crypto/tls/cipher_suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ The `output` block configures a set of components to forward resulting telemetry

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`metrics` | `list(otelcol.Consumer)` | List of consumers to send metrics to. | `[]` | no
Name | Type | Description | Default | Required
----------|--------------------------|---------------------------------------|---------|---------
`metrics` | `list(otelcol.Consumer)` | List of consumers to send metrics to. | `[]` | no

You must specify the `output` block, but all its arguments are optional.
By default, telemetry data is dropped.
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/shared/reference/components/rule-block-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Name | Type | Description
`replacement` | `string` | The value against which a regular expression replace is performed if the regular expression matches the extracted value. Supports previously captured groups. | `"$1"` | no
`separator` | `string` | The separator used to concatenate the values present in `source_labels`. | ; | no
`source_labels` | `list(string)` | The list of labels whose values are to be selected. Their content is concatenated using the `separator` and matched against `regex`. | | no
`target_label` | `string` | Label to which the resulting value is written to. | | no
`target_label` | `string` | Label to which the resulting value is written to. | | no

You can use the following actions:

* `drop` - Drops logs where `regex` matches the string extracted using the `source_labels` and `separator`.
* `dropequal` - Drop targets for which the concatenated `source_labels` do match `target_label`.
* `hashmod` - Hashes the concatenated labels, calculates its modulo `modulus`, and writes the result to the `target_label`.
* `keep` - Keeps logs where `regex` matches the string extracted using the `source_labels` and `separator`.
* `keepequal` - Drop targets for which the concatenated `source_labels` do not match `target_label`.
* `keepequal` - Drop targets for which the concatenated `source_labels` don't match `target_label`.
* `labeldrop` - Matches `regex` against all label names. Any labels that match are removed from the log's label set.
* `labelkeep` - Matches `regex` against all label names. Any labels that don't match are removed from the log's label set.
* `labelmap` - Matches `regex` against all label names. Any labels that match are renamed according to the contents of the `replacement` field.
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/shared/reference/components/rule-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can use the following actions:
* `dropequal` - Drop targets for which the concatenated `source_labels` do match `target_label`.
* `hashmod` - Hashes the concatenated labels, calculates its modulo `modulus` and writes the result to the `target_label`.
* `keep` - Keeps metrics where `regex` matches the string extracted using the `source_labels` and `separator`.
* `keepequal` - Drop targets for which the concatenated `source_labels` do not match `target_label`.
* `keepequal` - Drop targets for which the concatenated `source_labels` don't match `target_label`.
* `labeldrop` - Matches `regex` against all label names. Any labels that match are removed from the metric's label set.
* `labelkeep` - Matches `regex` against all label names. Any labels that don't match are removed from the metric's label set.
* `labelmap` - Matches `regex` against all label names. Any labels that match are renamed according to the contents of the `replacement` field.
Expand Down
Loading

0 comments on commit 4994501

Please sign in to comment.