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

Blocklist configuration for http client plugin does not work #2208

Closed
Quramy opened this issue Jul 21, 2022 · 6 comments · Fixed by #2503
Closed

Blocklist configuration for http client plugin does not work #2208

Quramy opened this issue Jul 21, 2022 · 6 comments · Fixed by #2503
Labels
bug Something isn't working

Comments

@Quramy
Copy link

Quramy commented Jul 21, 2022

Expected behaviour

I read https://datadoghq.dev/dd-trace-js/interfaces/plugins.http.html#blocklist and it saids

List of URLs that should not be instrumented.

However, it seems that blocklist of http.client plugin implementation only effects whether to inject tracing headers or not. It seems that the plugin send span of an HTTP request matched in blocklist to agent.

const span = this.tracer.startSpan('http.request', {
childOf,
tags: {
'span.kind': 'client',
'service.name': getServiceName(this.tracer, this.config, options),
'resource.name': method,
'span.type': 'http',
'http.method': method,
'http.url': uri
}
})
if (!(hasAmazonSignature(options) || !this.config.propagationFilter(uri))) {
this.tracer.inject(span, HTTP_HEADERS, options.headers)
}

Is API document wrong ? 🤔

And I want to reject to instrument for some requests ( they can be detected via URL domain or path). Is there alternative way?

Actual behaviour

Steps to reproduce

Environment

  • Operation system:: Docker (based from node:16.14.2-buster)
  • Node.js version:: 16.14.2
  • Tracer version: : 2.11.0
  • Agent version:
  • Relevant library versions:
@Quramy Quramy added the bug Something isn't working label Jul 21, 2022
@rochdev
Copy link
Member

rochdev commented Jul 21, 2022

This was removed because of issues with the previous plugin system which has since been replaced. It should be possible to restore this feature at this point. I'll have to take a look at how to handle propagation of the sampling decision for these spans.

@Quramy Quramy changed the title Blocklist configuration for http client plugin Blocklist configuration for http client plugin does not work Jul 22, 2022
@clement-heliot
Copy link

This might be related: #2225

@rochdev
Copy link
Member

rochdev commented Jul 28, 2022

@clement-heliot Thanks for the additional context in #2225. It wasn't clear to me what the use case was for this was, although it seems pretty clear now that it's basically the same reason that we drop our own requests to avoid seeing observability related requests. The main concern was wether we should just drop the span itself, or also any other spans following from that span, but for this use case it's definitely the latter. We should be able to add this back now.

@Quramy
Copy link
Author

Quramy commented Jul 28, 2022

this use case it's definitely the latter.

👍

yes. I want to reject nested spans in an http-client span which matches the blocklist.

@dko-slapdash
Copy link

dko-slapdash commented Sep 22, 2022

@rochdev Just spent 1h or so with an interactive debugger trying to figure out, why blocklist is ignored, finally figured out, and then found this thread. :-) What was another confusion is that the feature is mentioned as functioning in the official docs: https://docs.datadoghq.com/tracing/guide/ignoring_apm_resources/?tab=datadogyaml#tracer-configuration-options

Would be super-cool to have this feature back. Thanks!

@Quramy
Copy link
Author

Quramy commented Nov 15, 2022

@rochdev Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants