From 2ef9f1e5966930ece134a60851a5c95f6d38b355 Mon Sep 17 00:00:00 2001 From: Clayton Cornell Date: Thu, 28 Nov 2024 13:40:20 -0800 Subject: [PATCH] More linting corrections --- docs/sources/reference/cli/convert.md | 14 ++-- .../reference/cli/environment-variables.md | 60 ++++++++--------- docs/sources/reference/cli/fmt.md | 8 +-- docs/sources/reference/cli/run.md | 51 +++++++------- docs/sources/reference/cli/tools.md | 16 ++--- .../sources/reference/compatibility/_index.md | 4 +- docs/sources/reference/config-blocks/http.md | 66 +++++++++---------- .../reference/config-blocks/import.file.md | 20 +++--- .../reference/config-blocks/import.git.md | 3 +- .../reference/config-blocks/import.http.md | 5 +- .../reference/config-blocks/remotecfg.md | 47 ++++++------- .../reference/config-blocks/tracing.md | 9 ++- docs/sources/reference/stdlib/array.md | 17 ++--- docs/sources/reference/stdlib/coalesce.md | 2 +- docs/sources/reference/stdlib/constants.md | 2 +- docs/sources/reference/stdlib/convert.md | 2 +- docs/sources/reference/stdlib/encoding.md | 19 +++--- docs/sources/reference/stdlib/file.md | 2 +- docs/sources/reference/stdlib/json_path.md | 4 +- docs/sources/reference/stdlib/string.md | 2 +- docs/sources/reference/stdlib/sys.md | 4 +- 21 files changed, 176 insertions(+), 181 deletions(-) diff --git a/docs/sources/reference/cli/convert.md b/docs/sources/reference/cli/convert.md index 7c8e2c43ea..6e76bd125d 100644 --- a/docs/sources/reference/cli/convert.md +++ b/docs/sources/reference/cli/convert.md @@ -22,10 +22,10 @@ Usage: alloy convert [ ...] ``` - Replace the following: +Replace the following: - * _``_: One or more flags that define the input and output of the command. - * _``_: The {{< param "PRODUCT_NAME" >}} configuration file. +* _``_: One or more flags that define the input and output of the command. +* _``_: The {{< param "PRODUCT_NAME" >}} configuration file. If the _``_ argument isn't provided or if the _``_ argument is equal to `-`, `convert` converts the contents of standard input. Otherwise, `convert` reads and converts the file from disk specified by the argument. @@ -40,13 +40,14 @@ The following flags are supported: * `--output`, `-o`: The filepath and filename where the output is written. * `--report`, `-r`: The filepath and filename where the report is written. -* `--source-format`, `-f`: Required. The format of the source file. Supported formats: [otelcol], [prometheus], [promtail], [static]. +* `--source-format`, `-f`: Required. The format of the source file. Supported formats: [`otelcol`][otelcol], [`prometheus`][prometheus], [`promtail`][promtail], [`static`][static]. * `--bypass-errors`, `-b`: Enable bypassing errors when converting. * `--extra-args`, `e`: Extra arguments from the original format used by the converter. ### Defaults {{< param "PRODUCT_NAME" >}} defaults are managed as follows: + * If a provided source configuration value matches an {{< param "PRODUCT_NAME" >}} default value, the property is left off the output. * If a non-provided source configuration value default matches an {{< param "PRODUCT_NAME" >}} default value, the property is left off the output. * If a non-provided source configuration value default doesn't match an {{< param "PRODUCT_NAME" >}} default value, the default value is included in the output. @@ -54,7 +55,7 @@ The following flags are supported: ### Errors Errors are defined as non-critical issues identified during the conversion where an output can still be generated. -These can be bypassed using the `--bypass-errors` flag. +You can use the `--bypass-errors` flag to bypass these errors. ### OpenTelemetry Collector @@ -71,7 +72,7 @@ Refer to [Migrate from OpenTelemetry Collector to {{< param "PRODUCT_NAME" >}}][ Using the `--source-format=prometheus` will convert the source configuration from [Prometheus v2.45][] to an {{< param "PRODUCT_NAME" >}} configuration. -This includes Prometheus features such as [scrape_config][], [relabel_config][], [metric_relabel_configs][], [remote_write][], and many supported *_sd_configs. +This includes Prometheus features such as [``scrape_config][scrape_config], [`relabel_config`][relabel_config], [`metric_relabel_configs`][metric_relabel_configs], [`remote_write`][remote_write], and many supported `*_sd_configs`. Unsupported features in a source configuration result in [errors][]. Refer to [Migrate from Prometheus to {{< param "PRODUCT_NAME" >}}][migrate prometheus] for a detailed migration guide. @@ -110,6 +111,7 @@ Refer to [Migrate from Grafana Agent Static to {{< param "PRODUCT_NAME" >}}][mig [relabel_config]: https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#relabel_config [metric_relabel_configs]: https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#metric_relabel_configs [remote_write]: https://prometheus.io/docs/prometheus/2.45/configuration/configuration/#remote_write +[Component Reference]: ../components/otelcol/ [migrate otelcol]: ../../../set-up/migrate/from-otelcol/ [migrate prometheus]: ../../../set-up/migrate/from-prometheus/ [Promtail v2.8.x]: https://grafana.com/docs/loki/v2.8.x/clients/promtail/ diff --git a/docs/sources/reference/cli/environment-variables.md b/docs/sources/reference/cli/environment-variables.md index 2039f9cea6..a0633188bc 100644 --- a/docs/sources/reference/cli/environment-variables.md +++ b/docs/sources/reference/cli/environment-variables.md @@ -28,28 +28,28 @@ Refer to the [Go runtime][runtime] documentation for more information about Go r ## GODEBUG -You can use the `GODEBUG` environment variable to control the debugging variables within the Go runtime. The following arguments are supported. +You can use the `GODEBUG` environment variable to control the debugging variables within the Go runtime. The following arguments are supported. - Argument | Description | Default -------------------------|------------------------------------------------------------------------------------------------------|--------- - `x509usefallbackroots` | Enforce a fallback on the X.509 trusted root certificates. Set to `1` to enable. | `0` - `netdns` | Force a resolver. Set to `go` for a pure Go resolver. Set to `cgo` or `win32` for a native resolver. | - `netdns` | Show resolver debugging information. Set to `1` for basic information. Set to `2` for verbose. | +Argument | Description | Default +-----------------------|------------------------------------------------------------------------------------------------------|-------- +`x509usefallbackroots` | Enforce a fallback on the X.509 trusted root certificates. Set to `1` to enable. | `0` +`netdns` | Force a resolver. Set to `go` for a pure Go resolver. Set to `cgo` or `win32` for a native resolver. | +`netdns` | Show resolver debugging information. Set to `1` for basic information. Set to `2` for verbose. | ## HTTP_PROXY, HTTPS_PROXY, NO_PROXY -You can use the `HTTP_PROXY` environment variable to define the hostname or IP address of the proxy server for HTTP requests. For example, you can set the proxy to `http://proxy.example.com`. +You can use the `HTTP_PROXY` environment variable to define the hostname or IP address of the proxy server for HTTP requests. For example, you can set the proxy to `http://proxy.example.com`. You can use the `HTTPS_PROXY` environment variable to define the proxy server for HTTPS requests in the same manner as `HTTP_PROXY`. The `NO_PROXY` environment variable is used to define any hosts that should be excluded from proxying. `NO_PROXY` should contain a comma delimited list of any of the following options. - Option | Description | Examples -------------------------|----------------------------------------------------------------------------------------------------------------|--------- - IP Address | A single IP address (with optional port) | `1.2.3.4` or `1.2.3.4:80` - CIDR Block | A group of IP addresses that share a network prefix. | `1.2.3.4/8` - Domain | A domain name matches that name and all subdomains. A domain name with a leading "." matches subdomains only. | `example.com` or `.example.com` - Asterisk | A single asterisk indicates that no proxying should be done. | `*` +Option | Description | Examples +-----------|---------------------------------------------------------------------------------------------------------------|-------------------------------- +IP Address | A single IP address (with optional port) | `1.2.3.4` or `1.2.3.4:80` +CIDR Block | A group of IP addresses that share a network prefix. | `1.2.3.4/8` +Domain | A domain name matches that name and all subdomains. A domain name with a leading "." matches subdomains only. | `example.com` or `.example.com` +Asterisk | A single asterisk indicates that no proxying should be done. | `*` ## PPROF_MUTEX_PROFILING_PERCENT @@ -75,28 +75,27 @@ Don't treat the `GOMEMLIMIT` environment variable as a hard memory limit. A rough number is to set `GOMEMLIMIT` to is 90% of the maximum memory required. For example, if you want to keep memory usage below `10GiB`, use `GOMEMLIMIT=9GiB`. -#### Automatically set GOMEMLIMIT +### Automatically set GOMEMLIMIT -The `GOMEMLIMIT` environment variable is either automatically set to 90% of an available `cgroup` value using the [automemlimit] module, or you can explicitly set the `GOMEMLIMIT` environment variable before you run {{< param "PRODUCT_NAME" >}}. +The `GOMEMLIMIT` environment variable is either automatically set to 90% of an available `cgroup` value using the [`automemlimit`][automemlimit] module, or you can explicitly set the `GOMEMLIMIT` environment variable before you run {{< param "PRODUCT_NAME" >}}. You can also change the 90% ratio by setting the `AUTOMEMLIMIT` environment variable to a float value between `0` and `1.0`. -No changes will occur if the limit cannot be determined and you did not explicitly define a `GOMEMLIMIT` value. +No changes occur if the limit can't be determined and you didn't explicitly define a `GOMEMLIMIT` value. ## GOGC The `GOGC` environment variable controls the mechanism that triggers Go's garbage collection. -It represents the garbage collection target percentage. A collection is triggered when the ratio -of freshly allocated data to live data remaining after the previous collection reaches this percentage. +It represents the garbage collection target percentage. +A collection is triggered when the ratio of freshly allocated data to live data remaining after the previous collection reaches this percentage. If you don't provide this variable, GOGC defaults to `100`. You can set `GOGC=off` to disable garbage collection. -Configuring this value in conjunction with `GOMEMLIMIT` can help in situations where {{< param "PRODUCT_NAME" >}} -is consuming too much memory. Go provides a [very in-depth guide][gc_guide] to understanding `GOGC` and `GOMEMLIMIT`. +Configuring this value in conjunction with `GOMEMLIMIT` can help in situations where {{< param "PRODUCT_NAME" >}} is consuming too much memory. +Go provides a [very in-depth guide][gc_guide] to understanding `GOGC` and `GOMEMLIMIT`. ## GOMAXPROCS The `GOMAXPROCS` environment variable defines the limit of OS threads that can simultaneously execute user-level Go code. -This limit does not affect the number of threads that can be blocked in system calls on behalf of Go code and those -threads are not counted against `GOMAXPROCS`. +This limit doesn't affect the number of threads that can be blocked in system calls on behalf of Go code and those threads aren't counted against `GOMAXPROCS`. ## GOTRACEBACK @@ -105,16 +104,15 @@ The standard panic output behavior is usually sufficient to debug and resolve an If required, you can use this setting to collect additional information from the runtime. The following values are supported. -Value | Description | Traces include runtime internal functions ------------------|---------------------------------------------------------------------------------|------------------------------------------ - `none` or `0` | Omit goroutine stack traces entirely from the panic output. | - - `single` | Print the stack trace for the current goroutine. | No - `all` or `1` | Print the stack traces for all user-created goroutines. | No - `system` or `2` | Print the stack traces for all user-created and runtime-created goroutines. | Yes - `crash` | Similar to `system`, but also triggers OS-specific additional behavior. For example, on Unix systems, this raises a SIGABRT to trigger a code dump. | Yes - `wer` | Similar to `crash`, but does not disable Windows Error Reporting. | Yes +Value | Description | Traces include runtime internal functions +----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------ +`none` or `0` | Omit goroutine stack traces entirely from the panic output. | - +`single` | Print the stack trace for the current goroutine. | No +`all` or `1` | Print the stack traces for all user-created goroutines. | No +`system` or `2` | Print the stack traces for all user-created and runtime-created goroutines. | Yes +`crash` | Similar to `system`, but also triggers OS-specific additional behavior. For example, on Unix systems, this raises a SIGABRT to trigger a code dump. | Yes +`wer` | Similar to `crash`, but doesn't disable Windows Error Reporting. | Yes [runtime]: https://pkg.go.dev/runtime [automemlimit]: https://github.com/KimMachineGun/automemlimit [gc_guide]: https://tip.golang.org/doc/gc-guide#GOGC -[Windows]: ../../../configure/windows \ No newline at end of file diff --git a/docs/sources/reference/cli/fmt.md b/docs/sources/reference/cli/fmt.md index 2959ba9d98..ba0eaa0e25 100644 --- a/docs/sources/reference/cli/fmt.md +++ b/docs/sources/reference/cli/fmt.md @@ -6,7 +6,7 @@ title: The fmt command weight: 200 --- -# The fmt command +# The `fmt` command The `fmt` command formats a given {{< param "PRODUCT_NAME" >}} configuration file. @@ -18,10 +18,10 @@ Usage: alloy fmt [ ...] ``` - Replace the following: +Replace the following: - * _``_: One or more flags that define the input and output of the command. - * _``_: The {{< param "PRODUCT_NAME" >}} configuration file. +* _``_: One or more flags that define the input and output of the command. +* _``_: The {{< param "PRODUCT_NAME" >}} configuration file. If the _``_ argument isn't provided or if the _``_ argument is equal to `-`, `fmt` formats the contents of standard input. Otherwise, `fmt` reads and formats the file from disk specified by the argument. diff --git a/docs/sources/reference/cli/run.md b/docs/sources/reference/cli/run.md index c154696260..15e395e9ec 100644 --- a/docs/sources/reference/cli/run.md +++ b/docs/sources/reference/cli/run.md @@ -6,7 +6,7 @@ title: The run command weight: 300 --- -# The run command +# The `run` command The `run` command runs {{< param "PRODUCT_NAME" >}} in the foreground until an interrupt is received. @@ -18,18 +18,18 @@ Usage: alloy run [ ...] ``` - Replace the following: +Replace the following: - * _``_: One or more flags that define the input and output of the command. - * _``_: Required. The {{< param "PRODUCT_NAME" >}} configuration file/directory path. +* _``_: One or more flags that define the input and output of the command. +* _``_: Required. The {{< param "PRODUCT_NAME" >}} configuration file/directory path. -If the _``_ argument is not provided, or if the configuration path can't be loaded or contains errors during the initial load, the `run` command will immediately exit and show an error message. +If the _``_ argument isn't provided, or if the configuration path can't be loaded or contains errors during the initial load, the `run` command immediately exits and shows an error message. -If you give the _``_ argument a directory path, {{< param "PRODUCT_NAME" >}} will find `*.alloy` files (ignoring nested directories) and load them as a single configuration source. +If you give the _``_ argument a directory path, {{< param "PRODUCT_NAME" >}} finds `*.alloy` files (ignoring nested directories) and loads them as a single configuration source. However, component names must be **unique** across all {{< param "PRODUCT_NAME" >}} configuration files, and configuration blocks must not be repeated. -{{< param "PRODUCT_NAME" >}} will continue to run if subsequent reloads of the configuration file fail, potentially marking components as unhealthy depending on the nature of the failure. -When this happens, {{< param "PRODUCT_NAME" >}} will continue functioning in the last valid state. +{{< param "PRODUCT_NAME" >}} continues to run if subsequent reloads of the configuration file fail, potentially marking components as unhealthy depending on the nature of the failure. +When this happens, {{< param "PRODUCT_NAME" >}} continues functioning in the last valid state. `run` launches an HTTP server that exposes metrics about itself and its components. The HTTP server is also exposes a UI at `/` for debugging running components. @@ -52,8 +52,8 @@ The following flags are supported: * `--cluster.advertise-interfaces`: List of interfaces used to infer an address to advertise. Set to `all` to use all available network interfaces on the system. (default `"eth0,en0"`). * `--cluster.max-join-peers`: Number of peers to join from the discovered set (default `5`). * `--cluster.name`: Name to prevent nodes without this identifier from joining the cluster (default `""`). -* `--cluster.enable-tls`: Specifies whether TLS should be used for communication between peers (default `false`). -* `--cluster.tls-ca-path`: Path to the CA certificate file used for peer communication over TLS. +* `--cluster.enable-tls`: Specifies whether TLS should be used for communication between peers (default `false`). +* `--cluster.tls-ca-path`: Path to the CA certificate file used for peer communication over TLS. * `--cluster.tls-cert-path`: Path to the certificate file used for peer communication over TLS. * `--cluster.tls-key-path`: Path to the key file used for peer communication over TLS. * `--cluster.tls-server-name`: Server name used for peer communication over TLS. @@ -102,20 +102,20 @@ Refer to [Release life cycle for Grafana Labs](https://grafana.com/docs/release- The `--cluster.enabled` command-line argument starts {{< param "PRODUCT_NAME" >}} in [clustering][] mode. The rest of the `--cluster.*` command-line flags can be used to configure how nodes discover and connect to one another. -Each cluster member’s name must be unique within the cluster. -Nodes which try to join with a conflicting name are rejected and will fall back to bootstrapping a new cluster of their own. +Each cluster member's name must be unique within the cluster. +Nodes which try to join with a conflicting name are rejected and fall back to bootstrapping a new cluster of their own. Peers communicate over HTTP/2 on the built-in HTTP server. Each node must be configured to accept connections on `--server.http.listen-addr` and the address defined or inferred in `--cluster.advertise-address`. If the `--cluster.advertise-address` flag isn't explicitly set, {{< param "PRODUCT_NAME" >}} tries to infer a suitable one from `--cluster.advertise-interfaces`. -If `--cluster.advertise-interfaces` isn't explicitly set, {{< param "PRODUCT_NAME" >}} will infer one from the `eth0` and `en0` local network interfaces. +If `--cluster.advertise-interfaces` isn't explicitly set, {{< param "PRODUCT_NAME" >}} infers one from the `eth0` and `en0` local network interfaces. {{< param "PRODUCT_NAME" >}} will fail to start if it can't determine the advertised address. Since Windows doesn't use the interface names `eth0` or `en0`, Windows users must explicitly pass at least one valid network interface for `--cluster.advertise-interfaces` or a value for `--cluster.advertise-address`. -The comma-separated list of addresses provided in `--cluster.join-addresses` can either be IP addresses or DNS names to lookup (supports SRV and A/AAAA records). -In both cases, the port number can be specified with a `:` suffix. If ports are not provided, default of the port used for the HTTP listener is used. -If you do not provide the port number explicitly, you must ensure that all instances use the same port for the HTTP listener. +The comma-separated list of addresses provided in `--cluster.join-addresses` can either be IP addresses or DNS names to lookup (supports SRV and A/AAAA records). +In both cases, the port number can be specified with a `:` suffix. If ports aren't provided, default of the port used for the HTTP listener is used. +If you don't provide the port number explicitly, you must ensure that all instances use the same port for the HTTP listener. The `--cluster.enable-tls` flag can be set to enable TLS for peer-to-peer communications. Additional arguments are required to configure the TLS client, including the CA certificate, the TLS certificate, the key, and the server name. @@ -134,17 +134,17 @@ To disable this behavior, set the `--cluster.rejoin-interval` flag to `"0s"`. Discovering peers using the `--cluster.join-addresses` and `--cluster.discover-peers` flags only happens on startup. After that, cluster nodes depend on gossiping messages with each other to converge on the cluster's state. -The first node that is used to bootstrap a new cluster (also known as the "seed node") can either omit the flags that specify peers to join or can try to connect to itself. +The first node that's used to bootstrap a new cluster (also known as the "seed node") can either omit the flags that specify peers to join or can try to connect to itself. -To join or rejoin a cluster, {{< param "PRODUCT_NAME" >}} will try to connect to a certain number of peers limited by the `--cluster.max-join-peers` flag. +To join or rejoin a cluster, {{< param "PRODUCT_NAME" >}} tries to connect to a certain number of peers limited by the `--cluster.max-join-peers` flag. This flag can be useful for clusters of significant sizes because connecting to a high number of peers can be an expensive operation. To disable this behavior, set the `--cluster.max-join-peers` flag to 0. -If the value of `--cluster.max-join-peers` is higher than the number of peers discovered, {{< param "PRODUCT_NAME" >}} will connect to all of them. +If the value of `--cluster.max-join-peers` is higher than the number of peers discovered, {{< param "PRODUCT_NAME" >}} connects to all of them. The `--cluster.name` flag can be used to prevent clusters from accidentally merging. -When `--cluster.name` is provided, nodes will only join peers who share the same cluster name value. +When `--cluster.name` is provided, nodes only join peers who share the same cluster name value. By default, the cluster name is empty, and any node that doesn't set the flag can join. -Attempting to join a cluster with a wrong `--cluster.name` will result in a "failed to join memberlist" error. +Attempting to join a cluster with a wrong `--cluster.name` results in a "failed to join memberlist" error. ### Clustering states @@ -152,7 +152,7 @@ Clustered {{< param "PRODUCT_NAME" >}}s are in one of three states: * **Viewer**: {{< param "PRODUCT_NAME" >}} has a read-only view of the cluster and isn't participating in workload distribution. * **Participant**: {{< param "PRODUCT_NAME" >}} is participating in workload distribution for components that have clustering enabled. -* **Terminating**: {{< param "PRODUCT_NAME" >}} is shutting down and will no longer assign new work to itself. +* **Terminating**: {{< param "PRODUCT_NAME" >}} is shutting down and no longer assigning new work to itself. Each {{< param "PRODUCT_NAME" >}} initially joins the cluster in the viewer state and then transitions to the participant state after the process startup completes. Each {{< param "PRODUCT_NAME" >}} then transitions to the terminating state when shutting down. @@ -166,10 +166,8 @@ The current state of a clustered {{< param "PRODUCT_NAME" >}} is shown on the cl When you use the `--config.format` command-line argument with a value other than `alloy`, {{< param "PRODUCT_NAME" >}} converts the configuration file from the source format to {{< param "PRODUCT_NAME" >}} and immediately starts running with the new configuration. This conversion uses the converter API described in the [alloy convert][] docs. -If you include the `--config.bypass-conversion-errors` command-line argument, -{{< param "PRODUCT_NAME" >}} will ignore any errors from the converter. Use this argument -with caution because the resulting conversion may not be equivalent to the -original configuration. +If you include the `--config.bypass-conversion-errors` command-line argument, {{< param "PRODUCT_NAME" >}} ignores errors from the converter. +Use this argument with caution because the resulting conversion may not be equivalent to the original configuration. Include `--config.extra-args` to pass additional command line flags from the original format to the converter. Refer to [alloy convert][] for more details on how `extra-args` work. @@ -180,6 +178,5 @@ Refer to [alloy convert][] for more details on how `extra-args` work. [in-memory HTTP traffic]: ../../../get-started/component_controller/#in-memory-traffic [data collection]: ../../../data-collection/ [support bundle]: ../../../troubleshoot/support_bundle -[components]: ../../get-started/components/ [component controller]: ../../../get-started/component_controller/ [UI]: ../../../troubleshoot/debug/#clustering-page diff --git a/docs/sources/reference/cli/tools.md b/docs/sources/reference/cli/tools.md index 1fd402af18..589feb75d9 100644 --- a/docs/sources/reference/cli/tools.md +++ b/docs/sources/reference/cli/tools.md @@ -6,7 +6,7 @@ title: The tools command weight: 400 --- -# The tools command +# The `tools` command The `tools` command contains command line tooling grouped by {{< param "PRODUCT_NAME" >}} component. @@ -24,10 +24,10 @@ Usage: alloy tools prometheus.remote_write sample-stats [ ...] ``` - Replace the following: +Replace the following: - * _``_: One or more flags that define the input and output of the command. - * _``_: The WAL directory. +* _``_: One or more flags that define the input and output of the command. +* _``_: The WAL directory. The `sample-stats` command reads the Write-Ahead Log (WAL) specified by _``+ and collects information on metric samples within it. @@ -37,7 +37,7 @@ For each metric discovered, `sample-stats` emits: * The timestamp of the newest sample received for that metric. * The total number of samples discovered for that metric. -By default, `sample-stats` will return information for every metric in the WAL. +By default, `sample-stats` returns information for every metric in the WAL. You can pass the `--selector` flag to filter the reported metrics to a smaller set. The following flag is supported: @@ -71,9 +71,9 @@ Usage: alloy tools prometheus.remote_write wal-stats ``` - Replace the following: +Replace the following: - * _``_: The WAL directory. +* _``_: The WAL directory. The `wal-stats` command reads the Write-Ahead Log (WAL) specified by _``_ and collects general information about it. @@ -92,4 +92,4 @@ The following information is reported: Additionally, `wal-stats` reports per-target information, where a target is defined as a unique combination of the `job` and `instance` label values. For each target, `wal-stats` reports the number of series and the number of metric samples associated with that target. -The `wal-stats` command does not support any flags. +The `wal-stats` command doesn't support any flags. diff --git a/docs/sources/reference/compatibility/_index.md b/docs/sources/reference/compatibility/_index.md index 432f2b8dd6..fcccaa73c6 100644 --- a/docs/sources/reference/compatibility/_index.md +++ b/docs/sources/reference/compatibility/_index.md @@ -17,6 +17,7 @@ The value of an attribute may matter as well as its type. Refer to each component's documentation for more details on what values are acceptable. For example: + * A Prometheus component may always expect an `"__address__"` label inside a list of targets. * A `string` argument may only accept certain values like "traceID" or "spanID". {{< /admonition >}} @@ -117,9 +118,9 @@ The following components, grouped by namespace, _export_ Targets. - ### Targets Consumers + The following components, grouped by namespace, _consume_ Targets. @@ -155,7 +156,6 @@ The following components, grouped by namespace, _consume_ Targets. - ## Prometheus `MetricsReceiver` The Prometheus metrics are sent between components using `MetricsReceiver`s. diff --git a/docs/sources/reference/config-blocks/http.md b/docs/sources/reference/config-blocks/http.md index fcf6a986cf..f8ffb9acf8 100644 --- a/docs/sources/reference/config-blocks/http.md +++ b/docs/sources/reference/config-blocks/http.md @@ -41,8 +41,8 @@ tls > windows_certificate_filter > server | [server][] | Con The `tls` block configures TLS settings for the HTTP server. {{< admonition type="warning" >}} -If you add the `tls` block and reload the configuration when {{< param "PRODUCT_NAME" >}} is running, existing connections will continue communicating over plaintext. -Similarly, if you remove the `tls` block and reload the configuration when {{< param "PRODUCT_NAME" >}} is running, existing connections will continue communicating over TLS. +If you add the `tls` block and reload the configuration when {{< param "PRODUCT_NAME" >}} is running, existing connections continue communicating over plaintext. +Similarly, if you remove the `tls` block and reload the configuration when {{< param "PRODUCT_NAME" >}} is running, existing connections continue communicating over TLS. To ensure all connections use TLS, configure the `tls` block before you start {{< param "PRODUCT_NAME" >}}. {{< /admonition >}} @@ -70,54 +70,54 @@ The following pairs of arguments are mutually exclusive, and only one may be con * `client_ca_pem` and `client_ca_file` The `client_auth_type` argument determines whether to validate client certificates. -The default value, `NoClientCert`, indicates that the client certificate is not validated. +The default value, `NoClientCert`, indicates that the client certificate isn't validated. The `client_ca_pem` and `client_ca_file` arguments may only be configured when `client_auth_type` is not `NoClientCert`. The following values are accepted for `client_auth_type`: * `NoClientCert`: client certificates are neither requested nor validated. -* `RequestClientCert`: requests clients to send an optional certificate. Certificates provided by clients are not validated. -* `RequireAnyClientCert`: requires at least one certificate from clients. Certificates provided by clients are not validated. +* `RequestClientCert`: requests clients to send an optional certificate. Certificates provided by clients aren't validated. +* `RequireAnyClientCert`: requires at least one certificate from clients. Certificates provided by clients aren't validated. * `VerifyClientCertIfGiven`: requests clients to send an optional certificate. If a certificate is sent, it must be valid. * `RequireAndVerifyClientCert`: requires clients to send a valid certificate. The `client_ca_pem` or `client_ca_file` arguments may be used to perform client certificate validation. -These arguments may only be provided when `client_auth_type` is not set to `NoClientCert`. +These arguments may only be provided when `client_auth_type` isn't set to `NoClientCert`. The `cipher_suites` argument determines what cipher suites to use. If you don't provide cipher suite, a default list is used. The set of cipher suites specified may be from the following: -| Cipher | Allowed in BoringCrypto builds | -| ----------------------------------------------- | ------------------------------ | -| `TLS_RSA_WITH_AES_128_CBC_SHA` | no | -| `TLS_RSA_WITH_AES_256_CBC_SHA` | no | -| `TLS_RSA_WITH_AES_128_GCM_SHA256` | yes | -| `TLS_RSA_WITH_AES_256_GCM_SHA384` | yes | -| `TLS_AES_128_GCM_SHA256` | no | -| `TLS_AES_256_GCM_SHA384` | no | -| `TLS_CHACHA20_POLY1305_SHA256` | no | -| `TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA` | no | -| `TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA` | no | -| `TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA` | no | -| `TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA` | no | -| `TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256` | yes | -| `TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384` | yes | -| `TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256` | yes | -| `TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384` | yes | -| `TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` | no | -| `TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256` | no | +Cipher | Allowed in BoringCrypto builds +------------------------------------------------|------------------------------- +`TLS_RSA_WITH_AES_128_CBC_SHA` | no +`TLS_RSA_WITH_AES_256_CBC_SHA` | no +`TLS_RSA_WITH_AES_128_GCM_SHA256` | yes +`TLS_RSA_WITH_AES_256_GCM_SHA384` | yes +`TLS_AES_128_GCM_SHA256` | no +`TLS_AES_256_GCM_SHA384` | no +`TLS_CHACHA20_POLY1305_SHA256` | no +`TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA` | no +`TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA` | no +`TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA` | no +`TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA` | no +`TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256` | yes +`TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384` | yes +`TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256` | yes +`TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384` | yes +`TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256` | no +`TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256` | no The `curve_preferences` argument determines the set of elliptic curves to prefer during a handshake in preference order. If not provided, a default list is used. The set of elliptic curves specified may be from the following: -| Curve | Allowed in BoringCrypto builds | -| ----------- | ------------------------------ | -| `CurveP256` | yes | -| `CurveP384` | yes | -| `CurveP521` | yes | -| `X25519` | no | +Curve | Allowed in BoringCrypto builds +------------|------------------------------- +`CurveP256` | yes +`CurveP384` | yes +`CurveP521` | yes +`X25519` | no The `min_version` and `max_version` arguments determine the oldest and newest TLS version that's acceptable from clients. If you don't provide the min and max TLS version, a default value is used. @@ -129,7 +129,6 @@ The following versions are recognized: * `TLS11` for TLS 1.1 * `TLS10` for TLS 1.0 - ### windows certificate filter block The `windows_certificate_filter` block is used to configure retrieving certificates from the built-in Windows certificate store. @@ -149,7 +148,6 @@ TLS min and max may not be compatible with the certificate stored in the Windows The `windows_certificate_filter` serves the certificate even if it isn't compatible with the specified TLS version. {{< /admonition >}} - ### server block The `server` block is used to find the certificate to check the signer. @@ -163,8 +161,6 @@ Name | Type | Description `template_id` | `string` | Server Template ID to match in ASN1 format, for example, "1.2.3". | `""` | no `refresh_interval` | `string` | How often to check for a new server certificate. | `"5m"` | no - - ### client block The `client` block is used to check the certificate presented to the server. diff --git a/docs/sources/reference/config-blocks/import.file.md b/docs/sources/reference/config-blocks/import.file.md index a0accf8dff..f08674e954 100644 --- a/docs/sources/reference/config-blocks/import.file.md +++ b/docs/sources/reference/config-blocks/import.file.md @@ -43,6 +43,7 @@ The following arguments are supported: This example imports a module from a file and instantiates a custom component from the import that adds two numbers: main.alloy + ```alloy import.file "math" { filename = "module.alloy" @@ -55,6 +56,7 @@ math.add "default" { ``` module.alloy + ```alloy declare "add" { argument "a" {} @@ -66,11 +68,12 @@ declare "add" { } ``` -### Import a module in a module imported via import.git +### Import a module in a module imported via import.git -This example imports a module from a file inside of a module that is imported via [import.git][]: +This example imports a module from a file inside of a module that's imported via [import.git][]: main.alloy + ```alloy import.git "math" { repository = "https://github.com/wildum/module.git" @@ -84,8 +87,8 @@ math.add "default" { } ``` - relative_math.alloy + ```alloy import.file "lib" { filename = file.path_join(module_path, "lib.alloy") @@ -107,6 +110,7 @@ declare "add" { ``` lib.alloy + ```alloy declare "plus" { argument "a" {} @@ -118,9 +122,9 @@ declare "plus" { } ``` -### Import a module in a module imported via import.file +### Import a module in a module imported via import.file -This example imports a module from a file inside of a module that is imported via another `import.file`: +This example imports a module from a file inside of a module that's imported via another `import.file`: main.alloy @@ -136,6 +140,7 @@ math.add "default" { ``` relative_math.alloy + ```alloy import.file "lib" { filename = file.path_join(module_path, "lib.alloy") @@ -157,6 +162,7 @@ declare "add" { ``` lib.alloy + ```alloy declare "plus" { argument "a" {} @@ -168,7 +174,5 @@ declare "plus" { } ``` - - [file.path_join]: ../../stdlib/file/ -[import.git]: ../import.git/ \ No newline at end of file +[import.git]: ../import.git/ diff --git a/docs/sources/reference/config-blocks/import.git.md b/docs/sources/reference/config-blocks/import.git.md index 6aad5cd069..0145c1adbf 100644 --- a/docs/sources/reference/config-blocks/import.git.md +++ b/docs/sources/reference/config-blocks/import.git.md @@ -40,8 +40,7 @@ When provided, the `revision` attribute must be set to a valid branch, tag, or c You must set the `path` attribute to a path accessible from the repository's root. It can either be an {{< param "PRODUCT_NAME" >}} configuration file such as `FILE_NAME.alloy` or `DIR_NAME/FILE_NAME.alloy` or -a directory containing {{< param "PRODUCT_NAME" >}} configuration files such as `DIR_NAME` or `.` if the {{< param "PRODUCT_NAME" >}} configuration files are stored at the root -of the repository. +a directory containing {{< param "PRODUCT_NAME" >}} configuration files such as `DIR_NAME` or `.` if the {{< param "PRODUCT_NAME" >}} configuration files are stored at the root of the repository. If `pull_frequency` isn't `"0s"`, the Git repository is pulled for updates at the frequency specified. If it's set to `"0s"`, the Git repository is pulled once on init. diff --git a/docs/sources/reference/config-blocks/import.http.md b/docs/sources/reference/config-blocks/import.http.md index 552581851b..c03d2986f5 100644 --- a/docs/sources/reference/config-blocks/import.http.md +++ b/docs/sources/reference/config-blocks/import.http.md @@ -79,6 +79,7 @@ The `tls_config` block configures TLS settings for connecting to HTTPS servers. This example imports custom components from an HTTP response and instantiates a custom component for adding two numbers: module.alloy + ```alloy declare "add" { argument "a" {} @@ -91,6 +92,7 @@ declare "add" { ``` main.alloy + ```alloy import.http "math" { url = SERVER_URL @@ -102,9 +104,8 @@ math.add "default" { } ``` - [client]: #client-block [basic_auth]: #basic_auth-block [authorization]: #authorization-block [oauth2]: #oauth2-block -[tls_config]: #tls_config-block \ No newline at end of file +[tls_config]: #tls_config-block diff --git a/docs/sources/reference/config-blocks/remotecfg.md b/docs/sources/reference/config-blocks/remotecfg.md index 9807b4ec52..fba4534700 100644 --- a/docs/sources/reference/config-blocks/remotecfg.md +++ b/docs/sources/reference/config-blocks/remotecfg.md @@ -36,23 +36,23 @@ remotecfg { The following arguments are supported: -Name | Type | Description | Default | Required ------------------|----------------------|---------------------------------------------------|-------------|--------- -`url` | `string` | The address of the API to poll for configuration. | `""` | no -`id` | `string` | A self-reported ID. | `see below` | no -`attributes` | `map(string)` | A set of self-reported attributes. | `{}` | no -`poll_frequency` | `duration` | How often to poll the API for new configuration. | `"1m"` | no -`name` | `string` | A human-readable name for the collector. | `""` | 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 -`proxy_connect_header` | `map(list(secret))` | Specifies headers to send to proxies during CONNECT requests. | | no - -If the `url` is not set, then the service block is a no-op. +Name | Type | Description | Default | Required +-------------------------|---------------------|--------------------------------------------------------------------------------------------------|-------------|--------- +`url` | `string` | The address of the API to poll for configuration. | `""` | no +`id` | `string` | A self-reported ID. | `see below` | no +`attributes` | `map(string)` | A set of self-reported attributes. | `{}` | no +`poll_frequency` | `duration` | How often to poll the API for new configuration. | `"1m"` | no +`name` | `string` | A human-readable name for the collector. | `""` | 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 +`proxy_connect_header` | `map(list(secret))` | Specifies headers to send to proxies during CONNECT requests. | | no + +If the `url` isn't set, then the service block is a no-op. If not set, the self-reported `id` that {{< param "PRODUCT_NAME" >}} uses is a randomly generated, anonymous unique ID (UUID) that is stored as an `alloy_seed.json` file in the {{< param "PRODUCT_NAME" >}} storage path so that it can persist across restarts. You can use the `name` field to set another human-friendly identifier for the specific {{< param "PRODUCT_NAME" >}} instance. @@ -69,12 +69,13 @@ You can't override this prefix. The `poll_frequency` must be set to at least `"10s"`. - 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]. +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]. {{< docs/shared lookup="reference/components/http-client-proxy-config-description.md" source="alloy" version="" >}} diff --git a/docs/sources/reference/config-blocks/tracing.md b/docs/sources/reference/config-blocks/tracing.md index 53a7c80b09..b81fe1afdd 100644 --- a/docs/sources/reference/config-blocks/tracing.md +++ b/docs/sources/reference/config-blocks/tracing.md @@ -40,10 +40,9 @@ Name | Type | Description `sampling_fraction` | `number` | Fraction of traces to keep. | `0.1` | no `write_to` | `list(otelcol.Consumer)` | Inputs from `otelcol` components to send traces to. | `[]` | no -The `write_to` argument controls which components to send traces to for -processing. The elements in the array can be any `otelcol` component that -accept traces, including processors and exporters. When `write_to` is set -to an empty array `[]`, all traces are dropped. +The `write_to` argument controls which components to send traces to for processing. +The elements in the array can be any `otelcol` component that accept traces, including processors and exporters. +When `write_to` is set to an empty array `[]`, all traces are dropped. {{< admonition type="note" >}} Any traces generated before the `tracing` block has been evaluated,such as at the early start of the process' lifetime, are dropped. @@ -84,7 +83,7 @@ The remote sampling strategies are retrieved from the URL specified by the `url` Requests to the remote sampling strategies server are made through an HTTP `GET` request to the configured `url` argument. A `service=alloy` query parameter is always added to the URL to allow the server to respond with service-specific strategies. -The HTTP response body is read as JSON matching the schema specified by Jaeger's [`strategies.json` file][Jaeger sampling strategies]. +The HTTP response body is read as JSON matching the schema specified in the Jaeger [`strategies.json` file][Jaeger sampling strategies]. The `max_operations` limits the amount of custom span names that can have custom sampling rules. If the remote sampling strategy exceeds the limit, sampling decisions fall back to the default sampler. diff --git a/docs/sources/reference/stdlib/array.md b/docs/sources/reference/stdlib/array.md index b9fb947bdc..69cb90bd61 100644 --- a/docs/sources/reference/stdlib/array.md +++ b/docs/sources/reference/stdlib/array.md @@ -19,7 +19,7 @@ Elements within the list can be any type. ### Examples -``` +```alloy > array.concat([]) [] @@ -35,22 +35,22 @@ Elements within the list can be any type. ## array.combine_maps -> **EXPERIMENTAL**: This is an [experimental][] feature. Experimental -> features are subject to frequent breaking changes, and may be removed with -> no equivalent replacement. The `stability.level` flag must be set to `experimental` -> to use the feature. +> **EXPERIMENTAL**: This is an [experimental][] feature. +> Experimental features are subject to frequent breaking changes, and may be removed with no equivalent replacement. +> The `stability.level` flag must be set to `experimental` to use the feature. The `array.combine_maps` function allows you to join two arrays of maps if certain keys have matching values in both maps. It's particularly useful when combining labels of targets coming from different `prometheus.discovery.*` or `prometheus.exporter.*` components. It takes three arguments: -* The first two arguments are a of type `list(map(string))`. The keys of the map are strings. +* The first two arguments are a of type `list(map(string))`. The keys of the map are strings. The value for each key could be of any Alloy type such as a `string`, `integer`, `map`, or a `capsule`. * The third input is an `array` containing strings. The strings are the keys whose value has to match for maps to be combined. The maps that don't contain all the keys provided in the third argument will be discarded. When maps are combined and both contain the same keys, the last value from the second argument will be used. Pseudo function code: -``` + +```text for every map in arg1: for every map in arg2: if the condition key matches in both: @@ -73,6 +73,7 @@ for every map in arg1: ``` Examples using discovery and exporter components: + ```alloy > array.combine_maps(discovery.kubernetes.k8s_pods.targets, prometheus.exporter.postgres, ["instance"]) @@ -82,4 +83,4 @@ Examples using discovery and exporter components: You can find more examples in the [tests][]. [tests]: https://github.com/grafana/alloy/blob/main/syntax/vm/vm_stdlib_test.go -[experimental]: https://grafana.com/docs/release-life-cycle/ \ No newline at end of file +[experimental]: https://grafana.com/docs/release-life-cycle/ diff --git a/docs/sources/reference/stdlib/coalesce.md b/docs/sources/reference/stdlib/coalesce.md index 071c6ad43a..18ce4f294c 100644 --- a/docs/sources/reference/stdlib/coalesce.md +++ b/docs/sources/reference/stdlib/coalesce.md @@ -12,7 +12,7 @@ If no argument is non-empty or non-zero, the last argument is returned. ## Examples -``` +```alloy > coalesce("a", "b") a > coalesce("", "b") diff --git a/docs/sources/reference/stdlib/constants.md b/docs/sources/reference/stdlib/constants.md index 94cbf42bba..36cf5e2dfa 100644 --- a/docs/sources/reference/stdlib/constants.md +++ b/docs/sources/reference/stdlib/constants.md @@ -14,7 +14,7 @@ The `constants` object exposes a list of constant values about the system {{< pa ## Examples -``` +```alloy > constants.hostname "my-hostname" diff --git a/docs/sources/reference/stdlib/convert.md b/docs/sources/reference/stdlib/convert.md index 32458a5483..97e6b5d07e 100644 --- a/docs/sources/reference/stdlib/convert.md +++ b/docs/sources/reference/stdlib/convert.md @@ -23,7 +23,7 @@ Strings resulting from calls to `convert.nonsensitive` are displayed in plain te ### Examples -``` +```alloy // Assuming `sensitive_value` is a secret: > sensitive_value diff --git a/docs/sources/reference/stdlib/encoding.md b/docs/sources/reference/stdlib/encoding.md index 0dbd68a197..9bc8fcaed5 100644 --- a/docs/sources/reference/stdlib/encoding.md +++ b/docs/sources/reference/stdlib/encoding.md @@ -15,14 +15,13 @@ The `encoding` namespace contains encoding and decoding functions. ## encoding.from_base64 -The `encoding.from_base64` function decodes a RFC4648-compliant Base64-encoded string -into the original string. +The `encoding.from_base64` function decodes a RFC4648-compliant Base64-encoded string into the original string. -`encoding.from_base64` fails if the provided string argument contains invalid Base64 data. +`encoding.from_base64` fails if the provided string argument contains invalid Base64 data. ### Examples -``` +```text > encoding.from_base64("dGFuZ2VyaW5l") tangerine ``` @@ -42,7 +41,7 @@ For example, the JSON value `{"key": "value"}` is properly represented by the st ### Examples -``` +```alloy > encoding.from_json("15") 15 @@ -63,12 +62,10 @@ null ## encoding.from_yaml -The `encoding.from_yaml` function decodes a string representing YAML into an {{< param "PRODUCT_NAME" >}} -value. `encoding.from_yaml` fails if the string argument provided cannot be parsed as -YAML. +The `encoding.from_yaml` function decodes a string representing YAML into an {{< param "PRODUCT_NAME" >}} value. +`encoding.from_yaml` fails if the string argument provided can't be parsed as YAML. -A common use case of `encoding.from_yaml` is to decode the output of a -[`local.file`][] component to an {{< param "PRODUCT_NAME" >}} value. +A common use case of `encoding.from_yaml` is to decode the output of a [`local.file`][] component to an {{< param "PRODUCT_NAME" >}} value. {{< admonition type="note" >}} Remember to escape double quotes when passing YAML string literals to `encoding.from_yaml`. @@ -78,7 +75,7 @@ For example, the YAML value `key: "value"` is properly represented by the string ### Examples -``` +```alloy > encoding.from_yaml("15") 15 > encoding.from_yaml("[1, 2, 3]") diff --git a/docs/sources/reference/stdlib/file.md b/docs/sources/reference/stdlib/file.md index 5a8ae0efb0..57b8e90b77 100644 --- a/docs/sources/reference/stdlib/file.md +++ b/docs/sources/reference/stdlib/file.md @@ -15,7 +15,7 @@ The `file.path_join` function joins any number of path elements into a single pa ### Examples -``` +```alloy > file.path_join() "" diff --git a/docs/sources/reference/stdlib/json_path.md b/docs/sources/reference/stdlib/json_path.md index eeeaf96798..e642506c05 100644 --- a/docs/sources/reference/stdlib/json_path.md +++ b/docs/sources/reference/stdlib/json_path.md @@ -6,7 +6,7 @@ title: json_path # json_path -The `json_path` function lookup values using [jsonpath][] syntax. +The `json_path` function lookup values using [`jsonpath`][jsonpath] syntax. The function expects two strings. The first string is the JSON string used look up values. The second string is the JSONPath expression. @@ -20,7 +20,7 @@ A common use case of `json_path` is to decode and filter the output of a [`local ## Examples -``` +```alloy > json_path("{\"key\": \"value\"}", ".key") ["value"] diff --git a/docs/sources/reference/stdlib/string.md b/docs/sources/reference/stdlib/string.md index 1ea8ee3d60..41a64490a9 100644 --- a/docs/sources/reference/stdlib/string.md +++ b/docs/sources/reference/stdlib/string.md @@ -53,7 +53,7 @@ Subsequent calls without an explicit index will then proceed with `n`+1, `n`+2, The function produces an error if the format string requests an impossible conversion or accesses more arguments than are given. An error is also produced for an unsupported format verb. -##### Verbs +#### Verbs The specification may contain the following verbs. diff --git a/docs/sources/reference/stdlib/sys.md b/docs/sources/reference/stdlib/sys.md index 76043af372..f9b4226a34 100644 --- a/docs/sources/reference/stdlib/sys.md +++ b/docs/sources/reference/stdlib/sys.md @@ -14,11 +14,11 @@ The `sys` namespace contains functions related to the system. ## sys.env The `sys.env` function gets the value of an environment variable from the system {{< param "PRODUCT_NAME" >}} is running on. -If the environment variable does not exist, `sys.env` returns an empty string. +If the environment variable doesn't exist, `sys.env` returns an empty string. ### Examples -``` +```alloy > sys.env("HOME") "/home/alloy"