-
Notifications
You must be signed in to change notification settings - Fork 16
docs: Explain how to work with auto-generated keys; Restructure to clarify how to specify keys for authoritative fields. #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dc327ba
84cf8d2
f6d3277
2a6a32d
fedc491
ecbc9c4
efcfc49
fbe3d67
1ef7972
c164755
98999a4
e119e5f
92aaebd
f5bc74f
50a59fe
9b4626c
a255ca3
27525b7
77b79f1
2300f33
f02cf0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Overview | ||
|
||
The guides below describe how to configure the log viewer to work with structured logs. | ||
|
||
::::{grid} 1 1 2 2 | ||
:gutter: 2 | ||
|
||
:::{grid-item-card} | ||
:link: format/index | ||
Formatting as plain text | ||
^^^ | ||
How to format structured logs as plain text, using a format string. | ||
::: | ||
|
||
:::{grid-item-card} | ||
:link: specifying-keys | ||
Specifying keys | ||
^^^ | ||
How to specify keys when configuring the log viewer. | ||
::: | ||
:::: |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||
* Nested keys can be specified using periods (`.`) to denote hierarchy. | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Add a top-level heading for consistency with Markdown style # Key Syntax 🧰 Tools🪛 markdownlint-cli2 (0.17.2)1-1: First line in a file should be a top-level heading (MD041, first-line-heading, first-line-h1) |
||||||||||||||||||||||||||||||
* E.g., the field `{"a:" {"b": 0}}` may be denoted by `a.b`. | ||||||||||||||||||||||||||||||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct the JSON example syntax - * E.g., the field `{"a:" {"b": 0}}` may be denoted by `a.b`.
+ * E.g., the field `{"a": {"b": 0}}` may be denoted by `a.b`. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.17.2)1-1: First line in a file should be a top-level heading (MD041, first-line-heading, first-line-h1) |
||||||||||||||||||||||||||||||
* Auto-generated keys in a [Key-Value Pair IR Stream][kv-pair-ir] can be specified by using `@` as | ||||||||||||||||||||||||||||||
a prefix. | ||||||||||||||||||||||||||||||
* E.g., the auto-generated key `ts` would be specified as `@ts`. | ||||||||||||||||||||||||||||||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Simplify the auto-generated keys bullet for clarity -* Auto-generated keys in a [Key-Value Pair IR Stream][kv-pair-ir] can be specified by using `@` as
- a prefix.
+* Auto-generated keys in a [Key-Value Pair IR Stream][kv-pair-ir] can be specified by prefixing them with `@`. 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
* Keys can contain any character, except the following characters must be escaped with a backslash: | ||||||||||||||||||||||||||||||
* `.` | ||||||||||||||||||||||||||||||
* `@` | ||||||||||||||||||||||||||||||
* `{` | ||||||||||||||||||||||||||||||
* `}` | ||||||||||||||||||||||||||||||
* `:` | ||||||||||||||||||||||||||||||
* `\` | ||||||||||||||||||||||||||||||
Comment on lines
+6
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Improve wording and escape sequence formatting
📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
[kv-pair-ir]: https://docs.yscope.com/clp/main/dev-guide/design-kv-ir-streams/auto-gen-kv-pairs.html |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Specifying keys | ||
|
||
Viewing structured logs requires specifying keys for: | ||
* The format string | ||
* Authoritative fields such as the log level and timestamp | ||
|
||
Both options are found the settings dialog ({fas}`gear`). | ||
|
||
## Syntax | ||
|
||
:::{include} key-syntax.md | ||
::: |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -48,18 +48,19 @@ const getConfigFormFields = () => [ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
helperText: ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[JSON] Format string for formatting a JSON log event as plain text. See the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Structured] Format string for formatting a structured log event as plain text. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Leave blank to display the entire log event. See | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/format-struct-logs-overview.html"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/format/index.html"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
level={"body-sm"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rel={"noopener"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target={"_blank"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
format string syntax docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
or leave this blank to display the entire log event. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for syntax. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+51
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Descriptive link text for accessibility. The link text “here” is too generic and may not be clear for assistive technologies. Consider using more descriptive text, for example: - <Link
- href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/format/index.html"}
- level={"body-sm"}
- rel={"noopener"}
- target={"_blank"}
- >
- here
- </Link>
+ <Link
+ href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/format/index.html"}
+ level={"body-sm"}
+ rel={"noopener"}
+ target={"_blank"}
+ >
+ structured logs formatting guide
+ </Link> 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialValue: getConfig(CONFIG_KEY.DECODER_OPTIONS).formatString, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -68,14 +69,44 @@ const getConfigFormFields = () => [ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "text", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
helperText: "[JSON] Key to extract the log level from.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
helperText: ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Structured] Key that maps to each log event's log level. See | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/specifying-keys.html#syntax"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
level={"body-sm"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rel={"noopener"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target={"_blank"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for syntax. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+72
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Enhance link clarity for log level key syntax. Similarly, the link text “here” in the log level key helper text is not self-descriptive. Update it to a phrase that reflects its target, for example: - <Link
- href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/specifying-keys.html#syntax"}
- level={"body-sm"}
- rel={"noopener"}
- target={"_blank"}
- >
- here
- </Link>
+ <Link
+ href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/specifying-keys.html#syntax"}
+ level={"body-sm"}
+ rel={"noopener"}
+ target={"_blank"}
+ >
+ structured logs key syntax guide
+ </Link> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialValue: getConfig(CONFIG_KEY.DECODER_OPTIONS).logLevelKey, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
key: LOCAL_STORAGE_KEY.DECODER_OPTIONS_LOG_LEVEL_KEY, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Decoder: Log level key", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: "text", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
helperText: "[JSON] Key to extract the log timestamp from.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
helperText: ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[Structured] Key that maps to each log event's timestamp. See | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/specifying-keys.html#syntax"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
level={"body-sm"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rel={"noopener"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target={"_blank"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for syntax. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+94
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Use meaningful link text for timestamp key syntax. The helper text for the timestamp key also uses “here”, which offers no context. Consider a descriptive label: - <Link
- href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/specifying-keys.html#syntax"}
- level={"body-sm"}
- rel={"noopener"}
- target={"_blank"}
- >
- here
- </Link>
+ <Link
+ href={"https://docs.yscope.com/yscope-log-viewer/main/user-guide/struct-logs/specifying-keys.html#syntax"}
+ level={"body-sm"}
+ rel={"noopener"}
+ target={"_blank"}
+ >
+ structured logs key syntax guide
+ </Link> 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialValue: getConfig(CONFIG_KEY.DECODER_OPTIONS).timestampKey, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
key: LOCAL_STORAGE_KEY.DECODER_OPTIONS_TIMESTAMP_KEY, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Decoder: Timestamp key", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.