Currently, commons::commons(log = TRUE) sets some environmental variables and then subsets into ellmer:::otel_cache_tracer() to refresh the OTel tracing code.
This makes local tracing a bit more convenient (but is likely not CRAN-compliant). I'm not that worried about the local case and am fine to remove all of that in favor of noting in the onboarding flow that users should set them and restart R.
Without us doing this log trickery, on Connect, these variables will mostly be set appropriately automatically. That said, the user would still need to set OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT in a .Rprofile and then restart R (so that ellmer:::otel_cache_tracer() runs on ellmer package load) in order to deploy their app with tracing enabled. This is more cumbersome than I'd like—it doesn't seem like you should have to edit your .Rprofile and restart your R session to do this—but I don't see a way to make this 'just work' for users other than setting that envvar ourselves and then re-running ellmer:::otel_cache_tracer(). Ideally, ellmer could give us some entry point to refresh that setup.
(In the short term, we do still need to do this hacky subsetting for the OTEL_RESOURCE_ATTRIBUTES hotfix #66, but we can remove that by the time 0.1.0 is released.)
Currently,
commons::commons(log = TRUE)sets some environmental variables and then subsets intoellmer:::otel_cache_tracer()to refresh the OTel tracing code.This makes local tracing a bit more convenient (but is likely not CRAN-compliant). I'm not that worried about the local case and am fine to remove all of that in favor of noting in the onboarding flow that users should set them and restart R.
Without us doing this
logtrickery, on Connect, these variables will mostly be set appropriately automatically. That said, the user would still need to setOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTin a.Rprofileand then restart R (so thatellmer:::otel_cache_tracer()runs on ellmer package load) in order to deploy their app with tracing enabled. This is more cumbersome than I'd like—it doesn't seem like you should have to edit your .Rprofile and restart your R session to do this—but I don't see a way to make this 'just work' for users other than setting that envvar ourselves and then re-runningellmer:::otel_cache_tracer(). Ideally, ellmer could give us some entry point to refresh that setup.(In the short term, we do still need to do this hacky subsetting for the OTEL_RESOURCE_ATTRIBUTES hotfix #66, but we can remove that by the time 0.1.0 is released.)