Maple telemetry conventions

From MapleTechLabs/maple · View interactive version

Maple telemetry conventions is an AI agent skill from the GitHub repository MapleTechLabs/maple. Maple's OpenTelemetry conventions: custom span attribute keys (`maple.*` vendor namespace, `query.context`, `db.query.*`, `result.*`, `cache.*`, `tenant.*`), Title Case status codes (`Ok`/`Error`/`Unset`), resource attribute dual-emit (`deployment.environment` + `deployment.environment.name`), span

How to use this skill

Skill file

Maple Telemetry Conventions

Reference for the language-agnostic OpenTelemetry conventions Maple uses across TypeScript (apps/api and the other Workers, via @maple-dev/effect-sdk in packages/effect-sdk/), Rust (apps/ingest), and any future Python service. These conventions are load-bearing. Tinybird materialized views pre-extract some attribute keys into columns, dashboards filter on Title Case status strings, and throughput math depends on the SampleRate column. Use the exact attribute spellings here in every language.

When to apply

Index

Quick reference

| Topic | Rule |

|---|---|

| Status codes | Always Title Case: "Ok", "Error", "Unset". Never OK, ERROR, SUCCESS, FAILED. |

| Vendor namespace | Custom attributes go under maple.*. Sub-namespaces include maple.ingest.*, maple.cloudflare.*, maple.query.*. |

| Standard semconv | Use OTel semconv keys verbatim: service.name, http.request.method, db.system.name, error.type. |

| Org identity | orgId (camelCase) in TypeScript spans, maple.org_id (dotted) in Rust spans. Don't unify until MVs migrate. |

| Deployment env | Emit deployment.environment.name (our SDKs dual-emit the deprecated deployment.environment too). Read both via DEPLOYMENT_ENV_SQL / deploymentEnvExpr, never a bare map lookup. |

| Warehouse SQL spans | Every WarehouseQueryService.executeSql span (a Client span) carries db.system.name, peer.service, db.query.text, db.query.fingerprint, db.duration_ms, result.rowCount, orgId, query.context, and query.profile when set. Legacy spans (pre 2026-06) use db.statement*/db.system; warehouse readers coalesce both. |

| Service map | Service-to-service edges come from joining a Client/Producer span to its child Server/Consumer span in another service, so propagate trace context and set span kinds. Database nodes need db.system.name (plus db.namespace) on a Client/Producer span. Runtime icon and platform badge need process.runtime.name, cloud.platform, maple.sdk.type on the resource. See rules/service-map-attribution.md. |

| Loop prevention | Never remove HttpMiddleware.TracerDisabledWhen (apps/api/src/http/api-observability.ts) or the ingest loopback guard (init_tracing in apps/ingest/src/main.rs). |

Canonical references (do not modify from this skill)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.