Skip to content
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

Update docs for link parameter formatting #807

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
39 changes: 39 additions & 0 deletions content/docs/next-release-v2/frontend-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ An example configuration file (see [complete schema here](https://github.com/jae
"key": "uniqueId",
"url": "https://mykibana.com/uniqueId=#{uniqueId}&traceId=#{trace.traceID}",
"text": "Redirect to kibana to view log"
},
{
"type": "traces",
"url": "https://my-logs.server?from=#{startTime | add -60000000 | epoch_micros_to_date_iso}&to=#{endTime | add 60000000 | epoch_micros_to_date_iso}'",
"text": "Redirect to kibana to view log with formatted dates"
}]
}
```
Expand Down Expand Up @@ -146,6 +151,40 @@ For traces, the supported template fields are: `duration`, `endTime`, `startTime

Further, the trace template fields are available for substitution in process/logs/tags type when the trace template fields are prefixed with `trace.`. For example: `trace.traceID`, `trace.startTime`.

#### Formatting

In addition to interpolating fields into links, formatting functions can be used. The syntax is `#{field | function}` (eg `#{endTime | epoch_micros_to_date_iso}'`). Formatting functions can be chained together (eg `#{startTime | add 60000000 | epoch_micros_to_date_iso}`).

The available formatting functions and a description of their behavior are:

##### `epoch_micros_to_date_iso`

Format a date in microseconds since epoch to an ISO date time.

Example:
`#{endTime | epoch_micros_to_date_iso}`

##### `pad_start`

Pad the start of a string with a given character until the resulting string reaches the given length. Behavior is implemented by and thus matches javascript's [String.padStart](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart)

Arguments:

- `targetLength` (integer) - Desired length of the string after padding
- `padCharacter` (string) - String to pad the start of the input string with

Example: `#{traceID | pad_start 32 0}`

##### `add`

Add a value to another number. Can be positive or negative.

Arguments:

- `offset` (integer) - Value to add to the input number

Example: `#{startTime | add 1000000}`

## Embedded Mode

Starting with version 1.9, Jaeger UI provides an "embedded" layout mode which is intended to support integrating Jaeger UI into other applications. Currently (as of `v0`), the approach taken is to remove various UI elements from the page to make the UI better suited for space-constrained layouts.
Expand Down
39 changes: 39 additions & 0 deletions content/docs/next-release/frontend-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ An example configuration file (see [complete schema here](https://github.com/jae
"key": "uniqueId",
"url": "https://mykibana.com/uniqueId=#{uniqueId}&traceId=#{trace.traceID}",
"text": "Redirect to kibana to view log"
},
{
"type": "traces",
"url": "https://my-logs.server?from=#{startTime | add -60000000 | epoch_micros_to_date_iso}&to=#{endTime | add 60000000 | epoch_micros_to_date_iso}'",
"text": "Redirect to kibana to view log with formatted dates"
}]
}
```
Expand Down Expand Up @@ -146,6 +151,40 @@ For traces, the supported template fields are: `duration`, `endTime`, `startTime

Further, the trace template fields are available for substitution in process/logs/tags type when the trace template fields are prefixed with `trace.`. For example: `trace.traceID`, `trace.startTime`.

#### Formatting

In addition to interpolating fields into links, formatting functions can be used. The syntax is `#{field | function}` (eg `#{endTime | epoch_micros_to_date_iso}'`). Formatting functions can be chained together (eg `#{startTime | add 60000000 | epoch_micros_to_date_iso}`).

The available formatting functions and a description of their behavior are:

##### `epoch_micros_to_date_iso`

Format a date in microseconds since epoch to an ISO date time.

Example:
`#{endTime | epoch_micros_to_date_iso}`

##### `pad_start`

Pad the start of a string with a given character until the resulting string reaches the given length. Behavior is implemented by and thus matches javascript's [String.padStart](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart)

Arguments:

- `targetLength` (integer) - Desired length of the string after padding
- `padCharacter` (string) - String to pad the start of the input string with

Example: `#{traceID | pad_start 32 0}`

##### `add`

Add a value to another number. Can be positive or negative.

Arguments:

- `offset` (integer) - Value to add to the input number

Example: `#{startTime | add 1000000}`

## Embedded Mode

Starting with version 1.9, Jaeger UI provides an "embedded" layout mode which is intended to support integrating Jaeger UI into other applications. Currently (as of `v0`), the approach taken is to remove various UI elements from the page to make the UI better suited for space-constrained layouts.
Expand Down
Loading