Design a logging and observability platform. Users can send their application logs to this platform. Users can view and analyze their logs using the platform’s web UI. You are expected to think through the requirements and design a backend architecture.
Here is a rough idea of what a log payload looks like. You can add more keys to accommodate your design and requirements. This payload will be constructed by the user within their App to send to us.
{
"requestId": Unique UUID for each request
"requestTs": Timestamp at which request is sent
"serviceId": ID for their service
"appId": ID for their particular app / microservice
"appVersion": Version of their app deployed sending this log
"appAttributes": Key-value store, custom app attributes eg. platform, env, etc.
// Think of span as a unit of work (eg. executing a method, tracking an event, etc.)
"spanId": UUID for the span
"parentId": UUID for the parent span (when executing a method invoked sub-methods)
"spanName": Name of the span (can be the method name)
"spanStartTs": Timestamp when span starts
"spanEndTs": Timestamp when span ends
"spanInput": Key-value store, input values to the span (eg. method arguments)
"spanOutput": Key-value store, output values of the span (eg. method output)
"spanAttributes": Key-value store, custom span attributes (eg. HTTP status if method is making an API call, rows returned if method is doing DB read, etc.)
"spanStatus": Binary status (eg. method ran without exception?)
"spanLogs": [
{
"logTs": Timestamp of log
"logLevel": Severity of log
"logMessage": Formatted log message
}
] Collection of logs captured during span execution
}
Functional requirements:
spanOutput
, spanAttributes
, spanStatus
serviceId
appId
spanId
spanStatus
spanName
spanInput
spanOutput
spanAttributes
logLevel
logMessage
spanDuration
, spanStatus
, logLevels
, etc.Scale requirements: