A lightweight Magento module that simplifies OpenTelemetry integration and provides a business-oriented telemetry API.
Rather than working directly with spans, tracers and exporters throughout the application, developers can work with higher-level concepts:
- Activity
- Operation
- Success / Failure
- Structured Attributes
The module exports telemetry using OpenTelemetry and can be visualised using Jaeger, Grafana, Tempo or any OTLP-compatible backend.
OpenTelemetry provides a powerful low-level API based on tracers, spans and exporters. This module introduces a simpler business-oriented abstraction based on Activities and Operations, allowing Magento developers to instrument business workflows without needing detailed OpenTelemetry knowledge.
- OpenTelemetry integration for Magento
- Simple Activity API
- Operation lifecycle tracking
- Success and failure reporting
- OTLP exporter support
- Jaeger compatible
- Lightweight dependency injection integration
- Framework-agnostic telemetry concepts
composer require reactedge/opentelemetry
composer require open-telemetry/opentelemetry
composer require \
open-telemetry/api \
open-telemetry/sdk \
open-telemetry/exporter-otlpExample:
<default>
<reactedge_telemetry>
<general>
<enabled>1</enabled>
<service_name>magento-store</service_name>
<collector_endpoint>http://otel-collector:4318/v1/traces</collector_endpoint>
</general>
</reactedge_telemetry>
</default>$operation = $activity->startOperation(
'product.search',
[
'search.term' => $searchTerm
]
);
try {
// business logic
$activity->endOperation(
$operation,
[
'result.count' => $count
]
);
} catch (\Throwable $e) {
$activity->failOperation(
$operation,
[
'exception.message' => $e->getMessage()
]
);
}An Activity represents a source of telemetry events.
An Operation represents a unit of work with a beginning and an end.
Example:
$operation = $activity->startOperation('checkout');and later:
$activity->endOperation($operation);The module exports OpenTelemetry spans through OTLP.
A common local setup is:
Magento ↓ OpenTelemetry Collector ↓ Jaeger
Once configured, traces can be inspected using the Jaeger UI.
Business Logic
│
▼
Activity
│
▼
Operation
│
▼
OpenTelemetry SDK
│
▼
OTLP Exporter
│
▼
OpenTelemetry Collector
│
▼
Jaeger / Grafana / Tempo