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

Expose context methods for current trace and span #46

Merged
merged 3 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/honeycomb-beeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class << self
extend Forwardable
attr_reader :client

def_delegators :@client, :start_span, :add_field, :add_field_to_trace
def_delegators :@client, :start_span, :add_field, :add_field_to_trace,
:current_span, :current_trace
polotek marked this conversation as resolved.
Show resolved Hide resolved

def configure
Configuration.new.tap do |config|
Expand Down
5 changes: 5 additions & 0 deletions lib/honeycomb/client.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# frozen_string_literal: true

require "forwardable"
require "honeycomb/beeline/version"
require "honeycomb/configuration"
require "honeycomb/context"

module Honeycomb
# The Honeycomb Beeline client
class Client
extend Forwardable

def_delegators :@context, :current_span, :current_trace
polotek marked this conversation as resolved.
Show resolved Hide resolved

def initialize(configuration:)
@client = configuration.client
# attempt to set the user_agent_addition, this will only work if the
Expand Down