Skip to content

open-telemetry/opentelemetry-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

github-actions[bot]dazumafbogsany
Sep 11, 2020
35cb892 · Sep 11, 2020
Sep 9, 2020
Sep 10, 2020
Sep 11, 2020
Aug 26, 2020
Sep 11, 2020
Sep 11, 2020
Sep 11, 2020
Sep 11, 2020
Sep 8, 2020
Sep 11, 2020
Aug 26, 2020
Sep 10, 2020
Jul 1, 2020
Nov 5, 2019
Apr 4, 2020
Sep 8, 2020
Sep 8, 2020
Sep 9, 2020

Repository files navigation

OpenTelemetry Ruby

Gitter chat CircleCI Apache License

The Ruby OpenTelemetry client.

Contributing

We'd love your help! Use tags good first issue and help wanted to get started with the project.

Please review the contribution instructions for important information on setting up your environment, running the tests, and opening pull requests.

The Ruby special interest group (SIG) meets regularly. See the OpenTelemetry community page repo for information on this and other language SIGs.

Approvers (@open-telemetry/ruby-approvers):

Find more about the approver role in community repository.

Maintainers (@open-telemetry/ruby-maintainers):

Find more about the maintainer role in community repository.

Installation

This repository includes multiple installable packages. The opentelemetry-api package includes abstract classes and no-op implementations that comprise the OpenTelemetry API following the specification. The opentelemetry-sdk package is the reference implementation of the API.

Libraries that produce telemetry data should only depend on opentelemetry-api, and defer the choice of the SDK to the application developer. Applications may depend on opentelemetry-sdk or another package that implements the API.

Please note that this library is currently in alpha, and shouldn't be used in production environments.

The API and SDK packages are available on RubyGems.org, and can be installed via gem:

gem install opentelemetry-api
gem install opentelemetry-sdk

or via Bundler by adding the following to your Gemfile:

gem 'opentelemetry-api'
gem 'opentelemetry-sdk'

followed by:

bundle install

To install development versions of these packages, follow the "Developer Setup" section (below).

Quick Start

require 'opentelemetry/sdk'

# Configure the sdk with default export and context propagation formats
# see SDK#configure for customizing the setup
OpenTelemetry::SDK.configure

# To start a trace you need to get a Tracer from the TracerProvider
tracer = OpenTelemetry.tracer_provider.tracer('my_app_or_gem', '0.1.0')

# create a span
tracer.in_span('foo') do |span|
  # set an attribute
  span.set_attribute('platform', 'osx')
  # add an event
  span.add_event('event in bar')
  # create bar as child of foo
  tracer.in_span('bar') do |child_span|
    # inspect the span
    pp child_span
  end
end

See the API Documentation for more detail, and the opentelemetry examples for a complete example including context propagation.

Release Schedule

OpenTelemetry Ruby is under active development. Below is the release schedule for the Ruby library. The first version of the release isn't guaranteed to conform to a specific version of the specification, and future releases will not attempt to maintain backward compatibility with the alpha release.

Component Version Target Date Release Date
Tracing API Alpha v0.4.0 April 16 2020
Tracing SDK Alpha v0.4.0 April 16 2020
Trace Context Propagation Alpha v0.4.0 April 16 2020
Jaeger Trace Exporter Alpha v0.4.0 April 16 2020
Baggage Propagation Alpha v0.4.0 April 16 2020
Metrics API Unknown Unknown Unknown
Metrics SDK Unknown Unknown Unknown
Prometheus Metrics Exporter Unknown Unknown Unknown
OpenTracing Bridge Unknown Unknown Unknown
Zipkin Trace Exporter Unknown Unknown Unknown
OpenCensus Bridge Unknown Unknown Unknown
Resource Auto-detection (GCP) Alpha v0.5.0 July 3 2020
Concurrent Ruby Instrumentation Alpha v0.4.0 April 16 2020
Ethon Instrumentation Alpha v0.4.0 April 16 2020
Excon Instrumentation Alpha v0.4.0 April 16 2020
Faraday Instrumentation Alpha v0.4.0 April 16 2020
MySQL2 Instrumentation Alpha v0.5.0 July 3 2020
Net::HTTP Instrumentation Alpha v0.4.0 April 16 2020
Rack Instrumentation Alpha v0.4.0 April 16 2020
Redis Instrumentation Alpha v0.4.0 April 16 2020
Restclient Instrumentation Alpha v0.4.0 April 16 2020
Sinatra Instrumentation Alpha v0.4.1 June 24 2020
Sidekiq Instrumentation Alpha v0.4.0 April 16 2020
All Instrumentation Convenience Alpha v0.4.1 June 24 2020

Useful links

License

Apache 2.0 - See LICENSE for more information.