diff --git a/docs/sources/flow/concepts/clustering.md b/docs/sources/flow/concepts/clustering.md index 37d8bcea93cf..9b25a402cbe6 100644 --- a/docs/sources/flow/concepts/clustering.md +++ b/docs/sources/flow/concepts/clustering.md @@ -51,7 +51,7 @@ All participating components locally recalculate target ownership and re-balance Target auto-distribution allows you to dynamically scale the number of {{< param "PRODUCT_ROOT_NAME" >}}s to distribute workload during peaks. It also provides resiliency because targets are automatically picked up by one of the node peers if a node leaves. -{{< param "PRODUCT_NAME" >}} uses a fully local consistent hashing algorithm to distribute targets, meaning that, on average, only ~1/N of the targets are redistributed. +{{< param "PRODUCT_NAME" >}} uses a local consistent hashing algorithm to distribute targets, meaning that, on average, only ~1/N of the targets are redistributed. Refer to component reference documentation to discover whether it supports clustering, such as: diff --git a/docs/sources/flow/concepts/component_controller.md b/docs/sources/flow/concepts/component_controller.md index 828ca7d22231..0da97ff77654 100644 --- a/docs/sources/flow/concepts/component_controller.md +++ b/docs/sources/flow/concepts/component_controller.md @@ -51,7 +51,7 @@ local.file "b" { ## Component evaluation A component is _evaluated_ when its expressions are computed into concrete values. -The computed values are then used to configure the component's runtime behavior. +The computed values configure the component's runtime behavior. The component controller is finished loading once all components are evaluated, configured, and running. The component controller only evaluates a given component after evaluating all of that component's dependencies. @@ -92,13 +92,13 @@ When a component fails to evaluate, it's marked as unhealthy with the reason for When an evaluation fails, the component continues operating as normal. The component continues using its previous set of evaluated arguments and can continue exporting new values. -This prevents failure propagation. +This behavior prevents failure propagation. If your `local.file` component, which watches API keys, suddenly stops working, other components continue using the last valid API key until the component returns to a healthy state. ## In-memory traffic Components that expose HTTP endpoints, such as [prometheus.exporter.unix][], can expose an internal address that completely bypasses the network and communicate in-memory. -This allows components within the same process to communicate with one another without needing to be aware of any network-level protections such as authentication or mutual TLS. +Components within the same process can communicate with one another without needing to be aware of any network-level protections such as authentication or mutual TLS. The internal address defaults to `agent.internal:12345`. If this address collides with a real target on your network, change it to something unique using the `--server.http.memory-addr` flag in the [run][] command. @@ -108,7 +108,7 @@ Refer to the individual documentation for components to learn if in-memory traff ## Updating the configuration file -Both the `/-/reload` HTTP endpoint and the `SIGHUP` signal can inform the component controller to reload the configuration file. +The `/-/reload` HTTP endpoint and the `SIGHUP` signal can inform the component controller to reload the configuration file. When this happens, the component controller synchronizes the set of running components with the ones in the configuration file, removing components no longer defined in the configuration file and creating new components added to the configuration file. All components managed by the controller are reevaluated after reloading. diff --git a/docs/sources/flow/concepts/components.md b/docs/sources/flow/concepts/components.md index 9a873f9e93a7..82951e7e698c 100644 --- a/docs/sources/flow/concepts/components.md +++ b/docs/sources/flow/concepts/components.md @@ -24,8 +24,8 @@ Components are composed of the following: Each component has a name that describes what that component is responsible for. For example, the `local.file` component is responsible for retrieving the contents of files on disk. -Components are specified in the configuration file by first providing the component's name with a user-specified label, -and then by providing arguments to configure the component. +You specify components in the configuration file by first providing the component's name with a user-specified label, +and then by giving arguments to configure the component. ```river discovery.kubernetes "pods" { @@ -37,11 +37,11 @@ discovery.kubernetes "nodes" { } ``` -> Components are referenced by combining the component name with its label. -> For example, a `local.file` component labeled `foo` would be referenced as `local.file.foo`. -> -> The combination of a component's name and its label must be unique within the configuration file. -> This means multiple instances of a component may be defined as long as each instance has a different label value. +You reference components by combining the component name with its label. +For example, you can reference a `local.file` component labeled `foo` as `local.file.foo`. + +The combination of a component's name and its label must be unique within the configuration file. +Combining component names with a label means you can define multiple instances of a component as long as each instance has a different label value. ## Pipelines @@ -51,19 +51,19 @@ Most arguments for a component in a configuration file are constant values, such log_level = "debug" ``` -_Expressions_ can be used to dynamically compute the value of an argument at runtime. -Among other things, expressions can be used to retrieve the value of an environment variable -(`log_level = env("LOG_LEVEL")`) or to reference an exported field of another component (`log_level = local.file.log_level.content`). +You use _expressions_ to dynamically compute the value of an argument at runtime. +You can use expressions to retrieve the value of an environment variable (`log_level = env("LOG_LEVEL")`) +or to reference an exported field of another component (`log_level = local.file.log_level.content`). -A dependent relationship is created when a component's argument references an exported field of another component. -A component's input (arguments) now depends on another component's output (exports). -The input of the component is re-evaluated whenever the exports of the components it references get updated. +You create a dependent relationship when a component's argument references an exported field of another component. +A component's arguments now depend on another component's exports. +The input of the component is re-evaluated whenever the exports of the components it references are updated. The flow of data through the set of references between components forms a _pipeline_. An example pipeline may look like this: -1. A `local.file` component watches a file on disk containing an API key. +1. A `local.file` component watches a file that contains an API key. 1. A `prometheus.remote_write` component is configured to receive metrics and forward them to an external database using the API key from the `local.file` for authentication. 1. A `discovery.kubernetes` component discovers and exports Kubernetes Pods where metrics can be collected. 1. A `prometheus.scrape` component references the exports of the previous component, and sends collected metrics to the `prometheus.remote_write` component. @@ -100,7 +100,7 @@ prometheus.remote_write "prod" { basic_auth { username = "admin" - // Use our password file for authenticating with the production database. + // Use the password file to authenticate with the production database. password = local.file.api_key.content } } diff --git a/docs/sources/flow/concepts/configuration_language.md b/docs/sources/flow/concepts/configuration_language.md index 46754973cf2c..69b1a7357e71 100644 --- a/docs/sources/flow/concepts/configuration_language.md +++ b/docs/sources/flow/concepts/configuration_language.md @@ -41,7 +41,7 @@ River is designed with the following requirements in mind: You use _Attributes_ to configure individual settings. Attributes always take the form of `ATTRIBUTE_NAME = ATTRIBUTE_VALUE`. -The following example shows you how to set the `log_level` attribute to `"debug"`. +The following example shows how to set the `log_level` attribute to `"debug"`. ```river log_level = "debug" @@ -64,7 +64,7 @@ You can use expressions for any attribute inside a component definition. The most common expression is to reference the exports of a component, for example, `local.file.password_file.content`. You form a reference to a component's exports by merging the component's name (for example, `local.file`), -label (for example, `password_file`), and export name (for example, `content`), delimited by period. +label (for example, `password_file`), and export name (for example, `content`), delimited by a period. ## Blocks @@ -83,8 +83,8 @@ The preceding example has two blocks: * `prometheus.remote_write "default"`: A labeled block which instantiates a `prometheus.remote_write` component. The label is the string `"default"`. -* `endpoint`: An unlabeled block inside the component which configures an endpoint to send metrics to. - This block sets the `url` attribute to specify what the endpoint is. +* `endpoint`: An unlabeled block inside the component that configures an endpoint to send metrics to. + This block sets the `url` attribute to specify the endpoint. ## More information diff --git a/docs/sources/flow/concepts/modules.md b/docs/sources/flow/concepts/modules.md index 3bd3fcbb4ff3..9dfa708e3b48 100644 --- a/docs/sources/flow/concepts/modules.md +++ b/docs/sources/flow/concepts/modules.md @@ -47,7 +47,7 @@ Refer to [Components][] for more information about the module loader components. ## Module sources -Modules are flexible and you can retrieve their configuration anywhere, such as: +Modules are flexible, and you can retrieve their configuration anywhere, such as: * The local filesystem. * An S3 bucket. @@ -78,9 +78,9 @@ This example module manages a pipeline that filters out debug-level and info-lev ```river // argument.write_to is a required argument that specifies where filtered -// log lines should be sent. +// log lines are sent. // -// The value of the argument can be retrieved in this file with +// The value of the argument is retrieved in this file with // argument.write_to.value. argument "write_to" { optional = false @@ -99,7 +99,7 @@ loki.process "filter" { forward_to = argument.write_to.value } -// export.filter_input exports a value to the consumer of the module. +// export.filter_input exports a value to the module consumer. export "filter_input" { // Expose the receiver of loki.process so the module consumer can send // logs to our loki.process component. diff --git a/docs/sources/flow/config-language/_index.md b/docs/sources/flow/config-language/_index.md index 929518f47c5e..257257eec371 100644 --- a/docs/sources/flow/config-language/_index.md +++ b/docs/sources/flow/config-language/_index.md @@ -13,14 +13,14 @@ weight: 400 # Configuration language -{{< param "PRODUCT_NAME" >}} uses a custom configuration language called River to dynamically configure and connect components. +{{< param "PRODUCT_NAME" >}} dynamically configures and connects components with a custom configuration language called River. River aims to reduce errors in configuration files by making configurations easier to read and write. River configurations use blocks that can be easily copied and pasted from the documentation to help you get started as quickly as possible. A River configuration file tells {{< param "PRODUCT_NAME" >}} which components to launch and how to bind them together into a pipeline. -The syntax of River is centered around blocks, attributes, and expressions. +The syntax of River uses blocks, attributes, and expressions. ```river // Create a local.file component labeled my_file. @@ -43,16 +43,16 @@ BLOCK_NAME { ``` [River][RFC] is similar to HCL, the language Terraform and other Hashicorp projects use. -River was inspired by HCL, but is a distinct language with different syntax and features, such as first-class functions. +It's a distinct language with custom syntax and features, such as first-class functions. * Blocks are a group of related settings and usually represent creating a component. - Blocks have a name that consist of zero or more identifiers separated by `.`, an optional user label, and a body that contains attributes and nested blocks. + Blocks have a name that consists of zero or more identifiers separated by `.`, an optional user label, and a body containing attributes and nested blocks. * Attributes appear within blocks and assign a value to a name. * Expressions represent a value, either literally or by referencing and combining other values. - Expressions are used to compute a value for an attribute. + You use expressions to compute a value for an attribute. -River is declarative, so the ordering of components, blocks, and attributes within a block isn't significant. -The order of operations is determined by the relationship between components. +River is declarative, so ordering components, blocks, and attributes within a block isn't significant. +The relationship between components determines the order of operations. [RFC]: https://github.com/grafana/agent/blob/97a55d0d908b26dbb1126cc08b6dcc18f6e30087/docs/rfcs/0005-river.md diff --git a/docs/sources/flow/config-language/components.md b/docs/sources/flow/config-language/components.md index 6691b0cf091e..5e8acd79fe8a 100644 --- a/docs/sources/flow/config-language/components.md +++ b/docs/sources/flow/config-language/components.md @@ -32,14 +32,14 @@ Most user interactions with components center around two basic concepts, _argume They can be any number of attributes or nested unlabeled blocks, some required and some optional. Any optional arguments that aren't set take on their default values. -* _Exports_ are zero or more output values that other components can refer to, and they can be of any River type. +* _Exports_ are zero or more output values that other components can refer to and can be of any River type. The following block defines a `local.file` component labeled "targets". The `local.file.targets` component exposes the file `content` as a string in its exports. The `filename` attribute is a _required_ argument. You can also define a number of _optional_ arguments, in this case, `detector`, `poll_frequency`, and `is_secret`, -that configure how and how often the file should be polled and whether its contents are sensitive or not. +that configure how and how often the file should be polled and whether its contents are sensitive. ```river local.file "targets" { @@ -79,14 +79,14 @@ prometheus.scrape "default" { } ``` -Every time the file contents change, the `local.file` updates its exports. The new value is given to the `prometheus.scrape` targets field. +Each time the file contents change, the `local.file` updates its exports. The new value is sent to the `prometheus.scrape` targets field. Each argument and exported field has an underlying [type][]. -River type-checks expressions before assigning a value to an attribute. -The documentation of each [component][components] provides more information about the ways that you can wire components together. +River checks the expression type before assigning a value to an attribute. +The documentation of each [component][components] provides more information about how to wire components together. In the previous example, the contents of the `local.file.targets.content` expression is evaluated to a concrete value. -The value is type-checked and substituted into `prometheus.scrape.default` where it can be configured. +The value is type-checked and substituted into `prometheus.scrape.default`, where you can configure it. [components]: {{< relref "../reference/components/_index.md" >}} [controller]: {{< relref "../concepts/component_controller.md" >}} diff --git a/docs/sources/flow/config-language/expressions/_index.md b/docs/sources/flow/config-language/expressions/_index.md index b2b65c859a13..fe4a6d66ae5e 100644 --- a/docs/sources/flow/config-language/expressions/_index.md +++ b/docs/sources/flow/config-language/expressions/_index.md @@ -13,14 +13,14 @@ weight: 400 # Expressions -Expressions represent or compute values that you can assign to attributes within a configuration. +Expressions represent or compute values you can assign to attributes within a configuration. Basic expressions are literal values, like `"Hello, world!"` or `true`. Expressions may also do things like [refer to values][] exported by components, perform arithmetic, or [call functions][]. You use expressions when you configure any component. All component arguments have an underlying [type][]. -River type-checks expressions before assigning the result to an attribute. +River checks the expression type before assigning the result to an attribute. [refer to values]: {{< relref "./referencing_exports.md" >}} [call functions]: {{< relref "./function_calls.md" >}} diff --git a/docs/sources/flow/config-language/expressions/operators.md b/docs/sources/flow/config-language/expressions/operators.md index 768b95e2cedb..309afb78ddc5 100644 --- a/docs/sources/flow/config-language/expressions/operators.md +++ b/docs/sources/flow/config-language/expressions/operators.md @@ -14,7 +14,7 @@ weight: 300 # Operators River uses a common set of operators. -All operations follow the standard [PEMDAS][] rule for operator precedence. +All operations follow the standard [PEMDAS][] order of mathematical operations. ## Arithmetic operators @@ -100,9 +100,9 @@ Operator | Description `[ ]` | Access a member of an array or object. `.` | Access a named member of an object or an exported field of a component. -River's access operators support accessing of arbitrarily nested values. +You can access arbitrarily nested values with River's access operators. You can use square brackets to access zero-indexed array indices and object fields by enclosing the field name in double quotes. -You can use the dot operator to access both object fields without double quotes, and component exports. +You can use the dot operator to access object fields without double quotes and component exports. ```river obj["app"] diff --git a/docs/sources/flow/config-language/expressions/referencing_exports.md b/docs/sources/flow/config-language/expressions/referencing_exports.md index d833b7b99126..d443b3c52e94 100644 --- a/docs/sources/flow/config-language/expressions/referencing_exports.md +++ b/docs/sources/flow/config-language/expressions/referencing_exports.md @@ -14,7 +14,7 @@ weight: 200 # Referencing component exports Referencing exports enables River to configure and connect components dynamically using expressions. -While components can work in isolation, they're more useful when one component's behavior and data flow is bound to the exports of another, +While components can work in isolation, they're more useful when one component's behavior and data flow are bound to the exports of another, building a dependency relationship between the two. Such references can only appear as part of another component's arguments or a configuration block's fields. @@ -50,8 +50,8 @@ In the preceding example, you wired together a very simple pipeline by writing a ![Flow of example pipeline](/media/docs/agent/flow_referencing_exports_diagram.svg) -As with all expressions, once the value is resolved, it must match the [type][] of the attribute it is assigned to. +After the value is resolved, it must match the [type][] of the attribute it is assigned to. While you can only configure attributes using the basic River types, -the exports of components can take on special internal River types such as Secrets or Capsules, which expose different functionality. +the exports of components can take on special internal River types, such as Secrets or Capsules, which expose different functionality. [type]: {{< relref "./types_and_values.md" >}} diff --git a/docs/sources/flow/config-language/expressions/types_and_values.md b/docs/sources/flow/config-language/expressions/types_and_values.md index bc4268dce9d8..739fad5b75b0 100644 --- a/docs/sources/flow/config-language/expressions/types_and_values.md +++ b/docs/sources/flow/config-language/expressions/types_and_values.md @@ -20,7 +20,7 @@ River uses the following types for its values: * `bool`: A boolean value, either `true` or `false`. * `array`: A sequence of values, like `[1, 2, 3]`. Elements within the list are indexed by whole numbers, starting with zero. * `object`: A group of values identified by named labels, like `{ name = "John" }`. -* `function`: A value representing a routine that can be executed with arguments to compute another value, like `env("HOME")`. +* `function`: A value representing a routine that runs with arguments to compute another value, like `env("HOME")`. Functions take zero or more arguments as input and always return a single value as output. * `null`: A type that has no value. @@ -29,10 +29,10 @@ River uses the following types for its values: In addition to the preceding types, the [component reference][] documentation uses the following conventions for referring to types: * `any`: A value of any type. -* `map(T)`: an `object` where the value type is `T`. +* `map(T)`: an `object` with the value type `T`. For example, `map(string)` is an object where all the values are strings. - The key type of an object is always a string or an identifier that is converted into a string. -* `list(T)`: an `array` where the value type is `T`. + The key type of an object is always a string or an identifier converted into a string. +* `list(T)`: an `array` with the value type`T`. For example, `list(string)` is an array where all the values are strings. * `duration`: a `string` denoting a duration of time, such as `"1d"`, `"1h30m"`, `"10s"`. Valid units are: @@ -50,7 +50,7 @@ In addition to the preceding types, the [component reference][] documentation us ## Numbers -River handles integers, unsigned integers, and floating-point values as a single 'number' type simplifying writing and reading River configuration files. +River handles integers, unsigned integers, and floating-point values as a single 'number' type, simplifying writing and reading River configuration files. ```river 3 == 3.00 // true @@ -119,7 +119,7 @@ Bools are represented by the symbols `true` and `false`. ## Arrays -Array values are constructed by a sequence of comma-separated values surrounded by square brackets `[]`: +You construct arrays with a sequence of comma-separated values surrounded by square brackets `[]`: ```river [0, 1, 2, 3] @@ -138,7 +138,7 @@ A comma after the final value must be present if the closing bracket `]` is on a ## Objects -You construct object values with a sequence of comma-separated key-value pairs surrounded by curly braces `{}`. +You construct objects with a sequence of comma-separated key-value pairs surrounded by curly braces `{}`. ```river { @@ -153,7 +153,7 @@ You can omit the comma after the final key-value pair if the closing curly brace { name = "John" } ``` -If the key isn't a valid identifier, you must must wrap it in double quotes like a string. +If the key isn't a valid identifier, you must wrap it in double quotes like a string. ```river { @@ -168,7 +168,7 @@ Don't confuse objects with blocks. An _object_ is a value assigned to an [Attribute][Attributes]. You **must** use commas between key-value pairs on separate lines. -A [Block][Blocks] is a named structural element composed of multiple attributes. You **must not** use commans between attributes. +A [Block][Blocks] is a named structural element composed of multiple attributes. You **must not** use commas between attributes. [Attributes]: {{< relref "../syntax.md#Attributes" >}} [Blocks]: {{< relref "../syntax.md#Blocks" >}} @@ -176,7 +176,7 @@ A [Block][Blocks] is a named structural element composed of multiple attributes. ## Functions -You can't construct function values. You can call functions from the standard library or you can export them from a component. +You can't construct function values. You can call functions from the standard library or export them from a component. ## Null @@ -187,7 +187,7 @@ The null value is represented by the symbol `null`. #### Secrets A `secret` is a special type of string that's never displayed to the user. -`string` values may be assigned to an attribute expecting a `secret`, but never the inverse. +You can assign `string` values to an attribute expecting a `secret`, but never the inverse. It's impossible to convert a secret to a string or assign a secret to an attribute expecting a string. #### Capsules @@ -196,7 +196,7 @@ A `capsule` is a special type that represents a category of _internal_ types use Each capsule type has a unique name and is represented to the user as `capsule("")`. You can't construct capsule values. You can use capsules in expressions as any other type. Capsules aren't inter-compatible, and an attribute expecting a capsule can only be given a capsule of the same internal type. -That means, if an attribute expects a `capsule("prometheus.Receiver")`, it you can only assign a `capsule("prometheus.Receiver")` type. +If an attribute expects a `capsule("prometheus.Receiver")`, you can only assign a `capsule("prometheus.Receiver")` type. The specific type of capsule expected is explicitly documented for any component that uses or exports them. In the following example, the `prometheus.remote_write` component exports a `receiver`, which is a `capsule("prometheus.Receiver")` type. diff --git a/docs/sources/flow/config-language/files.md b/docs/sources/flow/config-language/files.md index b07af903205e..2b5e12f7b6e1 100644 --- a/docs/sources/flow/config-language/files.md +++ b/docs/sources/flow/config-language/files.md @@ -17,4 +17,4 @@ River files are plain text files with the `.river` file extension. You can refer to each River file as a "configuration file" or a "River configuration." River files must be UTF-8 encoded and can contain Unicode characters. -River files can use both Unix-style line endings (LF) and Windows-style line endings (CRLF), but formatters may replace all line endings with Unix-style ones. +River files can use Unix-style line endings (LF) and Windows-style line endings (CRLF), but formatters may replace all line endings with Unix-style ones. diff --git a/docs/sources/flow/config-language/syntax.md b/docs/sources/flow/config-language/syntax.md index 95a0a911d4c2..91ab20b9813a 100644 --- a/docs/sources/flow/config-language/syntax.md +++ b/docs/sources/flow/config-language/syntax.md @@ -53,7 +53,7 @@ _Blocks_ are used to configure the {{< param "PRODUCT_ROOT_NAME" >}}'s behavior components by grouping any number of attributes or nested blocks using curly braces. Blocks have a _name_, an optional _label_ and a body that contains any number of arguments and nested unlabeled blocks. -Some blocks support being defined more than once. +Some blocks support can be defined more than once. #### Pattern for creating an unlabeled block @@ -86,7 +86,7 @@ BLOCK_NAME "BLOCK_LABEL" { The `BLOCK_NAME` has to be recognized by {{< param "PRODUCT_NAME" >}} as either a valid component name or a special block for configuring global settings. If the `BLOCK_LABEL` must be set, it must be a valid River [identifier](#identifiers) wrapped in double quotes. -In these cases, the label is used to disambiguate between multiple top-level blocks of the same name. +In these cases, you use the label to disambiguate between multiple top-level blocks of the same name. The following snippet defines a block named `local.file` with its label set to "token". The block's body sets `filename` to the content of the `TOKEN_FILE_PATH` environment variable by using an expression,