Skip to content

Commit 9149e34

Browse files
committed
Add more formatting functions and function chaining
Signed-off-by: Drew Corlin <[email protected]>
1 parent 3a84cce commit 9149e34

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

content/docs/next-release-v2/frontend-ui.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,13 @@ Further, the trace template fields are available for substitution in process/log
154154
#### Formatting
155155

156156
In addition to interpolating fields into links, formatting functions can be used. The syntax is `#{field | function}` (eg `#{endTime | epoch_micros_to_date_iso}'`). The available formatting functions and a description of their behavior are:
157-
| Function | Description | Example |
158-
| -------- | ----------- | ------- |
159-
| `epoch_micros_to_date_iso` | Format a date in microseconds since epoch to an ISO date time | `#{endTime \| epoch_micros_to_date_iso}` |
157+
| Function name | Arguments | Description | Example |
158+
| ------------- | --------- | ----------- | ------- |
159+
| `epoch_micros_to_date_iso` | - | Format a date in microseconds since epoch to an ISO date time | `#{endTime \| epoch_micros_to_date_iso}` |
160+
| `pad_start` | 1.`targetLength`(integer) 2.`padCharacter`(string) | 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) | `#{traceID \| pad_start 32 0}`|
161+
| `add` | 1.`offset`(integer) | Add a value to another number. Can be positive or negative | `#{startTime \| add 1000000}`|
162+
163+
Formatting functions can be chained together. For example `#{startTime | add 60000000 | epoch_micros_to_date_iso}`.
160164

161165
## Embedded Mode
162166

content/docs/next-release/frontend-ui.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,13 @@ Further, the trace template fields are available for substitution in process/log
154154
#### Formatting
155155

156156
In addition to interpolating fields into links, formatting functions can be used. The syntax is `#{field | function}` (eg `#{endTime | epoch_micros_to_date_iso}'`). The available formatting functions and a description of their behavior are:
157-
| Function | Description | Example |
158-
| -------- | ----------- | ------- |
159-
| `epoch_micros_to_date_iso` | Format a date in microseconds since epoch to an ISO date time | `#{endTime \| epoch_micros_to_date_iso}` |
157+
| Function name | Arguments | Description | Example |
158+
| ------------- | --------- | ----------- | ------- |
159+
| `epoch_micros_to_date_iso` | - | Format a date in microseconds since epoch to an ISO date time | `#{endTime \| epoch_micros_to_date_iso}` |
160+
| `pad_start` | 1.`targetLength`(integer) 2.`padCharacter`(string) | 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) | `#{traceID \| pad_start 32 0}`|
161+
| `add` | 1.`offset`(integer) | Add a value to another number. Can be positive or negative | `#{startTime \| add 1000000}`|
162+
163+
Formatting functions can be chained together. For example `#{startTime | add 60000000 | epoch_micros_to_date_iso}`.
160164

161165
## Embedded Mode
162166

0 commit comments

Comments
 (0)