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

[Stage 0/1] Initial draft for IO fieldset RFC #1956

Merged
merged 13 commits into from
Aug 16, 2022
15 changes: 14 additions & 1 deletion rfcs/text/0033-tty-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ A new "io" field is added to the top level process fieldset. The key use case is

- process.io (type: object)
- process.io.type (type: keyword, for now the only value will be "tty", but in future "file" and "socket" may be added)
- process.io.total_bytes_captured (type: number)
- process.io.total_bytes_skipped (type: number)
- process.io.text (type: wildcard, a line-oriented chunk of tty output text)
- process.io.bytes_skipped (type: object array)
- process.io.bytes_skipped.offset (type: number)
- process.io.bytes_skipped.length (type: number)

Possible future additions to support non utf-8 data:
- process.io.bytes (type: binary, a single base64 encoded string)
Expand All @@ -62,7 +67,7 @@ Stage 1: Provide a high-level description of example sources of data. This does
{
event: {
kind: 'event',
action: 'text_output' (for now the only action type, though once could imagine values like: text_input, binary_output, binary_input?)
action: 'text_output' (for now the only action type, though one could imagine values like: text_input, binary_output, binary_input?)
},
process: {
args: ['ls'],
Expand All @@ -83,6 +88,14 @@ Stage 1: Provide a high-level description of example sources of data. This does
type: "tty",
text: "hello world/n#!/bin/bash\ngoodbyeworld",

total_bytes_captured: 1024,
total_bytes_skipped: 160,

bytes_skipped: [
{ offset: 512, length: 128 },
{ offset: 768, length: 32 }
]

// future binary support
bytes: "<base64encodedstring>"
}
Expand Down
38 changes: 38 additions & 0 deletions rfcs/text/0033/process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,44 @@

Best efforts are made to ensure complete lines are captured in these events. Assumptions should NOT be made that multiple lines will appear in the same event. TTY output may contain terminal control codes such as for cursor movement, so some string queries may not match due to terminal codes inserted between characters of a word.

- name: io.total_bytes_captured
level: extended
type: number
description: >
The total number of bytes captured in this event.

- name: io.total_bytes_skipped
level: extended
type: number
description: >
The total number of bytes skipped in this event.

- name: io.max_kilobytes_per_process_exceeded
level: extended
type: boolean
description: >
If true, the process producing the output has exceeded the max_kilobytes_per_process configuration setting.

- name: io.bytes_skipped
level: extended
type: object
description: >
An array of byte offsets and lengths denoting where IO data may have been skipped.

normalize: array

- name: io.bytes_skipped.offset
level: extended
type: number
description: >
The byte offset showing when bytes were skipped.

- name: io.bytes_skipped.length
level: extended
type: number
description: >
The length of bytes skipped.

# future addition (NOT TO BE INCLUDED IN THIS RFC)
- name: io.bytes
level: extended
Expand Down