Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/current/v26.2/cockroach-gen.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Subcommand | Usage
`autocomplete` | Generate `bash` or `zsh` autocompletion script for CockroachDB.<br><br>**Default:** `bash`
`example-data` | Generate example SQL datasets. You can also use the [`cockroach workload`]({% link {{ page.version.version }}/cockroach-workload.md %}) command to generate these sample datasets in a persistent cluster and the [`cockroach demo <dataset>`]({% link {{ page.version.version }}/cockroach-demo.md %}) command to generate these datasets in a temporary, in-memory cluster.
`haproxy` | Generate an HAProxy config file for a running CockroachDB cluster. The node addresses included in the config are those advertised by the nodes. Make sure hostnames are resolvable and IP addresses are routable from HAProxy.<br><br> [Decommissioned nodes](node-shutdown.html?filters=decommission) are excluded from the config file.
`dashboard` | Generate a standardized monitoring dashboard as a JSON file for either Datadog or Grafana. The generated dashboard includes Overview, Hardware, Runtime, Networking, SQL, and Storage metrics.
Comment thread
peachdawnleach marked this conversation as resolved.

## Synopsis

Expand Down Expand Up @@ -52,6 +53,13 @@ Generate an HAProxy config file for a running cluster:
$ cockroach gen haproxy
~~~

Generate a Grafana dashboard:

{% include_cached copy-clipboard.html %}
~~~ shell
$ cockroach gen dashboard --tool=grafana
~~~

View help:

{% include_cached copy-clipboard.html %}
Expand Down Expand Up @@ -113,6 +121,14 @@ Flag | Description
`--out` | The path where the `haproxy.cfg` file will be generated. If an `haproxy.cfg` file already exists in the directory, it will be overwritten.<br><br>**Default:** `haproxy.cfg` in the current directory
`--locality` | If nodes were started with [locality]({% link {{ page.version.version }}/cockroach-start.md %}#locality) details, you can use the `--locality` flag here to filter the nodes included in the HAProxy config file, specifying the explicit locality tier(s) or a regular expression to match against. This is useful in cases where you want specific instances of HAProxy to route to specific nodes. See the [Generate an HAProxy configuration file](#generate-an-haproxy-config-file) example for more details.

#### `dashboard`

Flag | Description
-----|------------
`--tool` | Which tool you would like your dashboard to be compatible with.<br><br>**Acceptable values:** `datadog`, `grafana`
`--output` | The path for the output file.
`--rollup-interval` | The interval, in seconds, for the rollup policy to control metric aggregation.

### Logging

{% include {{ page.version.version }}/misc/logging-defaults.md %}
Expand Down Expand Up @@ -394,6 +410,22 @@ Field | Description
For full details on these and other configuration settings, see the [HAProxy Configuration Manual](http://cbonte.github.io/haproxy-dconv/1.7/configuration.html).
{{site.data.alerts.end}}

### Generate a dashboard

Generate a Datadog dashboard:

{% include_cached copy-clipboard.html %}
~~~ shell
$ cockroach gen dashboard --tool=datadog --output='{path/to/file.json}' --rollup-interval=60
~~~

Generate a Grafana dashboard:

{% include_cached copy-clipboard.html %}
~~~ shell
$ cockroach gen dashboard --tool=grafana --output='{path/to/file.json}' --rollup-interval=60
~~~

## See also

- [`cockroach` Commands Overview]({% link {{ page.version.version }}/cockroach-commands.md %})
Expand Down
Loading