Skip to content

Commit

Permalink
Update to use codeblock for static and flow
Browse files Browse the repository at this point in the history
  • Loading branch information
clayton-cornell committed Oct 19, 2023
1 parent b5429c3 commit 873fdc3
Showing 1 changed file with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions docs/sources/flow/getting-started/migrating-from-static.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,17 @@ features available in Grafana Agent Flow mode.
1. Open a terminal window and run the following command:

```bash
AGENT_MODE=flow grafana-agent convert --source-format=static --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```
{{< code >}}

```static-binary
AGENT_MODE=flow grafana-agent convert --source-format=static --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

```flow-binary
grafana-agent-flow convert --source-format=static --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

{{< /code >}}

Replace the following:
* `INPUT_CONFIG_PATH`: The full path to the [Static][] configuration.
Expand All @@ -82,16 +90,32 @@ features available in Grafana Agent Flow mode.

{{% admonition type="caution" %}}If you bypass the errors, the behavior of the converted configuration may not match the original [Static] mode configuration. Make sure you fully test the converted configuration before using it in a production environment.{{% /admonition %}}

```bash
AGENT_MODE=flow grafana-agent convert --source-format=static --bypass-errors --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```
{{< code >}}

```static-binary
AGENT_MODE=flow grafana-agent convert --source-format=static --bypass-errors --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

```flow-binary
grafana-agent-flow convert --source-format=static --bypass-errors --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

{{< /code >}}

1. You can use the `--report` flag to output a diagnostic report.

```bash
AGENT_MODE=flow grafana-agent convert --source-format=static --report=OUTPUT_REPORT_PATH --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
{{< code >}}

```static-binary
AGENT_MODE=flow grafana-agent convert --source-format=static --report=OUTPUT_REPORT_PATH --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

```flow-binary
grafana-agent-flow convert --source-format=static --report=OUTPUT_REPORT_PATH --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```
{{< /code >}}
* Replace `OUTPUT_REPORT_PATH` with the output path for the report.
Using the [example](#example) Grafana Agent Static Mode configuration below, the diagnostic
Expand Down Expand Up @@ -196,10 +220,18 @@ The convert command takes the YAML file as input and outputs a [River][] file.

[River]: {{< relref "../config-language/_index.md" >}}

```bash
{{< code >}}

```static-binary
AGENT_MODE=flow grafana-agent convert --source-format=static --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

```flow-binary
grafana-agent-flow convert --source-format=static --output=OUTPUT_CONFIG_PATH INPUT_CONFIG_PATH
```

{{< /code >}}

The new Flow mode configuration file looks like this:

```river
Expand Down

0 comments on commit 873fdc3

Please sign in to comment.