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

got a NullSpan? #72

Open
shuiiiiiimu opened this issue Sep 8, 2016 · 2 comments
Open

got a NullSpan? #72

shuiiiiiimu opened this issue Sep 8, 2016 · 2 comments

Comments

@shuiiiiiimu
Copy link

here are my code,

use ZipkinTracer::RackHandler, {
  :service_name => 'demo',
  :service_port => '80',
  :sample_rate => 1,
  :log_tracing => true,
  :json_api_host => "http://localhost:9411/"
}
def get_repositories(_request, _call)
    project_id, query = _request.project_id, _request.q

    ZipkinTracer::TraceClient.local_component_span('local relay') do |ztc|
      ztc.record "relay.get_repositories"
      ztc.record_tag 'project_id', project_id
      ztc.record_tag 'query', query

      p ztc.inspect

      "result"
    end
  end

but, got a NullSpan

"#<ZipkinTracer::NullSpan:0x007f8eeb928750>"

How to solve it?

@jcarres-mdsol
Copy link
Collaborator

Looks good to me. Maybe is a bug in the tracer. Let me take a look and come back to you later

@shuiiiiiimu
Copy link
Author

my app is base on sinatra framework

in app.rb ZipkinTracer::TraceClient.local_component_span that is ok, but not working inside the lib folder

Can provider a method like this?

def get_repositories(_request, _call)
  project_id, query = _request.project_id, _request.q

  ZipkinTracer::TraceClient.reconfig({
    :service_name => 'demo',
      :service_port => '80',
      :sample_rate => 1,
      :log_tracing => true,
      :json_api_host => "http://localhost:9411/"
  })

  ZipkinTracer::TraceClient.local_component_span('local relay') do |ztc|
    ztc.record "relay.get_repositories"
    ztc.record_tag 'project_id', project_id
    ztc.record_tag 'query', query

    p ztc.inspect

    "result"
  end
end

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

No branches or pull requests

2 participants