| Mar | APR | May |
| 26 | ||
| 2020 | 2021 | 2022 |
COLLECTED BY
Collection: github.com
…try#725) * release: Release opentelemetry-instrumentation-pg 0.17.1 * Update CHANGELOG.md Co-authored-by: Daniel Azuma <dazuma@gmail.com> Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>f7f577d
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 beta for tracing.
The API and SDK packages are available on RubyGems.org, and can be installed via gem:
gem install opentelemetry-api gem install opentelemetry-sdkor via
Bundler by adding the following to your Gemfile:
gem 'opentelemetry-api' gem 'opentelemetry-sdk'followed by:
bundle installTo install development versions of these packages, follow the Docker Setup instructions.
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 endSee the API Documentation for more detail, and the opentelemetry examples for a complete example including context propagation.