-
Notifications
You must be signed in to change notification settings - Fork 18
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 15 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 following are guides for working with structured logs. | ||
davemarco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
::::{grid} 1 1 2 2 | ||
:gutter: 2 | ||
|
||
:::{grid-item-card} | ||
:link: format/index | ||
Formatting as plain text | ||
^^^ | ||
A guide to formatting logs as plain text with a format string. | ||
davemarco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
::: | ||
|
||
:::{grid-item-card} | ||
:link: specifying-keys | ||
Specifying keys | ||
^^^ | ||
A guide on how to specify keys in YScope syntax. | ||
davemarco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
::: | ||
:::: |
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-key-value-pair-ir-stream.html | ||||||||||||||||||||||||||||||
davemarco marked this conversation as resolved.
Show resolved
Hide resolved
|
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -43,18 +43,19 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialValue: getConfig(CONFIG_KEY.DECODER_OPTIONS).formatString, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -63,14 +64,44 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
davemarco marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
level={"body-sm"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rel={"noopener"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target={"_blank"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for syntax. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. Fix unescaped apostrophe The helper text content looks good, but there's an unescaped apostrophe in "event's" that's causing the build to fail. This needs to be escaped according to React guidelines. - [Structured] Key that maps to each log event's log level. See
+ [Structured] Key that maps to each log event's log level. See 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: lint-check[failure] 69-69: 🪛 ESLint[error] 69-69: (react/no-unescaped-entities) 🪛 GitHub Actions: lint[error] 69-69: ' |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialValue: getConfig(CONFIG_KEY.DECODER_OPTIONS).logLevelKey, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Decoder: Log level key", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: LOCAL_STORAGE_KEY.DECODER_OPTIONS_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"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
davemarco marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
level={"body-sm"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rel={"noopener"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target={"_blank"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
here | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{" "} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for syntax. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. Fix unescaped apostrophe Similar to the previous comment, there's an unescaped apostrophe in "event's" that needs to be escaped for the component to render properly. - [Structured] Key that maps to each log event's timestamp. See
+ [Structured] Key that maps to each log event's timestamp. See 📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: lint-check[failure] 91-91: 🪛 ESLint[error] 91-91: (react/no-unescaped-entities) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialValue: getConfig(CONFIG_KEY.DECODER_OPTIONS).timestampKey, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: "Decoder: Timestamp key", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: LOCAL_STORAGE_KEY.DECODER_OPTIONS_TIMESTAMP_KEY, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.