Skip to content

Commit

Permalink
Clarify Unit Requirement for Duration Comparison in Label Values
Browse files Browse the repository at this point in the history
Sure, here's a suitable pull request description:

Description
This update clarifies the requirement for units within the original label value when making a Duration comparison. It ensures that users understand the necessity of including a unit suffix (e.g., 'ms', 'h') for accurate parsing and comparison.

Changes
Updated documentation to specify that the label value must include a unit suffix.
Added examples and notes about using label_format to modify the value and append the unit before comparison.
Motivation and Context
Clarifies the need for units within the original label value when making a Duration comparison, preventing potential parsing errors and improving the accuracy of comparisons.
  • Loading branch information
nickgrafana authored Jun 25, 2024
1 parent 0a7e913 commit 4417b79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/sources/query/log_queries/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ For example with `cluster="namespace"` the cluster is the label identifier, the
We support multiple **value** types which are automatically inferred from the query input.

- **String** is double quoted or backticked such as `"200"` or \``us-central1`\`.
- **[Duration](https://golang.org/pkg/time/#ParseDuration)** is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
- **[Duration](https://golang.org/pkg/time/#ParseDuration)** is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". The value of the label identifier used for comparison must be a string with a unit suffix to be parsed correctly, such as "0.10ms" or "1h30m". Optionally, `label_format` can be used to modify the value and append the unit before making the comparison.
- **Number** are floating-point number (64bits), such as`250`, `89.923`.
- **Bytes** is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "42MB", "1.5Kib" or "20b". Valid bytes units are "b", "kib", "kb", "mib", "mb", "gib", "gb", "tib", "tb", "pib", "pb", "eib", "eb".

Expand Down

0 comments on commit 4417b79

Please sign in to comment.