---
url: https://scruple.dev/rules/observability/require-operation-context.md
description: Require a stable operation identity in events.
---

# observability/require-operation-context

Require a stable operation identity in events.

## What it checks

Log and telemetry events should use a specific message or structured field to name the operation; IDs and status alone are insufficient.

## Rule metadata

* Package: `@scruple/observability`
* Category: Telemetry context
* Tags: logging, operations, structured-data
* Default threshold: `0.8`
* Minimum confidence: `0.7`

## Examples

### Reported

```ts
logger.info({ orderId, status });
```

### Accepted

```ts
logger.info({ operation: "order.submit", orderId, status });
```
