Skip to content

Commit

Permalink
add fields option (#4338)
Browse files Browse the repository at this point in the history
  • Loading branch information
colleenmcginnis authored Oct 2, 2024
1 parent b7f1f8a commit 065ef9e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/en/serverless/synthetics/synthetics-command-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ SYNTHETICS_API_KEY=<api-key> npx @elastic/synthetics push --url <kibana-url> --i
The value defined via the CLI will take precedence.
</DocDefDescription>

<DocDefTerm>`--fields <string>`</DocDefTerm>
<DocDefDescription>
A list of key-value pairs that will be sent with each monitor event.
The `fields` are appended to ((es)) documents as `labels`,
and those labels are displayed in ((kib)) in the _Monitor details_ panel in the <DocLink slug="/serverless/observability/synthetics-analyze" section="synthetics-analyze-individual-monitors-overview">individual monitor's _Overview_ tab</DocLink>.

Example: `--fields '{ "foo": bar", "team": "synthetics" }'`

This can also be set in the configuration file using <DocLink slug="/serverless/observability/synthetics-configuration" section="monitor">the `monitor.fields` option</DocLink>.
The value defined via the CLI will take precedence.
</DocDefDescription>

<DocDefTerm>`--yes`</DocDefTerm>
<DocDefDescription>
The `push` command includes interactive prompts to prevent you from accidentally deleting or duplicating monitors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,20 @@
Using `retestOnFailure` can reduce noise related to transient problems.
</DocDefDescription>

</DocDefList>
<DocDefTerm>`fields` (`object`)</DocDefTerm>
<DocDefDescription>
A list of key-value pairs that will be sent with each monitor event.
The `fields` are appended to ((es)) documents as `labels`,
and those labels are displayed in ((kib)) in the _Monitor details_ panel in the
<DocLink slug="/serverless/observability/synthetics-analyze" section="synthetics-analyze-individual-monitors-overview">individual monitor's _Overview_ tab</DocLink>.

For example:

```js
fields: {
foo: 'bar',
team: 'synthetics',
}
```
</DocDefDescription>
</DocDefList>
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,28 @@
</DocCallOut>
</DocCell>
</DocRow>
<DocRow>
<DocCell>
<span id="monitor-fields">**`fields`**</span>
</DocCell>
<DocCell>
A list of key-value pairs that will be sent with each monitor event.
The `fields` are appended to ((es)) documents as `labels`,
and those labels are displayed in ((kib)) in the _Monitor details_ panel in the
<DocLink slug="/serverless/observability/synthetics-analyze" section="synthetics-analyze-individual-monitors-overview">individual monitor's _Overview_ tab</DocLink>.

**Examples**:

```yaml
fields:
foo: bar
team: synthetics
```

```yaml
fields.foo: bar
fields.team: synthetics
```
</DocCell>
</DocRow>
</DocTable>

0 comments on commit 065ef9e

Please sign in to comment.