liveBook · Manning

Telemetry

As explained in Secure APIs

Data and signals emitted by software about its execution, health, and behavior.

Telemetry is data emitted by software about its execution, health, behavior, and user interactions. Logs, traces, and metrics turn application outputs into evidence about system state. section 11.1 section 11.7

Use each telemetry type for a different view of an API:

  • Logs record specific events, such as received requests or raised errors. section 11.2
  • Traces connect processing steps and their logs through a shared trace ID. section 11.2
  • Metrics summarize behavior, such as request rates and response times, helping reveal trends and outliers. section 11.7

Telemetry supports reliability and security. Continuous analysis can shorten mean time to recovery, reveal threats or endpoint abuse, and provide an audit trail of who did what, where, and when. Useful telemetry must be collected, stored, and processed so that it supports investigation rather than merely accumulating data. section 11.1 section 11.3

Instrumenting a FastAPI endpoint

OpenTelemetry can autoinstrument a Python FastAPI application without changing application code. Running the instrumentation command with console exporters produces signals such as a span for GET /books, including its trace ID, timing, route, method, and status. Add manual instrumentation when custom security telemetry is needed, while removing sensitive data from logged input. section 11.3 section 11.7

Figure 11.1 By continuously analyzing our logs, we gain an understanding of the state of our system. In this example, we find that one endpoint is encountering an unusual error rate.
figure

Use the observability diagram to see how continuously analyzing logs can expose an endpoint with an unusual error rate. section 11.1

How Secure APIs covers it

How deep it goes
Defines logs, traces, metrics, and instrumentation with practical setup, but stops short of detailed telemetry-storage internals.
Examples
Uses API requests, errors, database-query logs, OpenTelemetry spans, endpoint metrics, and unusual user request rates.
What it assumes
Assumes an API or software-application context while teaching telemetry types and instrumentation from their basic definitions.
What you can do after
Operate/configure OpenTelemetry instrumentation, correlate API activity, analyze trends, and design safer security telemetry.
How it connects
Connects observability, instrumentation, logs, traces, metrics, audit trails, threat detection, and mean time to recovery.

Also explained in

Compare how 8 books explain telemetry →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.