Docs · OpenTelemetry

Monitoring

OpenTelemetry

Bugzor accepts OpenTelemetry traces and logs over OTLP/HTTP, next to the errors, logs and traces your Sentry SDKs send. OpenTelemetry data shows up on the same Traces and Logs pages, is linked to your issues, and is readable by AI agents through the MCP server. Use the standard OpenTelemetry exporters: there is nothing Bugzor-specific to install.

What you need#

  • A project in Bugzor. Its public key is the part of the DSN before the @ (for example https://0123456789abcdef0123456789abcdef@www.bugzor.com/42 → 0123456789abcdef0123456789abcdef). Copy it under Settings → Projects & keys; one key sends to one project, and each service’s service.name tells senders apart inside it.
  • A plan that includes OpenTelemetry (below).
  • An exporter set to http/protobuf (JSON works too). OTLP over gRPC is not available yet.

Endpoint and key#

SettingValue
Endpointhttps://otlp.bugzor.com (the SDK adds /v1/traces and /v1/logs itself)
Protocolhttp/protobuf (or http/json)
Keythe project’s public key, as the header x-bugzor-key (or Authorization: Bearer <key>)

The same settings work for every language, as environment variables:

Terminal
export OTEL_SERVICE_NAME=checkout
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.bugzor.com
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS=x-bugzor-key=<public-key>
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=production,service.version=1.4.2
export OTEL_METRICS_EXPORTER=none   # metrics are not stored yet

service.version becomes the release and deployment.environment.name the environment on traces, logs and issues.

Python#

Terminal
pip install opentelemetry-distro opentelemetry-exporter-otlp-proto-http
opentelemetry-bootstrap -a install     # installs the instrumentation for the libraries you use

Run your app through the OpenTelemetry launcher, with the environment variables above (plus OTEL_LOGS_EXPORTER=otlp and OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true to send logs):

Terminal
opentelemetry-instrument python app.py

Without the launcher, set up the exporter in code:

Python
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter

provider = TracerProvider()  # the OTEL_* variables above configure the resource
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))  # endpoint and key come from the variables
trace.set_tracer_provider(provider)

Node.js#

Terminal
npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
JavaScript
// instrumentation.js
const { NodeSDK } = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');

new NodeSDK({ instrumentations: [getNodeAutoInstrumentations()] }).start();
Terminal
node --require ./instrumentation.js app.js

The exporter reads the OTEL_EXPORTER_OTLP_* variables above. To send logs, add a logger provider with the OTLP log exporter as the OpenTelemetry JavaScript documentation describes: Bugzor receives them at /v1/logs like any OTLP logs.

Go#

Terminal
go get go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
Go
import (
    "context"

    "go.opentelemetry.io/otel"
    "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
    sdktrace "go.opentelemetry.io/otel/sdk/trace"
)

func initTracing(ctx context.Context) (func(context.Context) error, error) {
    exporter, err := otlptracehttp.New(ctx) // reads OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS
    if err != nil {
        return nil, err
    }
    provider := sdktrace.NewTracerProvider(sdktrace.WithBatcher(exporter)) // OTEL_SERVICE_NAME names the service
    otel.SetTracerProvider(provider)
    return provider.Shutdown, nil
}

Call the returned function when the program exits so the last batch is sent.

Java#

Use the OpenTelemetry Java agent: no code changes.

Terminal
curl -L -O https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
java -javaagent:opentelemetry-javaagent.jar -jar app.jar

With the environment variables above set, the agent sends traces, and logs once OTEL_LOGS_EXPORTER=otlp is set. Spring Boot, Quarkus, Micronaut and plain servlet apps are instrumented automatically.

Check that it works#

Terminal
curl -i -X POST https://otlp.bugzor.com/v1/traces \
  -H 'x-bugzor-key: <public-key>' -H 'content-type: application/json' \
  -d '{"resourceSpans":[]}'

200 with {} means it works. 401 means the key is wrong; 403 means the plan does not include OpenTelemetry (or the key is disabled). Then run your service and open Traces in Bugzor.

Plans, storage and retention#

OpenTelemetry is part of the plans below. Logs and traces from OpenTelemetry and from Sentry SDKs share your plan’s storage and are kept for the plan’s retention; both are shown under Settings → Billing & usage, with what fills the storage (traces, span events and links, logs).

PlanOpenTelemetryStorage for logs and tracesKept for
LeafNot included--
LongNeckIncluded5 GB30 days
ZillaIncluded20 GB90 days

Without OpenTelemetry in the plan, requests are answered 403 with a message that names the plan; your Sentry SDK data is not affected. When storage is full, new logs and traces (OpenTelemetry included) are refused until older data expires or you change plan; Bugzor accepts the request and reports what it dropped in the response, so exporters do not retry. Billing contacts get an email at 80% and when it is full.

Storage fills fast at high volume: OpenTelemetry services often emit hundreds of spans a second. Sample before you send, for example OTEL_TRACES_SAMPLER=parentbased_traceidratio with OTEL_TRACES_SAMPLER_ARG=0.1 keeps one trace in ten. Limits and notification thresholds are also described in Rate limits & quotas.

What Bugzor stores#

  • Spans with their service, kind (server, client, producer, consumer, internal), status, timing and attributes; the service’s entry spans are your transactions. Span events (including exception events) and links are kept with the trace.
  • Logs with severity, body, trace and span ids, and attributes.
  • Attributes keep their type: a number stays a number, a boolean a boolean, so agents and filters see status_code: 200, not "200". Resource attributes appear as resource.* and the instrumentation scope as scope.*.
  • Metrics are not stored yet. Set OTEL_METRICS_EXPORTER=none; metric requests are answered with a note that they are not supported.

Before anything is stored, Bugzor redacts the values of attributes whose names look like credentials (authorization, cookie, password, secret, token, API keys), the values in URL query strings, and the literals in SQL statements (WHERE id = ?). Keep other sensitive data out of attributes at the source. Records are limited to 128 attributes, keys to 128 bytes and values to 8 KiB.

Exceptions as issues#

Exceptions recorded on spans (the exception event) and error logs with exception.* attributes can become issues, grouped and linked to their trace like errors from a Sentry SDK. It is off by default; owners and admins turn it on per project under Settings → Projects & keys → (project) → OpenTelemetry exceptions:

  • Unhandled exceptions and failed spans: exceptions that escaped their span or ended a failed span, and error logs with an exception.
  • Every exception: handled ones too.

Stack traces are read for Python, Java, Node.js, Go, Ruby and .NET; other formats are kept as text and group by type and message. These issues count as errors against the project’s monthly error quota, at most 100 are created from one request, and the same failure in one trace becomes one event.

Limits and responses#

LimitValue
Request size4 MB as sent (compressed), 32 MB after decompression; send gzip
Ratea byte budget per project; above it, 429 with Retry-After, which exporters retry
Wrong key401; disabled key or suspended workspace: 403
Not in the plan403 naming the plan
Storage full, or an unsupported signal (metrics)200 with partial_success and the number rejected
Malformed request400 (not retried)

Exporters batch for you; the defaults of the OpenTelemetry SDKs (a few hundred spans per request) fit well within these limits.

Something unclear or out of date? Tell us.