{"id":15605308,"url":"https://github.com/iaintshine/ruby-method-tracer","last_synced_at":"2025-07-04T07:04:16.223Z","repository":{"id":56883484,"uuid":"100201181","full_name":"iaintshine/ruby-method-tracer","owner":"iaintshine","description":"OpenTracing instrumentation for Ruby methods","archived":false,"fork":false,"pushed_at":"2019-04-11T22:12:47.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T17:47:20.399Z","etag":null,"topics":["opentracing","ruby","tracing"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iaintshine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-13T19:54:14.000Z","updated_at":"2021-02-26T13:33:59.000Z","dependencies_parsed_at":"2022-08-20T13:10:39.562Z","dependency_job_id":null,"html_url":"https://github.com/iaintshine/ruby-method-tracer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/iaintshine/ruby-method-tracer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaintshine%2Fruby-method-tracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaintshine%2Fruby-method-tracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaintshine%2Fruby-method-tracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaintshine%2Fruby-method-tracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iaintshine","download_url":"https://codeload.github.com/iaintshine/ruby-method-tracer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iaintshine%2Fruby-method-tracer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263464185,"owners_count":23470473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opentracing","ruby","tracing"],"created_at":"2024-10-03T04:04:02.462Z","updated_at":"2025-07-04T07:04:16.197Z","avatar_url":"https://github.com/iaintshine.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/iaintshine/ruby-method-tracer.svg?branch=master)](https://travis-ci.org/iaintshine/ruby-method-tracer)\n\n# Method::Tracer\n\nThe gem provides OpenTracing instrumentation for custom Ruby methods.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'method-tracer'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install method-tracer\n\n## Usage\n\nFirst of all you need to initialize the gem using `Method::Tracer.configure` method. You need to supply an instance of a tracer, and an active span provider - a proc which returns a current active span. The gem plays nicely with [spanmanager](https://github.com/iaintshine/ruby-spanmanager). \n\n```ruby\nrequire 'spanmanager'\nrequire 'method-tracer'\n\nOpenTracing.global_tracer = SpanManager::Tracer.new(OpenTracing.global_tracer)\nMethod::Tracer.configure(tracer: OpenTracing.global_tracer,\n                        active_span: -\u003e { OpenTracing.global_tracer.active_span })\n```\n\nThe gem comes in two flavours. You can either use 'magic mode', and include `Method::Tracer` module and then use `trace_method` method, or skip the magic and use `Method::Tracer.trace` class method within your business code. See usage examples below: \n\n```ruby\nclass TracedClass\n  class \u003c\u003c self\n    def class_method\n    end\n\n    include Method::Tracer\n    trace_method :class_method\n  end\n\n  def instance_method\n    Method::Tracer.trace(\"inner span\") do |span|\n      # business code\n    end\n  end\n\n  include Method::Tracer\n  trace_method :instance_method\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/iaintshine/ruby-method-tracer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiaintshine%2Fruby-method-tracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiaintshine%2Fruby-method-tracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiaintshine%2Fruby-method-tracer/lists"}