Skip to content

Add @netlify/otel affordances #363

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Add @netlify/otel affordances #363

wants to merge 6 commits into from

Conversation

chee
Copy link
Contributor

@chee chee commented Jul 18, 2025

Allow consumers to use things like this if they want:

Once we've found some common patterns we can come back and add them as defaults in here.

(Those things get us a LOT of info by default, before we've even started adding our own instrumentation direct to blobs etc.

)

The other things i've added are:

withActiveSpan(getTracer(), name, (span?) => {}) convenience function

a more ergonomic API than having to repeat yourself, writing the function in one place and then conditionally calling it inside or outside a loop depending on if you got a tracer. The callback gets Span|undefined as its arg.

@chee chee changed the title Allow consumer to specify instrumentations and span processors Add default http, fetch and undici instrumentations Jul 18, 2025
@chee chee force-pushed the otelmewhatyouwant branch from 2fa2eee to dbc5809 Compare July 18, 2025 11:35
Some default instrumentations are included:
- https://www.npmjs.com/package/@opentelemetry/instrumentation-http
- https://www.npmjs.com/package/@opentelemetry/instrumentation-fetch
- https://www.npmjs.com/package/@opentelemetry/instrumentation-undici

The http and undici instrumentations are in devDependencies because their
packages include non-esm code that made the serverless-functions-api repo
cry when i tried to use them there. lmk if there's a better way to go about
this
@chee chee force-pushed the otelmewhatyouwant branch from dbc5809 to c18a983 Compare July 18, 2025 11:44
@chee chee changed the title Add default http, fetch and undici instrumentations Add default http, net, fetch and undici instrumentations Jul 18, 2025
@chee chee changed the title Add default http, net, fetch and undici instrumentations Add @netlify/otel affordances Jul 18, 2025
@chee chee marked this pull request as ready for review July 22, 2025 12:27
@chee chee requested a review from a team as a code owner July 22, 2025 12:27
@chee chee marked this pull request as draft July 22, 2025 12:27
@chee chee marked this pull request as ready for review July 22, 2025 12:31
@chee chee force-pushed the otelmewhatyouwant branch from 9510070 to 974b534 Compare July 22, 2025 12:34
@chee chee marked this pull request as draft July 22, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant