MCPcopy Create free account
hub / github.com/dagger/dagger / _initialize

Method _initialize

sdk/python/src/dagger/telemetry.py:190–212  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 os.environ.setdefault(insecure, "true")
189
190 def _initialize(self):
191 # NB: Dagger's engine only accepts Gauge metrics today (engine-side
192 # exec resource monitoring). Emitting counters/histograms from modules
193 # produces 500s and retry noise, so skip metric initialization by
194 # passing an empty list for the metrics slot of _import_exporters.
195 #
196 # Also skip OTel log exporting. Dagger already captures module
197 # stdout/stderr and forwards it as logs; installing OTel's logging
198 # handler would duplicate Python logging records in the TUI.
199 trace_exporters, _, _ = _import_exporters(
200 _get_exporter_names("traces"),
201 [],
202 [],
203 )
204 logger.debug(
205 "Initializing traces telemetry with exporters: %s",
206 ", ".join(trace_exporters) if trace_exporters else "none",
207 )
208 _init_tracing(trace_exporters)
209
210 # The logging instrumentor injects the trace context into logs without
211 # exporting them separately.
212 LoggingInstrumentor().instrument()

Callers 1

_configureMethod · 0.95

Calls 2

_init_tracingFunction · 0.85
debugMethod · 0.45

Tested by

no test coverage detected