Complete the code to collect system performance data using the correct pillar.
system_data = collect_[1]() # Collects numerical data like CPU usage
Metrics are numerical measurements like CPU or memory usage collected over time.
Complete the code to record detailed event information for debugging.
write_[1]('User login failed due to invalid password')
Logs record detailed text events useful for debugging and auditing.
Fix the error in the code to track the path of a request through services.
trace = start_[1]('request-123') # Tracks request flow across microservices
Traces follow the journey of a request through multiple services to find delays or errors.
Fill both blanks to create a dictionary comprehension that filters logs by severity and extracts timestamps.
{log['timestamp']: log['message'] for log in logs if log['severity'] [1] 'ERROR' and log['timestamp'] [2] 0}The code filters logs where severity equals 'ERROR' and timestamps are positive.
Fill all three blanks to build a trace span dictionary with service name, duration, and status check.
span = {
'service': '[1]',
'duration_ms': [2],
'status': 'success' if [3] < 500 else 'failure'
}The span dictionary records the service name, duration in milliseconds, and status based on response time.