-
Notifications
You must be signed in to change notification settings - Fork 369
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
undefined method `traces' for #<Datadog::Transport::HTTP::Client ... when using SyncWriter #903
Comments
Thanks for the report! I think #904 should fix this; feel free to try it out. |
Hello! I've been testing this, and I'm not sure if it actually fixes the problem, or maybe it just introduces another issue.
Unfortunately, it looks like when I'm running my specs it still tries to make calls via the Net::HTTP adapter and not the Test one. I think following line is the reason for this: I think the problem here is more in my code, rather than in yours - I'm using both custom writer and transport adapter, but maybe it would make sense to make those things mutually exclusive? Or like raise an error of you pass both, since |
Actually, it looks like |
I don't know if people actually want to be able to pass a custom writer object or they just want to be able to pick from sync and async writers, if the latter is the case, mb it would make sense to use a symbol / class name to distinguish between the two, and keep the initialization logic in one place ( |
Yeah I think these are good suggestions: we want to minimize configuration whenever possible, so we've been looking at ways to implement some designs to our components that will help us improve on this e.g. #879 In the mean time, there's a couple of ways to configure Datadog.configure do |config|
config.tracer(
writer: Datadog::SyncWriter.new(
transport: Datadog::Transport::HTTP.default { |t| t.adapter :test, [] }
)
)
end Or Datadog.configure do |config|
config.tracer(
writer: Datadog::SyncWriter.new(
transport_options: { on_build: proc { |t| t.adapter(:test, []) } }
)
)
end Both should work, but I'm working on plans that will hopefully make this less complicated in the near future. |
Merged to |
Dope, thanks! 🚂🎺👍
…On Tue, Jan 7, 2020 at 2:23 PM David Elner ***@***.***> wrote:
Merged to master to be released with 0.31.0.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#903?email_source=notifications&email_token=AABZGPODRVZVKDCU5J5246LQ4TJERA5CNFSM4KBRBMBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIJ7HDA#issuecomment-571732876>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABZGPMXTVUAT4HMLRFTXFDQ4TJERANCNFSM4KBRBMBA>
.
--
Yuriy Naidyon
|
Hello folks. I'm seeing the following error when trying to use SyncWriter in my specs:
I think it was broken around here: 46b685b#diff-34a63124ba72d0f43c54ea1cb77f78e5
The text was updated successfully, but these errors were encountered: