Skip to content

Commit d899658

Browse files
Clean up some linting errors on faro.receiver (#2534)
* Clean up some linting errors on faro.receiver * Add stage metadata
1 parent 7d32f2a commit d899658

File tree

1 file changed

+59
-66
lines changed

1 file changed

+59
-66
lines changed

docs/sources/reference/components/faro/faro.receiver.md

Lines changed: 59 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@ canonical: https://grafana.com/docs/alloy/latest/reference/components/faro/faro.
33
aliases:
44
- ../faro.receiver/ # /docs/alloy/latest/reference/components/faro.receiver/
55
description: Learn about the faro.receiver
6+
labels:
7+
stage: general-availability
68
title: faro.receiver
79
---
810

9-
# faro.receiver
11+
# `faro.receiver`
1012

11-
`faro.receiver` accepts web application telemetry data from the [Grafana Faro Web SDK][faro-sdk] and forwards it to other components for future processing.
13+
`faro.receiver` accepts web application telemetry data from the [Grafana Faro Web SDK][faro-sdk] and forwards it to other components for processing.
1214

1315
[faro-sdk]: https://github.com/grafana/faro-web-sdk
1416

1517
## Usage
1618

1719
```alloy
18-
faro.receiver "LABEL" {
20+
faro.receiver "<LABEL>" {
1921
output {
20-
logs = [LOKI_RECEIVERS]
21-
traces = [OTELCOL_COMPONENTS]
22+
logs = [<LOKI_RECEIVERS>]
23+
traces = [<OTELCOL_COMPONENTS>]
2224
}
2325
}
2426
```
2527

2628
## Arguments
2729

28-
The following arguments are supported:
30+
You can use the following arguments with `faro.receiver`:
2931

3032
Name | Type | Description | Default | Required
3133
-------------------|---------------|----------------------------------------------|---------|---------
@@ -34,30 +36,39 @@ Name | Type | Description
3436

3537
### Log format
3638

37-
The following strings are recognized as valid log line formats:
39+
The following strings are valid log line formats:
3840

39-
* `"logfmt"`: Export logs as [logfmt](https://brandur.org/logfmt) lines.
4041
* `"json"`: Export logs as JSON objects.
42+
* `"logfmt"`: Export logs as [`logfmt`](https://brandur.org/logfmt) lines.
4143

4244
## Blocks
4345

44-
The following blocks are supported inside the definition of `faro.receiver`:
46+
You can use the following blocks with `faro.receiver`:
4547

46-
Hierarchy | Block | Description | Required
47-
-----------------------|-------------------|------------------------------------------------------|---------
48-
server | [server][] | Configures the HTTP server. | no
49-
server > rate_limiting | [rate_limiting][] | Configures rate limiting for the HTTP server. | no
50-
sourcemaps | [sourcemaps][] | Configures sourcemap retrieval. | no
51-
sourcemaps > location | [location][] | Configures on-disk location for sourcemap retrieval. | no
52-
output | [output][] | Configures where to send collected telemetry data. | yes
48+
Block | Description | Required
49+
---------------------------------------------|------------------------------------------------------|---------
50+
[`output`][output] | Configures where to send collected telemetry data. | yes
51+
[`server`][server] | Configures the HTTP server. | no
52+
`server` > [`rate_limiting`][rate_limiting] | Configures rate limiting for the HTTP server. | no
53+
[`sourcemaps`][sourcemaps] | Configures sourcemap retrieval. | no
54+
`sourcemaps` > [`location`][location] | Configures on-disk location for sourcemap retrieval. | no
5355

54-
[server]: #server-block
55-
[rate_limiting]: #rate_limiting-block
56-
[sourcemaps]: #sourcemaps-block
57-
[location]: #location-block
58-
[output]: #output-block
56+
[location]: #location
57+
[output]: #output
58+
[rate_limiting]: #rate_limiting
59+
[server]: #server
60+
[sourcemaps]: #sourcemaps
5961

60-
### server block
62+
### `output`
63+
64+
The `output` block specifies where to forward collected logs and traces.
65+
66+
Name | Type | Description | Default | Required
67+
---------|--------------------------|------------------------------------------------------|---------|---------
68+
`logs` | `list(LogsReceiver)` | A list of `loki` components to forward logs to. | `[]` | no
69+
`traces` | `list(otelcol.Consumer)` | A list of `otelcol` components to forward traces to. | `[]` | no
70+
71+
### `server`
6172

6273
The `server` block configures the HTTP server managed by the `faro.receiver` component.
6374
Clients using the [Grafana Faro Web SDK][faro-sdk] forward telemetry data to this HTTP server for processing.
@@ -83,7 +94,7 @@ When the `api_key` argument is non-empty, client requests must have an HTTP head
8394
Requests that are missing the header or have the wrong value are rejected with an `HTTP 401 Unauthorized` status code.
8495
If the `api_key` argument is empty, no authentication checks are performed, and the `X-API-Key` HTTP header is ignored.
8596

86-
### rate_limiting block
97+
#### `rate_limiting`
8798

8899
The `rate_limiting` block configures rate limiting for client requests.
89100

@@ -95,13 +106,13 @@ Name | Type | Description | Default | Requi
95106

96107
Rate limiting functions as a [token bucket algorithm][token-bucket], where a bucket has a maximum capacity for up to `burst_size` requests and refills at a rate of `rate` per second.
97108

98-
Each HTTP request drains the capacity of the bucket by one. Once the bucket is empty, HTTP requests are rejected with an `HTTP 429 Too Many Requests` status code until the bucket has more available capacity.
109+
Each HTTP request drains the capacity of the bucket by one. After the bucket is empty, HTTP requests are rejected with an `HTTP 429 Too Many Requests` status code until the bucket has more available capacity.
99110

100111
Configuring the `rate` argument determines how fast the bucket refills, and configuring the `burst_size` argument determines how many requests can be received in a burst before the bucket is empty and starts rejecting requests.
101112

102113
[token-bucket]: https://en.wikipedia.org/wiki/Token_bucket
103114

104-
### sourcemaps block
115+
### `sourcemaps`
105116

106117
The `sourcemaps` block configures how to retrieve sourcemaps.
107118
Sourcemaps are then used to transform file and line information from minified code into the file and line information from the original source code.
@@ -124,59 +135,49 @@ By default, sourcemap downloads are subject to a timeout of `"1s"`, specified by
124135
Setting `download_timeout` to `"0s"` disables timeouts.
125136

126137
To retrieve sourcemaps from disk instead of the network, specify one or more [`location` blocks][location].
127-
When `location` blocks are provided, they are checked first for sourcemaps before falling back to downloading.
138+
When `location` blocks are provided, they're checked first for sourcemaps before falling back to downloading.
128139

129-
### location block
140+
#### `location`
130141

131142
The `location` block declares a location where sourcemaps are stored on the filesystem.
132-
The `location` block can be specified multiple times to declare multiple locations where sourcemaps are stored.
143+
You can specify the `location` block multiple times to declare multiple locations where sourcemaps are stored.
133144

134145
Name | Type | Description | Default | Required
135146
-----------------------|----------|-----------------------------------------------------|---------|---------
136-
`path` | `string` | The path on disk where sourcemaps are stored. | | yes
137147
`minified_path_prefix` | `string` | The prefix of the minified path sent from browsers. | | yes
148+
`path` | `string` | The path on disk where sourcemaps are stored. | | yes
138149

139-
The `minified_path_prefix` argument determines the prefix of paths to Javascript files, such as `http://example.com/`.
150+
The `minified_path_prefix` argument determines the prefix of paths to JavaScript files, such as `http://example.com/`.
140151
The `path` argument then determines where to find the sourcemap for the file.
141152

142153
For example, given the following location block:
143154

144-
```
155+
```alloy
145156
location {
146157
path = "/var/my-app/build"
147158
minified_path_prefix = "http://example.com/"
148159
}
149160
```
150161

151-
To look up the sourcemaps for a file hosted at `http://example.com/foo.js`, the `faro.receiver` component will:
162+
To look up the sourcemaps for a file hosted at `http://example.com/example.js`, the `faro.receiver` component:
152163

153-
1. Remove the minified path prefix to extract the path to the file (`foo.js`).
154-
2. Search for that file path with a `.map` extension (`foo.js.map`) in `path` (`/var/my-app/build/foo.js.map`).
164+
1. Removes the minified path prefix to extract the path to the file `example.js`.
165+
1. Searches the path for the file with a `.map` extension, for example `example.js.map` in the path `/var/my-app/build/example.js.map`.
155166

156167
Optionally, the value for the `path` argument may contain `{{ .Release }}` as a template value, such as `/var/my-app/{{ .Release }}/build`.
157-
The template value will be replaced with the release value provided by the [Faro Web App SDK][faro-sdk].
158-
159-
### output block
160-
161-
The `output` block specifies where to forward collected logs and traces.
162-
163-
Name | Type | Description | Default | Required
164-
---------|--------------------------|------------------------------------------------------|---------|---------
165-
`logs` | `list(LogsReceiver)` | A list of `loki` components to forward logs to. | `[]` | no
166-
`traces` | `list(otelcol.Consumer)` | A list of `otelcol` components to forward traces to. | `[]` | no
168+
The template value is replaced with the release value provided by the [Faro Web App SDK][faro-sdk].
167169

168170
## Exported fields
169171

170-
`faro.receiver` does not export any fields.
172+
`faro.receiver` doesn't export any fields.
171173

172174
## Component health
173175

174-
`faro.receiver` is reported as unhealthy when the integrated server fails to
175-
start.
176+
`faro.receiver` is reported as unhealthy when the integrated server fails to start.
176177

177178
## Debug information
178179

179-
`faro.receiver` does not expose any component-specific debug information.
180+
`faro.receiver` doesn't expose any component-specific debug information.
180181

181182
## Debug metrics
182183

@@ -200,13 +201,13 @@ start.
200201
```alloy
201202
faro.receiver "default" {
202203
server {
203-
listen_address = "NETWORK_ADDRESS"
204+
listen_address = "<NETWORK_ADDRESS>"
204205
}
205206
206207
sourcemaps {
207208
location {
208-
path = "PATH_TO_SOURCEMAPS"
209-
minified_path_prefix = "WEB_APP_PREFIX"
209+
path = "<PATH_TO_SOURCEMAPS>"
210+
minified_path_prefix = "<WEB_APP_PREFIX>"
210211
}
211212
}
212213
@@ -224,29 +225,21 @@ loki.write "default" {
224225
225226
otelcol.exporter.otlp "traces" {
226227
client {
227-
endpoint = "OTLP_ADDRESS"
228+
endpoint = "<OTLP_ADDRESS>"
228229
}
229230
}
230231
```
231232

232233
Replace the following:
233234

234-
* `NETWORK_ADDRESS`: IP address of the network interface to listen to traffic on.
235+
* _`<NETWORK_ADDRESS>`_: The IP address of the network interface to listen to traffic on.
235236
This IP address must be reachable by browsers using the web application to instrument.
236-
237-
* `PATH_TO_SOURCEMAPS`: Path on disk where sourcemaps are located.
238-
239-
* `WEB_APP_PREFIX`: Prefix of the web application being instrumented.
240-
237+
* _`<PATH_TO_SOURCEMAPS>`_: The path on disk where sourcemaps are located.
238+
* _`<WEB_APP_PREFIX>`_: Prefix of the web application being instrumented.
241239
* `LOKI_ADDRESS`: Address of the Loki server to send logs to.
242-
243-
* If authentication is required to send logs to the Loki server, refer to the
244-
documentation of [loki.write][] for more information.
245-
246-
* `OTLP_ADDRESS`: The address of the OTLP-compatible server to send traces to.
247-
248-
* If authentication is required to send logs to the Loki server, refer to the
249-
documentation of [otelcol.exporter.otlp][] for more information.
240+
Refer to [`loki.write`][loki.write] if you want to use authentication to send logs to the Loki server.
241+
* _`<OTLP_ADDRESS>`_: The address of the OTLP-compatible server to send traces to.
242+
Refer to[`otelcol.exporter.otlp`][otelcol.exporter.otlp] if you want to use authentication to send logs to the Loki server.
250243

251244
[loki.write]: ../../loki/loki.write/
252245
[otelcol.exporter.otlp]: ../../otelcol/otelcol.exporter.otlp/

0 commit comments

Comments
 (0)