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

[FR] Structured logging, with events and statistics #1122

Open
cdunklau opened this issue Feb 7, 2020 · 1 comment
Open

[FR] Structured logging, with events and statistics #1122

cdunklau opened this issue Feb 7, 2020 · 1 comment
Labels
[apps] Area: Test applications related improvements Type: Enhancement Indicates new feature requests
Milestone

Comments

@cdunklau
Copy link
Contributor

cdunklau commented Feb 7, 2020

Is your feature request related to a problem? Please describe.
As far as I can tell, srt-live-transmit does not provide a defined logging output format for machine interpretation. This makes it difficult to tell e.g. the state of a connection from a script or test application with confidence, since the exact log format is presumably not specified and could change between versions.

Describe the solution you'd like
I'd like to be able to configure srt-live-transmit so it outputs everything in a standardized, parseable format, with some reasonable policy to allow for backwards-compatible changes and deprecation.

The output should include:

  • Normal log events, containing the message, log level, and perhaps additional context.
  • Statistics reports (if enabled)
  • Connection state events, although these could conceivably be part of log events.

Each message should contain a top-level value that declares the message's schema. This prevents a consumer from needing to check several values to determine how a message should be interpreted. It should also contain a timestamp with reasonable (millisecond?) resolution.

Some examples follow, and assume JSON (which is probably the most reasonable). I'm not attached to the particular details of the schema, as long as it's clearly defined and straightforward to interpret programmatically.

Log message:

{
  "type": "LOG",
  "level": "INFO",
  "timestamp": "2020-02-07T12:48:28.963Z",
  "message": "Opening SRT target caller on dest.example.com:14901"
}

Separate connection state event:

  "detail": {
    "type": "CONNECTION_EVENT",
    "event": "STARTED_CONNECTING",
    "target": "srt://dest.example.com:14901"
  }

Alternatively, the log message combined with connection state event:

{
  "type": "LOG",
  "level": "INFO",
  "timestamp": "2020-02-07T12:48:28.963Z",
  "message": "Opening SRT target caller on dest.example.com:14901",
  "detail": {
    "type": "CONNECTION_EVENT",
    "event": "STARTED_CONNECTING",
    "target": "srt://dest.example.com:14901"
  }
}

Statistics report:

{
  "type": "STATS",
  "timestamp": "2020-02-07T12:48:28.963Z",
  "sid": 432830566,
  "time": 1329,
  "window": { },
  "link": { },
  "send": { },
  "recv": { }
}

Describe alternatives you've considered
The statistics output is quite nice, but getting connection state change events currently requires manual parsing of the log messages.

Additional context
Related to #908, and perhaps #55

@cdunklau cdunklau added the Type: Enhancement Indicates new feature requests label Feb 7, 2020
@cdunklau cdunklau changed the title [FR] Structured logging of events and statistics [FR] Structured logging, with events and statistics Feb 7, 2020
@maxsharabayko maxsharabayko added the [apps] Area: Test applications related improvements label Feb 7, 2020
@mbakholdina mbakholdina self-assigned this Feb 7, 2020
@mbakholdina
Copy link
Collaborator

Hi @cdunklau, thank you for your suggestions. We will consider them during revising and improving the SRT stats API (see #1215) functionality.

@mbakholdina mbakholdina added this to the v1.5.0 milestone Apr 20, 2020
@maxsharabayko maxsharabayko modified the milestones: v1.5.0, Parking Lot Jun 23, 2020
@mbakholdina mbakholdina removed their assignment Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[apps] Area: Test applications related improvements Type: Enhancement Indicates new feature requests
Projects
None yet
Development

No branches or pull requests

3 participants