Skip to content

Commit

Permalink
More linting corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
clayton-cornell committed Nov 28, 2024
1 parent 4994501 commit 2ef9f1e
Show file tree
Hide file tree
Showing 21 changed files with 176 additions and 181 deletions.
14 changes: 8 additions & 6 deletions docs/sources/reference/cli/convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Usage:
alloy convert [<FLAG> ...] <FILE_NAME>
```

Replace the following:
Replace the following:

* _`<FLAG>`_: One or more flags that define the input and output of the command.
* _`<FILE_NAME>`_: The {{< param "PRODUCT_NAME" >}} configuration file.
* _`<FLAG>`_: One or more flags that define the input and output of the command.
* _`<FILE_NAME>`_: The {{< param "PRODUCT_NAME" >}} configuration file.

If the _`<FILE_NAME>`_ argument isn't provided or if the _`<FILE_NAME>`_ argument is equal to `-`, `convert` converts the contents of standard input.
Otherwise, `convert` reads and converts the file from disk specified by the argument.
Expand All @@ -40,21 +40,22 @@ 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.

### 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

Expand All @@ -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.
Expand Down Expand Up @@ -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/
Expand Down
60 changes: 29 additions & 31 deletions docs/sources/reference/cli/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
8 changes: 4 additions & 4 deletions docs/sources/reference/cli/fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -18,10 +18,10 @@ Usage:
alloy fmt [<FLAG> ...] <FILE_NAME>
```

Replace the following:
Replace the following:

* _`<FLAG>`_: One or more flags that define the input and output of the command.
* _`<FILE_NAME>`_: The {{< param "PRODUCT_NAME" >}} configuration file.
* _`<FLAG>`_: One or more flags that define the input and output of the command.
* _`<FILE_NAME>`_: The {{< param "PRODUCT_NAME" >}} configuration file.

If the _`<FILE_NAME>`_ argument isn't provided or if the _`<FILE_NAME>`_ argument is equal to `-`, `fmt` formats the contents of standard input.
Otherwise, `fmt` reads and formats the file from disk specified by the argument.
Expand Down
Loading

0 comments on commit 2ef9f1e

Please sign in to comment.