October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

OpenTelemetry Tracing for Dagster Without Monkeypatching `@op` or `@asset`

Add OpenTelemetry spans to Dagster’s native ops and assets with an explicit decorator, and understand when the automatic launcher’s patching trade-off may suit instead.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use dagster-otel and add its @traced() decorator beneath Dagster’s @op or @asset. That explicit approach keeps Dagster’s native decorators and avoids monkeypatching Dagster internals. If you want tracing without changing definitions, a separate launcher package can instrument Dagster automatically, but it does so by patching the framework.

Choose explicit decorators or automatic launcher instrumentation

Approach What changes Dagster definitions Trade-off
dagster-otel Add @traced() to selected definitions and configure OpenTelemetry export. Keep @op and @asset; the project describes this route as avoiding monkeypatching. Opt-in control, but you must edit each definition you want traced. Project page.
opentelemetry-instrumentation-dagster Configure OpenTelemetry and prefix a Dagster command with opentelemetry-instrument. No changes to definitions, but the package patches Dagster to provide automatic coverage. Convenient for zero-code instrumentation, with the patching trade-off; PyPI classifies it as Alpha. Project page.

For the specific goal of adding tracing without patching Dagster or replacing its decorators, the explicit dagster-otel route is the closer fit.

As an Amazon Associate I earn from qualifying purchases.

Add tracing to an op or asset

Keep Dagster’s decorator outermost and put @traced() directly beneath it. This abbreviated example shows placement only; consult the current package README for decorator arguments and exporter configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from dagster import asset, op
from dagster_otel import traced

@op
@traced()
def upstream_op(context) -> int:
    ...

@asset
@traced()
def downstream_asset(context):
    ...

The outer Dagster decorator receives the function already wrapped by @traced(). You can choose which operations and assets to instrument rather than enabling framework-wide automatic patching.

The package author says the first traced step in a run becomes the run trace root and that trace context is propagated through Dagster’s run storage when steps execute in separate processes. These are maintainer-described behaviors; deployment and verification caveats are important, particularly for Kubernetes execution.

What the automatic launcher documents

The separate opentelemetry-instrumentation-dagster project documents a zero-code alternative for people who accept its patching approach. Its PyPI page lists version 0.2.0, released September 22, 2026, Python 3.10 or later, and Dagster 1.5 or later. It also says it is not independently version-matrix-tested beyond the coverage provided by dagster-otel. These are project-stated details, not an independent compatibility guarantee. Check the current package page before adopting it.

Basic setup

The documented quick start installs the launcher package, starts a local Jaeger instance, sets OTEL_SERVICE_NAME and OTEL_EXPORTER_OTLP_ENDPOINT, then runs a Dagster command through opentelemetry-instrument. The package says an endpoint (or traces-specific endpoint) is needed for an exporter to attach. It documents grpc as the default protocol and http/protobuf as another option; set OTEL_SDK_DISABLED=true to disable export. Follow its current quick-start instructions for the exact command and environment values.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Documented coverage and gaps

  • @op, @asset and @multi_asset: listed as covered, including bare and named forms of @op and @asset.
  • @asset_check: listed as covered when dagster-otel 0.4.0 or later is used. The project reports checking a real materialize() run, but says multiprocess and Kubernetes execution were not independently re-verified for this case.
  • @dbt_assets: covered through its use of multi_asset, with one span per dbt run. The project says end-to-end verification against a real dbt project remained outstanding.
  • @graph_asset: deliberately excluded because its decorated function does not receive a runtime context. The project recommends tracing the ops it composes to cover executed work.

Those coverage and verification statements come from the package maintainers. They should not be read as independent testing of every Dagster version or deployment configuration.

Account for how Dagster executes steps

Multiprocess execution

The launcher project says its instrumentation is inherited by fresh Python subprocesses under the multiprocess executor and reports verification in a real run. That is the launcher’s stated behavior, not a guarantee for every customized process environment.

Kubernetes job execution

With k8s_job_executor, each step runs in a separate pod, so prefixing a command in one shell does not by itself instrument new pods. The launcher project recommends baking instrumentation into the image; its example is copying OpenTelemetry’s sitecustomize.py into the environment’s site-packages. It reports verification on a real kind cluster. Treat both the guidance and verification as project-maintainer claims, and test the image and export path used in your deployment.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How this fits Dagster’s telemetry options

Dagster describes itself as a data orchestrator with integrated lineage and observability, and its documentation presents assets defined with @asset. A request for a built-in, globally available OpenTelemetry telemetry provider was opened on December 16, 2022 and remains open on the accessed issue page. That is the status of this particular feature request, not proof that Dagster has no other tracing capabilities or third-party integrations. View the Dagster issue.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A December 2025 community discussion shows another pattern: a resource constructs a SpanContext from the Dagster run ID and ops are wrapped in a tracing decorator. A later note describes a local check on Dagster 1.11.16 using a local span stub to check decorator forms and resource setup. It did not verify Logfire export or multiprocess trace propagation, so it is evidence about the mechanics, not an end-to-end production tracing design. Read the community discussion.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.