opentelemetry_nova

March 13, 2026 · View on GitHub

OpenTelemetry instrumentation for the Nova web framework.

Automatic HTTP request tracing and metrics following the OTel HTTP semantic conventions.

Installation

Add to your dependencies in rebar.config:

{deps, [
    {opentelemetry_nova, "~> 0.1"}
]}.

Setup

Call setup/0 during application startup:

opentelemetry_nova:setup().

Or with Prometheus export:

opentelemetry_nova:setup(#{prometheus => #{port => 9464}}).

Span Attributes

Server spans are created for every HTTP request with the following attributes:

AttributeSource
http.request.methodRequest method
http.response.status_codeResponse status code
http.routeMatched route template (e.g. /users/:id)
url.pathRequest path
url.schemehttp or https
server.addressHost header
server.portServer port
client.addressX-Forwarded-For / Forwarded header, or peer IP
network.peer.addressPeer IP address
network.peer.portPeer port
network.protocol.versionHTTP version (1.0, 1.1, 2, 3)
user_agent.originalUser-Agent header
error.typeStatus code as string on 5xx errors
nova.appNova application name
nova.controllerController module
nova.actionAction function

Span names follow the {METHOD} {route} convention (e.g. GET /users/:id).

Metrics

MetricTypeAttributes
http.server.request.durationHistogram (seconds)method, scheme, host, port, status, route, error.type
http.server.active_requestsUpDown Countermethod, scheme, host, port
http.server.request.body.sizeHistogram (bytes)method, scheme, host, port, status, route, error.type
http.server.response.body.sizeHistogram (bytes)method, scheme, host, port, status, route, error.type

Components

  • otel_nova_stream_h — Cowboy stream handler for HTTP tracing and metrics
  • otel_nova_plugin — Nova plugin for span enrichment with route and controller info
  • otel_nova_prom_exporter — Prometheus exporter with delta-to-cumulative conversion
  • otel_nova_prom_server — HTTP server for Prometheus scraping

License

MIT