Markdown Editor

Observability Specification Template (OpenTelemetry)

Observability spec: logs, metrics and traces standards, semantic conventions, log schema, RED/USE catalogue, sampling, alerts, privacy, cost

OperationsFullOpenTelemetry conceptsobservabilityspecmath

How to use: Use it to set one telemetry standard for a service or platform before teams instrument independently. Start from the operator questions in section 1.2 and the naming conventions in section 4. The main pitfall is alerts without runbooks or owners, and personal data leaking into logs.

Preview

Observability Specification: [Service or platform name]

Complete observability specification for a service or platform: goals, telemetry signals, naming and semantic conventions, log schema, metrics catalogue, tracing, dashboards, SLIs and SLOs, alert rules, retention, cost, privacy and ownership. Concepts follow OpenTelemetry (signals, resources, attributes, context propagation, sampling). Replace every [bracketed] value and every row marked Example.

Document control

FieldValue
Document ID[OBS-PLATFORM-001]
Services covered[Service names or "all services on platform X"]
Version[0.1]
Status[Draft / In review / Approved / Superseded]
Owner[@observability-owner]
Classification[Internal]
Last updatedYYYY-MM-DD
Related documents[SLO document], [On-call handbook], [Runbooks], [Data protection policy]

Approvals

RoleNameDecisionDate
SRE lead[@name][Approved / Changes requested]YYYY-MM-DD
Engineering lead[@name][Decision]YYYY-MM-DD
Security / privacy[@name][Decision]YYYY-MM-DD
FinOps[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]Initial draft
0.2YYYY-MM-DD[@name]Example: Renamed app.user_id to enduser.pseudo_id; added PII scrubbing rule PR-04
1.0YYYY-MM-DD[@name]Example: Approved

Contents

1. Goals and scope

1.1 Goals

IDGoalMeasure
OG-01Example: Detect user-facing failures before customers report them90% of incidents detected by alert first
OG-02Example: Locate the failing component quicklyMedian time to identify root service < 10 min
OG-03Example: Keep telemetry cost proportional to trafficTelemetry spend < 8% of infrastructure spend
[OG-nn][Goal][Measure]

1.2 Operator questions

The signals in this specification must answer these questions without deploying new code:

  • Is the service healthy for users right now, and since when has it not been?
  • Which endpoint, region, version or customer segment is affected?
  • Which downstream dependency is slow or failing?
  • What changed just before the problem started (deploys, config, traffic)?
  • [Question]

1.3 Scope

In scopeOut of scope
Example: All production and staging services on [platform]Developer laptops
Example: Managed databases and queues via provider metricsBusiness analytics events (see analytics spec)
[Item][Item]

2. Architecture and telemetry pipeline

Services emit telemetry with the OpenTelemetry SDK through the OTLP protocol to a local collector, which processes, scrubs and exports it to the storage backends.

ComponentTechnologyVersionOwnerNotes
SDKExample: OpenTelemetry SDK for [language][x.y]Each service teamAuto plus manual instrumentation
CollectorExample: OpenTelemetry Collector[x.y]Platform teamAgent per node, gateway per region
Log backend[Product][x.y]Platform team[Notes]
Metrics backend[Product][x.y]Platform team[Notes]
Trace backend[Product][x.y]Platform team[Notes]

3. Signal standards

SignalUse it forDo not use it forRequired for every service
MetricsAggregated rates, ratios, latency distributions, saturation; alertingPer-request detail, high-cardinality IDsRED metrics for every entry point; USE metrics for every resource
TracesFollowing one request across services; latency breakdownLong-term trend analysisServer and client spans for every network call
LogsDiscrete events with context: errors, state changes, auditCounting things that should be metricsStructured JSON per 5.1, correlated by trace ID
[Profiles / events][Use][Not for][Requirement]

All three signals carry the same resource attributes (4.2) so that a metric spike can be followed to traces and then to logs.

4. Naming and semantic conventions

4.1 General rules

  • Attribute and metric names are lowercase, dot-separated namespaces: http.request.method, db.system.
  • Custom attributes use the organisation namespace: [org].[domain].[name], for example acme.order.channel.
  • Units follow UCUM-style abbreviations in metric metadata (s, By, {request}), not in the name.
  • Durations are recorded in seconds as floating point.
  • Never put unbounded values (user IDs, URLs with IDs, error messages) into metric attributes.

4.2 Required resource attributes

AttributeExamplePurpose
service.namecheckout-apiIdentifies the service
service.version2026.10.3Correlates with deploys
service.namespacecommerceGroups services by domain
deployment.environment.nameproductionSeparates environments
cloud.regioneu-west-1Locates failures by region
k8s.pod.name or host.namecheckout-api-7d9fFinds the instance
[Attribute][Example][Purpose]

4.3 Custom attributes register

AttributeTypeAllowed valuesSignalsCardinalityOwner
acme.order.channelstringweb, ios, android, partnermetrics, traces, logs4[@team]
acme.tenant.tierstringfree, pro, enterprisemetrics, traces3[@team]
[name][type][values][signals][n][@team]

5. Logs

5.1 Log schema

FieldTypeRequiredDescriptionExample
timestampRFC 3339 string, UTCYesTime the event occurred2026-10-21T09:14:03.512Z
severity_textstringYesOne of DEBUG, INFO, WARN, ERROR, FATALERROR
bodystringYesHuman-readable message without variable data where possiblepayment authorisation failed
trace_idhex stringWhen in a requestCorrelates with traces4bf92f3577b34da6a3ce929d0e0e4736
span_idhex stringWhen in a requestCorrelates with the span00f067aa0ba902b7
service.namestringYesFrom resource attributescheckout-api
event.namestringFor domain eventsStable event identifierpayment.authorisation.failed
error.typestringOn errorsError class or codecard_declined
attributesobjectNoAdditional context per 4.3{"acme.order.channel":"web"}
[field][type][Yes / No][Description][Example]

5.2 Severity guidelines

LevelUse whenPages anyone?
DEBUGDetail useful only during development; disabled in production by defaultNo
INFONormal state changes: started, configuration loaded, job completedNo
WARNUnexpected but handled: retry succeeded, fallback usedNo
ERRORA request or job failed and the caller saw a failureOnly via metric-based alerts
FATALThe process cannot continueVia health checks

5.3 Logging rules

  • Log once per failure at the boundary that handles it, not at every layer.
  • Do not log request or response bodies by default.
  • Sample high-volume INFO logs at the collector when volume exceeds [n] lines per second per service.

6. Metrics

6.1 Method

  • RED for request-driven components: Rate, Errors, Duration.
  • USE for resources: Utilisation, Saturation, Errors.

6.2 Metrics catalogue

Metric nameInstrumentUnitAttributesMethodDescriptionOwner
http.server.request.durationHistogramshttp.request.method, http.route, http.response.status_codeRED (rate, errors, duration)Server request latency; count gives rateService team
http.client.request.durationHistogramsserver.address, http.response.status_codeREDOutbound call latencyService team
db.client.operation.durationHistogramsdb.system, db.operation.nameREDDatabase call latencyService team
process.cpu.utilizationGauge1process.cpu.stateUSECPU utilisation per processPlatform
acme.queue.depthGauge{message}messaging.destination.nameUSE (saturation)Messages waiting[@team]
acme.orders.placedCounter{order}acme.order.channelBusinessOrders successfully placed[@team]
[name][Counter / Histogram / Gauge / UpDownCounter][unit][attributes][RED / USE / Business][Description][@team]

6.3 Histogram buckets

[Define standard bucket boundaries or use exponential histograms. Example: latency buckets 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10 seconds.]

6.4 Cardinality budget

The number of time series per metric is the product of distinct values of its attributes:

Nseries=∏i=1k∣Vi∣N_{\text{series}} = \prod_{i=1}^{k} |V_i|

Example: 5 methods x 40 routes x 12 status codes x 11 buckets x 30 pods gives about 792,000 series. Remove the pod attribute from histograms and aggregate at the collector to bring it under the budget of [n] series per service.

7. Traces

7.1 Instrumentation

BoundarySpan kindInstrumentationRequired attributes
Incoming HTTP / gRPCSERVERAutohttp.route, http.response.status_code
Outgoing HTTP / gRPCCLIENTAutoserver.address, http.response.status_code
Database callsCLIENTAutodb.system, db.operation.name (no full statements with values)
Message publish / consumePRODUCER / CONSUMERManual or librarymessaging.system, messaging.destination.name
Significant internal workINTERNALManualBusiness attributes from 4.3

7.2 Context propagation

[State the propagation format and where it is applied. Example: "W3C Trace Context (traceparent, tracestate) on all HTTP and gRPC calls; W3C Baggage only for acme.tenant.tier; trace context copied into message headers for queues; batch jobs start a new trace and link to the triggering trace."]

The sequence below shows propagation across a synchronous call and an asynchronous queue.

7.3 Sampling

RuleWhereRateRationale
Head sampling, parent-basedSDK10% of root tracesBounded overhead
Keep all errorsCollector tail sampling100%Errors are rare and valuable
Keep slow tracesCollector tail sampling100% above p99 latency thresholdLatency investigation
[Rule][Where][Rate][Rationale]

Effective sampled volume:

Vstored=V×(phead+(1−phead)×ptail)V_{\text{stored}} = V \times \left( p_{\text{head}} + (1 - p_{\text{head}}) \times p_{\text{tail}} \right)

where ptailp_{\text{tail}} is the share of unsampled traces kept by tail rules.

8. Dashboards

DashboardAudienceRequired panelsOwnerLink
Service overview (one per service)On-callRate, error ratio, p50/p95/p99 latency, saturation, SLO burn, deploy markersService team[Link]
Dependency viewOn-callOutbound call latency and errors per dependencyService team[Link]
Platform healthSRECluster utilisation, collector health, queue depthPlatform[Link]
Business KPIsProductOrders, sign-ups, conversionProduct analytics[Link]
[Dashboard][Audience][Panels][@team][Link]

Dashboards are stored as code in [repository path] and reviewed like any other change.

9. SLIs and SLOs

SLO IDSLIMetric query (summary)ObjectiveWindowError budget
SLO-CHK-01Availability of POST /ordersNon-5xx count divided by total count from http.server.request.duration99.9%28 days40.3 min
SLO-CHK-02Latency of POST /ordersShare of requests under 500 ms99%28 days1% of requests
[SLO-ID][SLI][Query][%][Window][Budget]

Burn rate, used by alerts in section 10:

burn rate=observed error ratio1−SLO\text{burn rate} = \frac{\text{observed error ratio}}{1 - \text{SLO}}

A burn rate of 14.4 sustained for one hour consumes 2% of a 30-day budget.

10. Alerting

10.1 Severity levels

SeverityMeaningNotificationResponse
SEV1 / pageUsers affected now or budget burning fastPage primary on-callAcknowledge within 5 min
SEV2 / ticketDegradation or slow burnTicket and chatNext working hours
InfoAwareness onlyChat channelNone required

10.2 Alert rules

IDAlertConditionForSeverityRoutingRunbook
AL-01Example: Checkout fast burnBurn rate > 14.4 over 1 h and > 14.4 over 5 min2 minPagecheckout on-call[Runbook link]
AL-02Example: Checkout slow burnBurn rate > 1 over 3 days and > 1 over 6 h1 hTicketcheckout team queue[Runbook link]
AL-03Example: Queue saturationacme.queue.depth > 50,00010 minPagefulfilment on-call[Runbook link]
AL-04Example: Collector dropping dataExporter failures > 1%15 minTicketplatform team[Runbook link]
[AL-nn][Alert][Condition][Duration][Severity][Route][Link]

10.3 Alert hygiene

  • Review alert volume monthly; any alert that fired without action is tuned or removed.
  • Silence windows require an owner and expiry.
  • Target: fewer than [2] pages per on-call shift on average.

11. Privacy and security

IDRuleEnforcement pointVerification
PR-01Never record passwords, tokens, keys or session cookiesSDK and collector redaction processorAutomated scan of sampled logs weekly
PR-02Email addresses, phone numbers and card numbers are maskedCollector pattern-based scrubberUnit tests on scrubber rules
PR-03User identifiers are pseudonymised (enduser.pseudo_id)SDK helperCode review checklist
PR-04Query strings are dropped from url.fullCollector attribute processorSample inspection
PR-05Telemetry access is role-based and loggedBackend access controlQuarterly access review
[PR-nn][Rule][Where][How checked]

Data subject requests: [describe how telemetry is handled for deletion requests, for example "retention below 30 days for logs containing pseudonymous IDs, so data expires within the response deadline"].

12. Retention and cost

SignalHot retentionArchive retentionVolume per dayUnit costMonthly cost
LogsExample: 14 days90 days compressed400 GB[Amount per GB][Amount]
MetricsExample: 30 days raw, 13 months downsampledn/a2 M active series[Amount per series][Amount]
TracesExample: 7 daysNone150 GB[Amount per GB][Amount]
[Signal][Days][Days][Volume][Cost][Amount]

Monthly cost estimate per signal:

C=Vday×30×cingest+Vstored×cstorageC = V_{\text{day}} \times 30 \times c_{\text{ingest}} + V_{\text{stored}} \times c_{\text{storage}}

Cost controls: [list sampling, log level defaults, attribute limits and budget alerts that keep spend within OG-03].

13. Ownership and governance

AreaOwnerResponsibilities
Telemetry pipeline and backendsPlatform teamAvailability, scaling, upgrades, scrubbing processors
Service instrumentationEach service teamRED metrics, spans, logs per this spec; dashboards and alerts
Semantic conventions register (4.3)Observability guildReview new attributes and metric names
Privacy rules (11)Security / privacyApprove rules, audit compliance
[Area][@team][Responsibilities]

Changes to this specification follow [process, for example "pull request to the observability repository with review from two guild members"]. A new service is production-ready only when it passes the checklist in appendix 14.1.

14. Appendices

14.1 Service onboarding checklist

  • Resource attributes in 4.2 set and verified in each backend.
  • RED metrics exported for every entry point.
  • Trace context propagated on all inbound and outbound calls.
  • Logs follow schema 5.1 and include trace_id.
  • Service overview dashboard created from the standard template.
  • At least one SLO defined and burn-rate alerts configured with runbooks.
  • Privacy rules in section 11 verified by a sample review.

14.2 Glossary

TermMeaning
OTLPOpenTelemetry Protocol for transporting telemetry
ResourceThe entity producing telemetry, described by attributes
SpanOne timed operation within a trace
REDRate, Errors, Duration
USEUtilisation, Saturation, Errors
Burn rateSpeed at which an error budget is consumed relative to the SLO

14.3 References

ReferenceUse
OpenTelemetry specification and semantic conventions (opentelemetry.io)Signals, attribute names, propagation
W3C Trace Context RecommendationPropagation headers
[Internal SLO document]Objectives in section 9

Standard and licence note

Based on OpenTelemetry concepts (signals, resources, semantic conventions, context propagation and sampling) and on common SRE practice for RED and USE metrics and burn-rate alerting. Attribute names shown follow the public OpenTelemetry semantic conventions; check the current version for changes. This template is original text written for this collection and reproduces no text from the specification. Template licence: MIT.

Related templates