Documentation

SDKs

Semantic Conventions

The attributes Monocle reads to build its dashboards, for anyone writing an instrumentation or an SDK

Monocle stores standard OpenTelemetry data: any span, log, or metric you send is kept and searchable. The dashboards, however, need to know what a span represents. Is it an HTTP request? A SQL query? A job? To answer, Monocle relies on attribute names.

Most of them are the official OpenTelemetry semantic conventions. Where OpenTelemetry has no convention yet, for example cache operations, emails, or CLI commands, Monocle defines its own. This page lists them all, dashboard by dashboard.

You only need this page to write your own instrumentation, an SDK for another language, or to debug a dashboard that stays empty. The Monocle SDKs and instrumentations already emit everything listed here.

How spans are classified

Each span gets a type from the first rule it matches:

OrderRuleTypeDashboard
1Span kind SERVER with http.request.methodHTTP requestRequests
2Span kind CLIENT with db.system.nameDatabase queryQueries
3Span kind CLIENT with http.request.methodExternal callExternal Calls
4Has cache.operationCache operationCache
5Has mcp.method.nameMCP callMCP Monitoring
6Has messaging.systemJobJobs
7entry_point.type is cliCommandCommands
8Has gen_ai.operation.nameAI operationAI Agents

The span kind matters: a database client span with the INTERNAL kind won't appear in Queries.

Service segments

A segment is the part of a trace that runs in one service. Its first span carries the context of the request, job, or command: the route, the user, the command name. Exceptions, queries, and AI calls take their context from the segment of their own service, not from the root of the trace.

A span starts a segment when it is the root of the trace, or when its parent ran in another process. Monocle reads the second case from the OTLP span flags. CLIENT and PRODUCER spans never start a segment. Without span flags, SERVER and CONSUMER spans start a segment. See Trace across services.

Legacy attribute names

Many instrumentations still emit older names. Monocle renames them on ingestion, so both work. When both are present, the new name wins.

LegacyCurrent
http.methodhttp.request.method
http.status_codehttp.response.status_code
http.targeturl.path
http.urlurl.full
net.peer.nameserver.address
net.peer.portserver.port
db.systemdb.system.name
db.statementdb.query.text
db.operationdb.operation.name
db.sql.tabledb.collection.name
db.namedb.namespace

Resource attributes

AttributeUsed for
service.nameThe service. With a DSN, Monocle replaces it with the name of the DSN's service.
service.versionThe release. A new value on entry spans records a deployment. Also shown on each issue occurrence.
vcs.ref.head.revisionThe full commit SHA. Links a semver release to its commit, so a deployment declared with commitSha finds it.
vcs.repository.url.fullThe repository URL, such as https://github.com/acme/shop. Turns commits into links in the deployment panel.
deployment.idThe deployment ID of your platform. Stored with the telemetry.
service.instance.idRequired for an instance to appear in System Metrics
host.nameDisplay

Monocle ignores the placeholder versions 0.0.0, 0.0.1, 1.0.0, unknown, dev, and latest. Monocle agents set these attributes for you, and add monocle.service.version.source to say where the version came from.

The environment is not read from deployment.environment.name: it comes from the x-monocle-env header. See Any OpenTelemetry SDK.

HTTP requests

Spec: HTTP spans

AttributeRequiredUsed for
Span kind SERVERYesTelling incoming requests from outgoing calls
http.request.methodYesDetecting a request
http.routeRecommendedGrouping by endpoint (/users/:id). Without it, requests are grouped by path.
url.pathNoFallback when there is no route
http.response.status_codeNo2xx, 4xx, and 5xx breakdown, error rates
http.connection_typeNosse or websocket excludes long-lived connections from latency stats
monocle.http.request.body, monocle.http.response.bodyNoThe HTTP Body tab of a span (body capture)

Database queries

Spec: Database spans

AttributeRequiredUsed for
Span kind CLIENTYesDetecting a query
db.system.nameYesDetecting a query, database selector
db.query.textNoQuery pattern. Falls back to the span name.
db.operation.nameNoOperation column (SELECT, INSERT…)
db.collection.nameNoTable
db.namespaceNoDatabase name

Send parameterized SQL (WHERE id = $1) in db.query.text so that queries group well. Redis commands are not listed in Queries.

External calls

Spec: HTTP client spans

AttributeRequiredUsed for
Span kind CLIENTYesDetecting an outgoing call
http.request.methodYesDetecting an outgoing call
server.addressRecommendedGrouping by domain, and detecting calls to your own services
url.templateNoURL pattern (/orders/{id})
url.fullNoURL pattern when there is no template, IDs replaced
http.response.status_codeNoErrors, for statuses of 400 and above

Exceptions and issues

Spec: Exceptions on spans

The simplest way is to record exceptions on spans with span.recordException(error). Monocle turns every span event named exception into an exception, and copies the span's user.* attributes onto it.

AttributeRequiredUsed for
exception.typeYesTitle and grouping
exception.messageNoMessage and grouping
exception.stacktraceNoStack trace and grouping

Monocle-specific attributes add more context:

AttributeUsed for
monocle.exception.framesSource code around each frame, as JSON
monocle.exception.cause_chainThe Error.cause chain
monocle.exception.valuesStructured exceptions, for AggregateError and causes
monocle.exception.should_reportfalse drops the exception
monocle.message.levelLevel of captured messages (info, warning, error…)
monocle.tag.*, monocle.extra.*Tags and extra data shown on the exception

You can also send exceptions as log records with the exception.* attributes and monocle.log.source=exception_reporter.

Logs

Spec: Logs data model

Any log record is accepted. Monocle reads the body, the trace and span IDs, and the severity text (INFO, WARN, ERROR…), which drives levels and counters. All attributes are searchable.

Users

Spec: User attributes

AttributeRequiredUsed for
user.idYesIdentifying the user, on SERVER spans
user.emailNoDisplay
user.nameNoDisplay, takes priority over the email

enduser.id is not read.

Jobs

Spec: Messaging spans

AttributeRequiredUsed for
messaging.systemYesDetecting a job (bullmq, boringqueue…)
messaging.operation.typeYessend or create for dispatches, process for executions
messaging.job.nameRecommendedGrouping by job. Monocle-specific.
messaging.destination.nameNoQueue name
messaging.message.idNoJob ID
messaging.message.retry.countNoRetries
messaging.job.queue_time_msNoTime spent waiting in the queue. Monocle-specific.

Link the execution span to the dispatch span with a span link to connect both traces. See Jobs.

Cache

OpenTelemetry has no cache conventions; these attributes are Monocle's.

AttributeRequiredUsed for
cache.operationYesDetecting a cache operation (get, set, getOrSet…)
cache.keyNoPer-key table
cache.hitNotrue or false, for hit rates on get and getOrSet
cache.storeNoStore name

Emails

OpenTelemetry has no email conventions; these attributes are Monocle's. Spans use the CLIENT kind.

AttributeRequiredUsed for
email.systemYesMust be adonisjs-mail
email.operationYesMust be send
email.transportNoTransport column
email.message.subjectNoSubject
email.message.fromNoSender
email.message.toNoRecipients, as a JSON array
email.recipient_countNoNumber of recipients
email.message.idNoMessage ID

CLI commands

These attributes are Monocle's. They go on the root span of the command.

AttributeRequiredUsed for
entry_point.typeYesMust be cli
cli.command.nameYesGrouping by command
cli.command.descriptionNoDisplay
cli.args.*, cli.flags.*NoArguments of each execution

AI

Spec: GenAI spans

AttributeRequiredUsed for
gen_ai.operation.nameYeschat, execute_tool, invoke_agent…
gen_ai.request.model, gen_ai.response.modelRecommendedModels table and cost
gen_ai.usage.input_tokens, gen_ai.usage.output_tokensRecommendedToken usage and cost
gen_ai.usage.input_tokens.cachedNoCached tokens
gen_ai.tool.nameNoTools table
gen_ai.conversation.idNoConversations tab
gen_ai.input.messages, gen_ai.response.textNoPrompt and response previews

Monocle computes the cost from the model and token counts. Evaluation scores are read from span events named gen_ai.evaluation.result, with gen_ai.evaluation.name and gen_ai.evaluation.score.value.

MCP

Spec: MCP

AttributeRequiredUsed for
mcp.method.nameYesDetecting an MCP call
mcp.tool.nameNoTools table
mcp.client.name, mcp.client.versionNoClients table
mcp.tool.result.is_errorNoErrors

System metrics

Specs: Process metrics, Node.js runtime metrics

System Metrics reads process.cpu.utilization (with process.cpu.state), process.memory.usage, v8js.memory.heap.used, v8js.memory.heap.limit, nodejs.eventloop.utilization, and nodejs.eventloop.delay.p99. Every other metric appears in the Metrics explorer.

Reserved attributes

Monocle sets monocle.* attributes itself on ingestion, such as the organization, project, environment, and service IDs. Values sent by your application for these keys are overwritten. Apart from monocle.http.*, monocle.tag.*, and monocle.extra.*, monocle.* attributes are hidden in the dashboard.

Search documentation

Search pages and sections of the Monocle documentation