-
Notifications
You must be signed in to change notification settings - Fork 835
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
feat(http): allow to disable span without parent for outgoing requests #931
Comments
This is a topic the spec has been talking about recently actually. They want to create a context var that disables tracing and I have a nodejs prototype. Works like this: context.with(disableTracing(context.active()), () => {
// do something here with tracing disabled
}) does that cover your use case? |
Not really because the span are created by the |
Where are you suggesting this option? Are you trying to disable the http plugin entirely? I guess i'm not fully understanding the usecase here. |
I'm trying to disable the creation of new span for outgoing request when there are no context/no parent. That would require to add a check here like so: const currentSpan = plugin.tracer.getCurrentSpan()
if (plugin.options.disableOutgoingTraces && currentSpan === null) {
return original.apply(this, arguments)
} |
Ah I understand. i think |
I think it would make sense that each plugin has an |
Will open PRs for express and http tomorrow then :) |
It might make more sense to introduce this as a single PR that adds the option to all plugins with a per-plugin default value. e.g. express would default to not creating root spans, and http would default to creating them. |
Just realized that there is just a single http plugin, not one for server and one for client. Therefore I think a single setting is too limiting for the http plugin. |
Having a single plugin for client and server is, in my opinion, a mistake anyways. it may be too late to fix though |
Other plugins for outgoing requests like MongoDb requires always a parent (see https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-plugin-mongodb/src/mongodb.ts#L110). |
We can totally have one option for both, i will implement that. |
Spec discussion about disabling via context: open-telemetry/opentelemetry-specification#530 |
#948 has been merged, closing |
* feat: adding docker container id detector for supported version(cgroup v1) * some name changes and license update and refactor * some name changes and license update and refactor * removed test path for cgroup * changed readme to show updated detector name * fix lint error and package.json as per PR comments * adding detector to .release-please-manifest.json * removing trailing spaces in README.md and pinning a peer dependency * lint error fix * refactor(@opentelemetry-js-contrib): reverting release-please-manifest and refactor as per comments Signed-off-by: abhinav mathur <abhinama@cisco.com> * refactor(opentelemetry-contrib-js): adding eslintrc and ignore files Signed-off-by: abhinav mathur <abhinama@cisco.com> * refactor(opentelemetry-js-contrib): pr comments Signed-off-by: abhinav mathur <abhinama@cisco.com> * refactor(opentelemetry-js-contrib): adding detector to release config Signed-off-by: abhinav mathur <abhinama@cisco.com> * refactor(opentelemetry-js-contrib): pr comments refactor Signed-off-by: abhinav mathur <abhinama@cisco.com> * refactor(opentelemetry-js-contrib): pr comments tests refactor Signed-off-by: abhinav mathur <abhinama@cisco.com> * refactor(opentelemetry-js-contrib): making test robust and chaging warning to info Signed-off-by: abhinav mathur <abhinama@cisco.com> Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com> Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
I'm trying to setup tracing across my microservices (~10) and one is sending periodic request to internal GCP stuff.
I know i could ignore them one by one using the
ignoreOutgoingUrls
option but that would not really be future proof in case new code get added in the underlying library i'm using :/I can't use something like
ignoreOutgoingUrls: /.*/
because that would also disable spans created inside a trace.My request would be to add an option called
disableOutgoingTraces: true
that would just avoid creating a new span if none exist in the context. WDYT ?I'm happy to make the PR ofc
The text was updated successfully, but these errors were encountered: