We recently updated our dd-trace-rb to 0.35.1 and were using this configuration before
Datadog.configure do |c|
c.use :rails, service_name: Runtime.app_name,
distributed_tracing: true,
trace_agent_hostname: ENV.fetch('DD_AGENT_HOST', 'localhost'),
trace_agent_port: ENV.fetch('DD_TRACE_AGENT_PORT', 8126)
# sets env for APM services
c.tracer.set_tags(env: 'stage')
end
once we updated we found that set_tags was erroring since the method has been removed
After looking at the changelog for 0.34.0 we then updated our configuration to
Datadog.configure do |c|
c.use :rails, service_name: Runtime.app_name,
distributed_tracing: true,
trace_agent_hostname: ENV.fetch('DD_AGENT_HOST', 'localhost'),
trace_agent_port: ENV.fetch('DD_TRACE_AGENT_PORT', 8126)
# sets env for APM services
c.env = 'stage'
end
But this doesn't seem to work. All of our traces show up with env:none in datadog. Wondering if we misconfigured something or if this is simply a bug.
Please let me know if I can provide anything else to help. Thanks!
+1
Also seeing an issue since updating to 0.35.1 from 0.34.2.
We had the following configuration line
c.tracer tags: { "env" => ENV["STACK_NAME"] }
I'm trying multiple iterations to get env to stick.
c.env = ENV["STACK_NAME"]
wasn't working for me either.
@kelvin-acosta @mattmcf I was able to reproduce this issue. If you put c.env near the bottom of your file (after integrations are activated) it won't set properly. Workaround is to put it at the top of the Datadog.configure block.
We're working on a bugfix for this now.
Thanks @delner. I'll try that now.
@delner That also worked for me locally. I'll ship a fix for us. Thank you!
@kelvin-acosta Also for your configuration, trace_agent_hostname and trace_agent_port are invalid options, those should be configured on the tracer option instead. I'd recommend your configuration be:
Datadog.configure do |c|
c.service = Runtime.app_name
c.env = 'stage'
c.tracer.hostname = 'my-host'
c.tracer.port = 1234
c.use :rails
end
We identified a cause for this and have a bug fix #1034 in progress; will keep you posted.
@kelvin-acosta @mattmcf thank you again for this issue report!
We've just released 0.35.2, which includes a fix for this issue.
Please give it a try and let us know if the problem still persists.
Confirmed that this fixes my issue. Thank you for the prompt fix!
Most helpful comment
@kelvin-acosta Also for your configuration,
trace_agent_hostnameandtrace_agent_portare invalid options, those should be configured on the tracer option instead. I'd recommend your configuration be: