Skip to content

Commit

Permalink
Apply linting rules to loki.* component docs (#2594)
Browse files Browse the repository at this point in the history
* First linting pass through some loki components

* General linting cleanup

* Format table styles

* Fix small typo

* Fix up rule selector block

* General tidy catching spelling, typos, and formatting

* Another pass to fix style spelling and typos

* Fix some missing syntax and layout

* Add some missing nested block explanations

* Markdown coding cleanup

* Fix ref to OAuth 2.0

* Fix typo in compatible components

* Add required to block definition

* Second try at fixing compat components section
  • Loading branch information
clayton-cornell authored Feb 10, 2025
1 parent 1bd41be commit 031f5ab
Show file tree
Hide file tree
Showing 26 changed files with 1,841 additions and 1,869 deletions.
2 changes: 1 addition & 1 deletion docs/sources/reference/components/local/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: local
weight: 100
---

# local
# `local`

This section contains reference documentation for the `local` components.

Expand Down
32 changes: 17 additions & 15 deletions docs/sources/reference/components/local/local.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ canonical: https://grafana.com/docs/alloy/latest/reference/components/local/loca
aliases:
- ../local.file/ # /docs/alloy/latest/reference/components/local.file/
description: Learn about local.file
labels:
stage: general-availability
title: local.file
---

# `local.file`

`local.file` exposes the contents of a file on disk to other components.
The file will be watched for changes so that its latest content is always exposed.
The file is watched for changes so that its latest content is always exposed.

The most common use of `local.file` is to load secrets (for example, API keys) from files.

Multiple `local.file` components can be specified by giving them different labels.
You can specify multiple `local.file` components by giving them different labels.

## Usage

Expand All @@ -25,14 +27,14 @@ local.file "<LABEL>" {

## Arguments

The following arguments are supported:
You can use the following arguments with `local.file`:

Name | Type | Description | Default | Required
-----------------|------------|-----------------------------------------------------|--------------|---------
`filename` | `string` | Path of the file on disk to watch. | | yes
`detector` | `string` | Which file change detector to use (fsnotify, poll). | `"fsnotify"` | no
`is_secret` | `bool` | Marks the file as containing a [secret][]. | `false` | no
`poll_frequency` | `duration` | How often to poll for file changes. | `"1m"` | no
| Name | Type | Description | Default | Required |
|------------------|------------|----------------------------------------------------------|--------------|----------|
| `filename` | `string` | Path of the file on disk to watch. | | yes |
| `detector` | `string` | Which file change detector to use, `fsnotify` or `poll`. | `"fsnotify"` | no |
| `is_secret` | `bool` | Marks the file as containing a [secret][]. | `false` | no |
| `poll_frequency` | `duration` | How often to poll for file changes. | `"1m"` | no |

[secret]: ../../../../get-started/configuration-syntax/expressions/types_and_values/#secrets

Expand All @@ -46,9 +48,9 @@ The `local.file` component doesn't support any blocks. You can configure this co

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

Name | Type | Description
----------|----------------------|----------------------------------------------------
`content` | `string` or `secret` | The contents of the file from the most recent read.
| Name | Type | Description |
|-----------|----------------------|-----------------------------------------------------|
| `content` | `string` or `secret` | The contents of the file from the most recent read. |

The `content` field has the `secret` type only if the `is_secret` argument is true.

Expand All @@ -58,9 +60,9 @@ You can use `local.file.LABEL.content` to access the contents of the file.

`local.file` is reported as healthy whenever if the watched file was read successfully.

Failing to read the file whenever an update is detected (or after the poll period elapses) will cause the component to be reported as unhealthy.
When unhealthy, exported fields will be kept at the last healthy value.
The read error will be exposed as a log message and in the debug information for the component.
Failing to read the file whenever an update is detected (or after the poll period elapses) causes the component to be reported as unhealthy.
When unhealthy, exported fields is kept at the last healthy value.
The read error is exposed as a log message and in the debug information for the component.

## Debug information

Expand Down
18 changes: 10 additions & 8 deletions docs/sources/reference/components/local/local.file_match.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ canonical: https://grafana.com/docs/alloy/latest/reference/components/local/loca
aliases:
- ../local.file_match/ # /docs/alloy/latest/reference/components/local.file_match/
description: Learn about local.file_match
labels:
stage: general-availability
title: local.file_match
---

Expand All @@ -24,11 +26,11 @@ local.file_match "LABEL" {

You can use the following arguments with `local.file_match`:

Name | Type | Description | Default | Required
--------------- | ------------------- | ------------------------------------------------------------------------------------------ |---------| --------
`path_targets` | `list(map(string))` | Targets to expand; looks for glob patterns on the `__path__` and `__path_exclude__` keys. | | yes
`ignore_older_than` | `duration` | Ignores files which are modified before this duration. | `"0s"` | no
`sync_period` | `duration` | How often to sync filesystem and targets. | `"10s"` | no
| Name | Type | Description | Default | Required |
|---------------------|---------------------|--------------------------------------------------------------------------------------------|---------|----------|
| `path_targets` | `list(map(string))` | Targets to expand; looks for glob patterns on the `__path__` and `__path_exclude__` keys. | | yes |
| `ignore_older_than` | `duration` | Ignores files which are modified before this duration. | `"0s"` | no |
| `sync_period` | `duration` | How often to sync filesystem and targets. | `"10s"` | no |

`path_targets` uses [doublestar][] style paths.

Expand All @@ -46,9 +48,9 @@ The `local.file_match` component doesn't support any blocks. You can configure t

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

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

Each target includes the following label:

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/reference/components/loki/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: loki
weight: 100
---

# loki
# `loki`

This section contains reference documentation for the `loki` components.

Expand Down
24 changes: 15 additions & 9 deletions docs/sources/reference/components/loki/loki.echo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,46 @@ canonical: https://grafana.com/docs/alloy/latest/reference/components/loki/loki.
aliases:
- ../loki.echo/ # /docs/alloy/latest/reference/components/loki.echo/
description: Learn about loki.echo
labels:
stage: general-availability
title: loki.echo
---

# loki.echo
# `loki.echo`

`loki.echo` receives log entries from other `loki` components and prints them to the process' standard output (stdout).
`loki.echo` receives log entries from other `loki` components and prints them to the process' standard output, `stdout`.

Multiple `loki.echo` components can be specified by giving them different labels.
You can specify multiple `loki.echo` components by giving them different labels.

## Usage

```alloy
loki.echo "LABEL" {}
loki.echo "<LABEL>" {}
```

## Arguments

`loki.echo` accepts no arguments.
The `loki.echo` component doesn't support any arguments.

## Blocks

The `loki.echo` component doesn't support any blocks.

## Exported fields

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

Name | Type | Description
-----------|----------------|--------------------------------------------------------------
`receiver` | `LogsReceiver` | A value that other components can use to send log entries to.
| Name | Type | Description |
| ---------- | -------------- | ------------------------------------------------------------- |
| `receiver` | `LogsReceiver` | A value that other components can use to send log entries to. |

## Component health

`loki.echo` is only reported as unhealthy if given an invalid configuration.

## Debug information

`loki.echo` does not expose any component-specific debug information.
`loki.echo` doesn't expose any component-specific debug information.

## Example

Expand Down
Loading

0 comments on commit 031f5ab

Please sign in to comment.