Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-instrumentation support for Deno #3613

Open
lucacasonato opened this issue Jan 14, 2025 · 1 comment · May be fixed by #3615
Open

Add auto-instrumentation support for Deno #3613

lucacasonato opened this issue Jan 14, 2025 · 1 comment · May be fixed by #3615
Labels
enhancement New feature or request needs triage

Comments

@lucacasonato
Copy link

lucacasonato commented Jan 14, 2025

Component(s)

auto-instrumentation

Is your feature request related to a problem? Please describe.

Deno, a modern JavaScript and TypeScript runtime, version 2.1.5 and later, ships with OpenTelemetry support out of the box enabled by setting OTEL_DENO=true. Setting this env var will enable auto-instrumentation of various components of Deno (Deno.serve http server, fetch http client, and more), OTLP exporting for metrics, logs, and traces, and automatic exporting of telemetry created through the JS @opentelemetry/api package from NPM: https://docs.deno.com/runtime/fundamentals/open_telemetry/

Right now it is possible to use OpenTelemetry operator with Deno, by using instrumentation.opentelemetry.io/inject-sdk: "true" and manually setting OTEL_DENO=1 as an env var. This is however not as nice as some other auto-instrumentation, where one just has to set, for example, instrumentation.opentelemetry.io/inject-nginx: "true".

Describe the solution you'd like

Add support for instrumentation.opentelemetry.io/inject-deno: "true", which would be behaviourally equivalent to instrumentation.opentelemetry.io/inject-sdk: "true" and setting OTEL_DENO=true as an env var.

Unlike most (all) other auto-instrumentation, a separate container (image) with auto-instrumentation payload is unneeded, because Deno comes with auto-instrumentation out of the box.

Describe alternatives you've considered

No response

Additional context

Support for OTEL is currently unstable in Deno, and requires that the user pass --unstable-otel when starting to enable. We expect this feature to be stabilized within the next three months.

I will open a PR with the code needed to support this, disabled by default (ie one needs to pass --enable-deno-instrumentation).

@lucacasonato lucacasonato added enhancement New feature or request needs triage labels Jan 14, 2025
@lucacasonato lucacasonato linked a pull request Jan 15, 2025 that will close this issue
@swiatekm
Copy link
Contributor

What is the benefit of involving the operator here? Auto-instrumentation is valuable, because it provides a simple way to instrument applications which don't include an Otel SDK. For Deno, it sounds like there's first-party Otel support available, so most of the benefit is not present. Is what you're looking for just the environment variables the operator injects into the application container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants