Skip to content

Latest commit

 

History

History
137 lines (102 loc) · 2.35 KB

examples.md

File metadata and controls

137 lines (102 loc) · 2.35 KB
theme highlightTheme
night
monokai

Example


Machine Exhaust

2021-07-25T04:12:50Z INFO handling request
2021-07-25T04:12:50Z INFO handling request
2021-07-25T04:12:50Z INFO authorizing "123"
2021-07-25T04:12:50Z INFO authorizing "543"
2021-07-25T04:12:51Z INFO authorized
2021-07-25T04:12:52Z INFO unauthorized

$100B industry to handle this! 💸🔥


+ Structure

{
    "time": "2021-07-25T04:12:50Z",
    "msg": "authorized"
}

Structure means we can parse it with a broad range of tools.


+ User context

{
    "time": "2021-07-25T04:12:50Z",
    "msg": "authorized",
    "id": "123"
}

Context means why can ask more interesting questions.

"how frequently does this ID authenticate with success?"


+ User state

{
    "time": "2021-07-25T04:12:50Z",
    "msg": "authorized",
    "id": "123",
    "groups": ["a", "b"]
}

Ephemeral state is particularly hard to troubleshoot.


+ System context

{
    "time": "2021-07-25T04:12:50Z",
    "application": "authorizer@3.0.1",
    "msg": "authorized",
    "id": "123",
    "groups": ["a", "b"]
}

System context means we know what emitting this; and which version.

"when did this start failing? is this a bug with v3?"


+ System state

{
    "time": "2021-07-25T04:12:50Z",
    "application": "authorizer@3.0.1",
    "msg": "authorized",
    "id": "123",
    "groups": ["a", "b"],
    "cache_used": "1627186370"
}

System state is often ephemeral; in-memory only; perilous.


+ System tracing

{
    "time": "2021-07-25T04:12:50Z",
    "application": "authorizer@3.0.1",
    "msg": "authorized",
    "id": "123",
    "groups": ["a", "b"],
    "cache_used": "1627186370",
    "request_id": "a39b28c9"
}

A complex system may emit many events; a request ID brings lineage.


+ Distributed tracing

{
    "time": "2021-07-25T04:12:50Z",
    "application": "authorizer@3.0.1",
    "msg": "authorized",
    "id": "123",
    "groups": ["a", "b"],
    "cache_used": "1627186370",
    "request_id": "a39b28c9",
    "corelation_id": "d4289bd7"
}

A distributed system add more complexity; consider a specialized ID to across system boundaries.