Skip to content

Commit 1cb5114

Browse files
committed
Simplify and avoid long parent spans
1 parent d06b8c2 commit 1cb5114

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

R/daemon.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ eval_mirai <- function(._mirai_.) {
223223
links = list(daemon = dmn_spn),
224224
options = list(kind = "server", parent = prtctx)
225225
)
226-
dmn_spn$add_event("eval start", attributes = list(span.id = spn$get_context()$get_span_id()))
227226
}
228227
eval(._mirai_.[["._expr_."]], envir = ._mirai_., enclos = .GlobalEnv)
229228
},

R/map.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,9 @@ mirai_map <- function(.x, .f, ..., .args = list(), .promise = NULL, .compute = N
159159
if (is.null(.compute)) .compute <- .[["cp"]]
160160

161161
if (otel_tracing) {
162-
active <- otel::get_active_span_context()$is_valid()
163162
spn <- otel::start_local_active_span(
164163
"mirai::mirai_map",
165-
links = if (active) list(compute_profile = ..[[.compute]][["otel_span"]]),
166-
options = if (!active) list(parent = ..[[.compute]][["otel_span"]])
164+
links = list(compute_profile = ..[[.compute]][["otel_span"]])
167165
)
168166
}
169167

R/mirai.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,10 @@ mirai <- function(.expr, ..., .args = list(), .timeout = NULL, .compute = NULL)
165165
) .expr else expr,
166166
._globals_. = globals,
167167
._otel_. = if (otel_tracing && length(envir)) {
168-
active <- otel::get_active_span_context()$is_valid()
169168
spn <- otel::start_local_active_span(
170169
"mirai::mirai",
171-
links = if (active) list(compute_profile = envir[["otel_span"]]),
172-
options = list(kind = "client", parent = if (!active) envir[["otel_span"]])
170+
links = list(compute_profile = envir[["otel_span"]]),
171+
options = list(kind = "client")
173172
)
174173
otel::pack_http_context()
175174
}

0 commit comments

Comments
 (0)