splunk-otel 0.2.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +27 -15
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -0
- data/Appraisals +11 -0
- data/CHANGELOG.md +13 -0
- data/README.md +5 -5
- data/docker-compose.yml +1 -1
- data/docs/instrumenting-rails.md +40 -1
- data/examples/basic/docker-compose.yml +1 -1
- data/examples/rails-7-barebones/Dockerfile +5 -2
- data/examples/rails-7-barebones/docker-compose.yml +1 -1
- data/examples/sinatra_example/.gitignore +8 -0
- data/examples/sinatra_example/.rubocop.yml +13 -0
- data/examples/sinatra_example/CHANGELOG.md +5 -0
- data/examples/sinatra_example/CODE_OF_CONDUCT.md +84 -0
- data/examples/sinatra_example/Gemfile +19 -0
- data/examples/sinatra_example/README.md +34 -0
- data/examples/sinatra_example/Rakefile +16 -0
- data/examples/sinatra_example/config.ru +14 -0
- data/examples/sinatra_example/docker-compose.yml +11 -0
- data/examples/sinatra_example/lib/sinatra_example/version.rb +5 -0
- data/examples/sinatra_example/lib/sinatra_example.rb +25 -0
- data/examples/sinatra_example/sinatra_example.gemspec +23 -0
- data/lib/splunk/otel/version.rb +1 -1
- data/lib/splunk/otel.rb +1 -1
- data/scripts/install-release-deps.sh +9 -1
- data/splunk-otel.gemspec +18 -14
- metadata +118 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6549c18607d6e48e41c326820885cdbcf5ed1503ccfa28f10b90b63695608a78
|
4
|
+
data.tar.gz: 6a1a4884c1b09a07cc36348b9d59537972abd9c4024dbc6b1ae13199bb91091c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db4051858076eadc6dcb3cdd6e279dbf80a239a22699f8ad5590694ed1b079c0bc70c579fc3a839c346fa00ceda56b58e6263757a1f9bd516cb938836fc511e8
|
7
|
+
data.tar.gz: f483859be56aa11350c2744e256c918396b0de8bd2ad31311918d889c1f0c86eae5afa69bcd5a995e88ee348a117c6a14c654e9afac1d5bba7d387925157bdde
|
data/.github/workflows/main.yml
CHANGED
@@ -8,33 +8,45 @@ on:
|
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
|
-
runs-on: ubuntu-
|
11
|
+
runs-on: ubuntu-20.04
|
12
12
|
|
13
13
|
strategy:
|
14
14
|
matrix:
|
15
|
-
|
15
|
+
rubygems: [
|
16
|
+
{ ruby: "3.2", appraisal: "rails-7.0" },
|
17
|
+
{ ruby: "3.1", appraisal: "rails-7.0" },
|
18
|
+
{ ruby: "3.0", appraisal: "rails-7.0" },
|
19
|
+
{ ruby: "2.7", appraisal: "rails-7.0" },
|
20
|
+
{ ruby: "2.7", appraisal: "rails-6.1" },
|
21
|
+
{ ruby: "2.6", appraisal: "rails-6.1" }
|
22
|
+
]
|
16
23
|
|
17
24
|
steps:
|
18
|
-
- uses: actions/checkout@v3
|
25
|
+
- uses: actions/checkout@v3.0.2
|
19
26
|
|
20
27
|
- name: Run Collector
|
21
28
|
run: docker-compose up -d
|
22
29
|
|
23
|
-
- name: Set up Ruby ${{ matrix.ruby
|
24
|
-
uses: ruby/setup-ruby@v1
|
30
|
+
- name: Set up Ruby ${{ matrix.rubygems.ruby }}
|
31
|
+
uses: ruby/setup-ruby@v1.134.0
|
25
32
|
with:
|
26
|
-
ruby-version: ${{ matrix.ruby
|
27
|
-
bundler-cache: true
|
33
|
+
ruby-version: ${{ matrix.rubygems.ruby }}
|
28
34
|
- name: Apply RubyGems fixes
|
29
35
|
run: gem update --system
|
36
|
+
- name: Ensure we have modern bundler
|
37
|
+
run: gem install bundler -v '~> 2.3.26'
|
30
38
|
- name: Install dependencies
|
31
|
-
run: bundle
|
39
|
+
run: bundle _2.3.26_
|
40
|
+
- name: Verify nokogiri
|
41
|
+
run: bundle exec nokogiri -v
|
42
|
+
- name: Install appraisal dependencies
|
43
|
+
run: bundle exec appraisal install
|
32
44
|
- name: Rubocop
|
33
45
|
run: bundle exec rubocop
|
34
46
|
- name: Run tests
|
35
|
-
run: bundle exec rake test
|
47
|
+
run: bundle exec appraisal ${{ matrix.rubygems.appraisal }} rake test
|
36
48
|
- name: Upload coverage to Codecov
|
37
|
-
uses: codecov/codecov-action@v3
|
49
|
+
uses: codecov/codecov-action@v3.1.1
|
38
50
|
- name: Run basic example e2e test
|
39
51
|
run: ruby console.rb
|
40
52
|
working-directory: ./examples/basic/
|
@@ -42,18 +54,18 @@ jobs:
|
|
42
54
|
TEST: true
|
43
55
|
|
44
56
|
test-e2e-rails-7-barebones:
|
45
|
-
runs-on: ubuntu-
|
57
|
+
runs-on: ubuntu-20.04
|
46
58
|
steps:
|
47
|
-
- uses: actions/checkout@v3
|
59
|
+
- uses: actions/checkout@v3.0.2
|
48
60
|
- name: Run e2e tests via Docker
|
49
61
|
working-directory: ./examples/rails-7-barebones
|
50
62
|
run: docker-compose up --build --exit-code-from tester
|
51
63
|
|
52
64
|
linkChecker:
|
53
|
-
runs-on: ubuntu-
|
65
|
+
runs-on: ubuntu-20.04
|
54
66
|
steps:
|
55
|
-
- uses: actions/checkout@v3
|
67
|
+
- uses: actions/checkout@v3.0.2
|
56
68
|
- name: Link Checker
|
57
|
-
uses: lycheeverse/lychee-action@v1.5.
|
69
|
+
uses: lycheeverse/lychee-action@v1.5.1
|
58
70
|
with:
|
59
71
|
fail: true
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,19 @@ and this repository adheres to [Semantic Versioning](https://semver.org/spec/v2.
|
|
7
7
|
|
8
8
|
## Unreleased
|
9
9
|
|
10
|
+
## v1.0.0 - 2022-09-29
|
11
|
+
|
12
|
+
## v0.3.0 - 2022-09-28
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- [Update opentelemetry-exporter-otlp requirement from ~> 0.21.0 to >= 0.21, <
|
17
|
+
0.25](https://github.com/signalfx/splunk-otel-ruby/pull/60)
|
18
|
+
- [Update opentelemetry-propagator-b3 requirement from ~> 0.19.2 to >= 0.19.2, <
|
19
|
+
0.21.0](https://github.com/signalfx/splunk-otel-ruby/pull/35)
|
20
|
+
- [Update opentelemetry-exporter-jaeger requirement from ~> 0.20.1 to >= 0.20.1,
|
21
|
+
< 0 .23.0](https://github.com/signalfx/splunk-otel-ruby/pull/61)
|
22
|
+
|
10
23
|
## v0.2.0 - 2022-09-06
|
11
24
|
|
12
25
|
### Added
|
data/README.md
CHANGED
@@ -43,13 +43,13 @@ This Splunk distribution comes with the following defaults:
|
|
43
43
|
Install the gem by adding it to your project's `Gemfile`:
|
44
44
|
|
45
45
|
``` ruby
|
46
|
-
gem "splunk-otel", "~> 0
|
46
|
+
gem "splunk-otel", "~> 1.0"
|
47
47
|
```
|
48
48
|
|
49
49
|
or
|
50
50
|
|
51
51
|
```shell
|
52
|
-
bundle add splunk-otel --version "~> 0
|
52
|
+
bundle add splunk-otel --version "~> 1.0"
|
53
53
|
```
|
54
54
|
|
55
55
|
Configure OpenTelemetry using the `Splunk::Otel` module from `splunk/otel`:
|
@@ -119,7 +119,7 @@ the
|
|
119
119
|
gem in your Gemfile:
|
120
120
|
|
121
121
|
``` ruby
|
122
|
-
gem "opentelemetry-instrumentation-all", "~> 0.
|
122
|
+
gem "opentelemetry-instrumentation-all", "~> 0.27"
|
123
123
|
```
|
124
124
|
|
125
125
|
Enable the instrumentations from the gem by passing `auto_instrument:true` to
|
@@ -185,7 +185,7 @@ the project's `Gemfile`. For example, to install the
|
|
185
185
|
instrumentation:
|
186
186
|
|
187
187
|
```
|
188
|
-
gem "opentelemetry-instrumentation-sinatra", "~> 0.
|
188
|
+
gem "opentelemetry-instrumentation-sinatra", "~> 0.21"
|
189
189
|
```
|
190
190
|
|
191
191
|
In a block passed to `Splunk::Otel.configure` configure the SDK to use
|
@@ -254,7 +254,7 @@ For troubleshooting information, see the [Troubleshooting](docs/troubleshooting.
|
|
254
254
|
|
255
255
|
# License
|
256
256
|
|
257
|
-
The Splunk OpenTelemetry Ruby distribution is
|
257
|
+
The Splunk OpenTelemetry Ruby distribution is licensed under the terms of the
|
258
258
|
Apache Software License version 2.0. For more details, see [the license
|
259
259
|
file](./LICENSE).
|
260
260
|
|
data/docker-compose.yml
CHANGED
data/docs/instrumenting-rails.md
CHANGED
@@ -1,6 +1,45 @@
|
|
1
1
|
# Instrumenting Rails
|
2
2
|
|
3
|
-
|
3
|
+
Install the instrumentation library by adding it to your project's `Gemfile`:
|
4
|
+
|
5
|
+
``` ruby
|
6
|
+
gem "opentelemetry-instrumentation-rails", "~> 0.24"
|
7
|
+
```
|
8
|
+
|
9
|
+
or install the gem using `bundle`:
|
10
|
+
|
11
|
+
```shell
|
12
|
+
bundle add opentelemetry-instrumentation-rails --version "~> 0.24"
|
13
|
+
```
|
14
|
+
|
15
|
+
Configure OpenTelemetry to use all available instrumentation libraries by adding the
|
16
|
+
`Splunk::Otel` module from `splunk/otel` and `use_all()` method to a Rails initializer:
|
17
|
+
|
18
|
+
``` ruby
|
19
|
+
# config/initializers/opentelemetry.rb
|
20
|
+
require "splunk/otel"
|
21
|
+
...
|
22
|
+
Splunk::Otel.configure do |c|
|
23
|
+
c.use_all()
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
You can disable individual components' instrumentation as options to
|
28
|
+
`use_all`. For example to disable Active Record instrumentation:
|
29
|
+
|
30
|
+
``` ruby
|
31
|
+
Splunk::Otel.configure do |c|
|
32
|
+
c.use_all({ 'OpenTelemetry::Instrumentation::ActiveRecord' => { enabled: false } })
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
To enable only Rails, you can use an individual `c.use`:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
Splunk::Otel.configure do |c|
|
40
|
+
c.use 'OpenTelemetry::Instrumentation::Rails'
|
41
|
+
end
|
42
|
+
```
|
4
43
|
|
5
44
|
## Example
|
6
45
|
|
@@ -1,5 +1,8 @@
|
|
1
|
-
FROM ruby:3-buster
|
2
|
-
RUN apt-get update -qq
|
1
|
+
FROM ruby:3.1.2-buster
|
2
|
+
RUN apt-get update -qq
|
3
|
+
RUN apt-get install -y \
|
4
|
+
nodejs="10.24.0~dfsg-1~deb10u2" \
|
5
|
+
netcat=1.10-41.1
|
3
6
|
|
4
7
|
# ruby comes with older versions of bundler sometimes
|
5
8
|
RUN gem install bundler -v "2.3.14"
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at tsloughter+work@splunk.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in sinatra_example.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "test-unit", "~> 3.0"
|
11
|
+
|
12
|
+
gem "rubocop", "~> 1.7"
|
13
|
+
|
14
|
+
gem "opentelemetry-instrumentation-pg"
|
15
|
+
gem "opentelemetry-instrumentation-sinatra"
|
16
|
+
gem "pg"
|
17
|
+
gem "puma"
|
18
|
+
gem "sinatra", "~> 3.0"
|
19
|
+
gem "splunk-otel"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Sinatra and PG Example
|
2
|
+
|
3
|
+
This example contains a Sinatra webapp that connects to and queries a Postgres
|
4
|
+
database (see the `docker-compose.yml` file for running the database).
|
5
|
+
|
6
|
+
Sinatra and PG are instrumented through OpenTelemetry libraries enabled in
|
7
|
+
`config.ru`:
|
8
|
+
|
9
|
+
``` ruby
|
10
|
+
OpenTelemetry::SDK.configure do |c|
|
11
|
+
c.use 'OpenTelemetry::Instrumentation::Sinatra'
|
12
|
+
c.use 'OpenTelemetry::Instrumentation::PG'
|
13
|
+
end
|
14
|
+
```
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
By default the spans are output to the console but this can be overriden by
|
19
|
+
setting the environment varirable `OTEL_TRACES_EXPORTER`.
|
20
|
+
|
21
|
+
``` shell
|
22
|
+
$ docker-compose up -d
|
23
|
+
|
24
|
+
$ bundle install
|
25
|
+
|
26
|
+
$ bundle exec rackup
|
27
|
+
```
|
28
|
+
|
29
|
+
From a separate shell:
|
30
|
+
|
31
|
+
``` shell
|
32
|
+
$ curl 0.0.0.0:9292
|
33
|
+
query result is [["1", "2", "3"]]
|
34
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "rubocop/rake_task"
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: %i[test rubocop]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "bundler/setup"
|
5
|
+
|
6
|
+
Bundler.require
|
7
|
+
ENV["OTEL_TRACES_EXPORTER"] ||= "console"
|
8
|
+
OpenTelemetry::SDK.configure do |c|
|
9
|
+
c.use "OpenTelemetry::Instrumentation::Sinatra"
|
10
|
+
c.use "OpenTelemetry::Instrumentation::PG"
|
11
|
+
end
|
12
|
+
|
13
|
+
require "./lib/sinatra_example"
|
14
|
+
run SinatraExample::App
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "sinatra_example/version"
|
4
|
+
require "sinatra"
|
5
|
+
require "splunk/otel"
|
6
|
+
|
7
|
+
module SinatraExample
|
8
|
+
class Error < StandardError; end
|
9
|
+
|
10
|
+
# Sinatra example app with postgres query
|
11
|
+
class App < Sinatra::Base
|
12
|
+
set :bind, "0.0.0.0"
|
13
|
+
|
14
|
+
get "/" do
|
15
|
+
conn = PG::Connection.open(host: "localhost",
|
16
|
+
port: "5432",
|
17
|
+
user: "test",
|
18
|
+
dbname: "test",
|
19
|
+
password: "password")
|
20
|
+
r = conn.exec("SELECT 1, 2, 3").values
|
21
|
+
|
22
|
+
"query result is #{r}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/sinatra_example/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "sinatra_example"
|
7
|
+
spec.version = SinatraExample::VERSION
|
8
|
+
spec.authors = ["Tristan Sloughter"]
|
9
|
+
spec.email = ["tsloughter+work@splunk.com"]
|
10
|
+
|
11
|
+
spec.summary = "Example instrumented sinatra app"
|
12
|
+
spec.description = "Example instrumented sinatra app"
|
13
|
+
spec.required_ruby_version = ">= 2.6.0"
|
14
|
+
|
15
|
+
# Specify which files should be added to the gem when it is released.
|
16
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
end
|
data/lib/splunk/otel/version.rb
CHANGED
data/lib/splunk/otel.rb
CHANGED
@@ -124,7 +124,7 @@ module Splunk
|
|
124
124
|
# add the access token header if the env variable is set
|
125
125
|
def set_access_token_header
|
126
126
|
splunk_access_token = ENV.fetch("SPLUNK_ACCESS_TOKEN", nil)
|
127
|
-
return if splunk_access_token.
|
127
|
+
return if splunk_access_token.to_s.empty?
|
128
128
|
|
129
129
|
access_header = "x-sf-token=#{splunk_access_token}"
|
130
130
|
headers = ENV.fetch("OTEL_EXPORTER_OTLP_HEADERS", nil)
|
@@ -2,9 +2,17 @@
|
|
2
2
|
|
3
3
|
set -e
|
4
4
|
|
5
|
+
# ensure certs, curl and gpg are available before running them to setup the github repo
|
6
|
+
apt-get update
|
7
|
+
apt-get -y install \
|
8
|
+
ca-certificates="20210119" \
|
9
|
+
curl="7.74.0-1.3+deb11u3" \
|
10
|
+
gnupg="2.2.27-2+deb11u2" \
|
11
|
+
lsb-release="11.1.0" \
|
12
|
+
|
5
13
|
# instructions from https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-apt
|
6
14
|
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
|
7
15
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
8
16
|
|
9
17
|
apt-get update
|
10
|
-
apt-get -y install
|
18
|
+
apt-get -y install gh="2.16.1"
|
data/splunk-otel.gemspec
CHANGED
@@ -26,25 +26,29 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
28
|
spec.add_dependency "opentelemetry-api", "~> 1.0"
|
29
|
-
spec.add_dependency "opentelemetry-exporter-jaeger", "
|
30
|
-
spec.add_dependency "opentelemetry-exporter-otlp", "
|
31
|
-
spec.add_dependency "opentelemetry-instrumentation-base", "~> 0.21
|
32
|
-
spec.add_dependency "opentelemetry-propagator-b3", "
|
29
|
+
spec.add_dependency "opentelemetry-exporter-jaeger", ">= 0.20.1", "< 0.23.0"
|
30
|
+
spec.add_dependency "opentelemetry-exporter-otlp", ">= 0.21", "< 0.25"
|
31
|
+
spec.add_dependency "opentelemetry-instrumentation-base", "~> 0.21"
|
32
|
+
spec.add_dependency "opentelemetry-propagator-b3", ">= 0.19.2", "< 0.21.0"
|
33
33
|
spec.add_dependency "opentelemetry-sdk", "~> 1.0"
|
34
34
|
|
35
|
-
# development
|
36
|
-
spec.add_development_dependency "
|
37
|
-
spec.add_development_dependency "
|
38
|
-
spec.add_development_dependency "
|
39
|
-
spec.add_development_dependency "rubocop
|
40
|
-
spec.add_development_dependency "
|
41
|
-
spec.add_development_dependency "
|
42
|
-
|
35
|
+
# development tooling
|
36
|
+
spec.add_development_dependency "appraisal", "2.4.1"
|
37
|
+
spec.add_development_dependency "bundler", "2.3.26"
|
38
|
+
spec.add_development_dependency "rake", "13.0.6"
|
39
|
+
spec.add_development_dependency "rubocop", "1.36.0"
|
40
|
+
spec.add_development_dependency "rubocop-rake", "0.6.0"
|
41
|
+
spec.add_development_dependency "simplecov", "0.21.2"
|
42
|
+
spec.add_development_dependency "simplecov-cobertura", "2.1.0"
|
43
|
+
spec.add_development_dependency "test-unit", "3.5.3"
|
44
|
+
spec.add_development_dependency "tzinfo-data", "1.2022.7"
|
45
|
+
|
46
|
+
# development dependencies for integration testing
|
43
47
|
spec.add_development_dependency "opentelemetry-instrumentation-action_pack", "~> 0.2.0"
|
44
|
-
spec.add_development_dependency "opentelemetry-instrumentation-rack", "~> 0.21"
|
48
|
+
spec.add_development_dependency "opentelemetry-instrumentation-rack", "~> 0.21.0"
|
45
49
|
spec.add_development_dependency "rack", "~> 2.2"
|
46
50
|
spec.add_development_dependency "rack-test", "~> 2.0"
|
47
|
-
spec.add_development_dependency "
|
51
|
+
spec.add_development_dependency "rails"
|
48
52
|
|
49
53
|
spec.metadata = {
|
50
54
|
"rubygems_mfa_required" => "true"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: splunk-otel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Splunk
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -28,58 +28,76 @@ dependencies:
|
|
28
28
|
name: opentelemetry-exporter-jaeger
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.20.1
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.23.0
|
34
37
|
type: :runtime
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
|
-
- - "
|
41
|
+
- - ">="
|
39
42
|
- !ruby/object:Gem::Version
|
40
43
|
version: 0.20.1
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.23.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: opentelemetry-exporter-otlp
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- - "
|
51
|
+
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.21
|
53
|
+
version: '0.21'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.25'
|
48
57
|
type: :runtime
|
49
58
|
prerelease: false
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
51
60
|
requirements:
|
52
|
-
- - "
|
61
|
+
- - ">="
|
53
62
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.21
|
63
|
+
version: '0.21'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0.25'
|
55
67
|
- !ruby/object:Gem::Dependency
|
56
68
|
name: opentelemetry-instrumentation-base
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
59
71
|
- - "~>"
|
60
72
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.21
|
73
|
+
version: '0.21'
|
62
74
|
type: :runtime
|
63
75
|
prerelease: false
|
64
76
|
version_requirements: !ruby/object:Gem::Requirement
|
65
77
|
requirements:
|
66
78
|
- - "~>"
|
67
79
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.21
|
80
|
+
version: '0.21'
|
69
81
|
- !ruby/object:Gem::Dependency
|
70
82
|
name: opentelemetry-propagator-b3
|
71
83
|
requirement: !ruby/object:Gem::Requirement
|
72
84
|
requirements:
|
73
|
-
- - "
|
85
|
+
- - ">="
|
74
86
|
- !ruby/object:Gem::Version
|
75
87
|
version: 0.19.2
|
88
|
+
- - "<"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.21.0
|
76
91
|
type: :runtime
|
77
92
|
prerelease: false
|
78
93
|
version_requirements: !ruby/object:Gem::Requirement
|
79
94
|
requirements:
|
80
|
-
- - "
|
95
|
+
- - ">="
|
81
96
|
- !ruby/object:Gem::Version
|
82
97
|
version: 0.19.2
|
98
|
+
- - "<"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 0.21.0
|
83
101
|
- !ruby/object:Gem::Dependency
|
84
102
|
name: opentelemetry-sdk
|
85
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,89 +113,131 @@ dependencies:
|
|
95
113
|
- !ruby/object:Gem::Version
|
96
114
|
version: '1.0'
|
97
115
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
116
|
+
name: appraisal
|
99
117
|
requirement: !ruby/object:Gem::Requirement
|
100
118
|
requirements:
|
101
|
-
- -
|
119
|
+
- - '='
|
102
120
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
121
|
+
version: 2.4.1
|
104
122
|
type: :development
|
105
123
|
prerelease: false
|
106
124
|
version_requirements: !ruby/object:Gem::Requirement
|
107
125
|
requirements:
|
108
|
-
- -
|
126
|
+
- - '='
|
109
127
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
128
|
+
version: 2.4.1
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: bundler
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - '='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 2.3.26
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - '='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 2.3.26
|
111
143
|
- !ruby/object:Gem::Dependency
|
112
144
|
name: rake
|
113
145
|
requirement: !ruby/object:Gem::Requirement
|
114
146
|
requirements:
|
115
|
-
- -
|
147
|
+
- - '='
|
116
148
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
149
|
+
version: 13.0.6
|
118
150
|
type: :development
|
119
151
|
prerelease: false
|
120
152
|
version_requirements: !ruby/object:Gem::Requirement
|
121
153
|
requirements:
|
122
|
-
- -
|
154
|
+
- - '='
|
123
155
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
156
|
+
version: 13.0.6
|
125
157
|
- !ruby/object:Gem::Dependency
|
126
158
|
name: rubocop
|
127
159
|
requirement: !ruby/object:Gem::Requirement
|
128
160
|
requirements:
|
129
|
-
- -
|
161
|
+
- - '='
|
130
162
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
163
|
+
version: 1.36.0
|
132
164
|
type: :development
|
133
165
|
prerelease: false
|
134
166
|
version_requirements: !ruby/object:Gem::Requirement
|
135
167
|
requirements:
|
136
|
-
- -
|
168
|
+
- - '='
|
137
169
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
170
|
+
version: 1.36.0
|
139
171
|
- !ruby/object:Gem::Dependency
|
140
172
|
name: rubocop-rake
|
141
173
|
requirement: !ruby/object:Gem::Requirement
|
142
174
|
requirements:
|
143
|
-
- -
|
175
|
+
- - '='
|
144
176
|
- !ruby/object:Gem::Version
|
145
177
|
version: 0.6.0
|
146
178
|
type: :development
|
147
179
|
prerelease: false
|
148
180
|
version_requirements: !ruby/object:Gem::Requirement
|
149
181
|
requirements:
|
150
|
-
- -
|
182
|
+
- - '='
|
151
183
|
- !ruby/object:Gem::Version
|
152
184
|
version: 0.6.0
|
153
185
|
- !ruby/object:Gem::Dependency
|
154
186
|
name: simplecov
|
155
187
|
requirement: !ruby/object:Gem::Requirement
|
156
188
|
requirements:
|
157
|
-
- -
|
189
|
+
- - '='
|
158
190
|
- !ruby/object:Gem::Version
|
159
191
|
version: 0.21.2
|
160
192
|
type: :development
|
161
193
|
prerelease: false
|
162
194
|
version_requirements: !ruby/object:Gem::Requirement
|
163
195
|
requirements:
|
164
|
-
- -
|
196
|
+
- - '='
|
165
197
|
- !ruby/object:Gem::Version
|
166
198
|
version: 0.21.2
|
199
|
+
- !ruby/object:Gem::Dependency
|
200
|
+
name: simplecov-cobertura
|
201
|
+
requirement: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - '='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: 2.1.0
|
206
|
+
type: :development
|
207
|
+
prerelease: false
|
208
|
+
version_requirements: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - '='
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: 2.1.0
|
167
213
|
- !ruby/object:Gem::Dependency
|
168
214
|
name: test-unit
|
169
215
|
requirement: !ruby/object:Gem::Requirement
|
170
216
|
requirements:
|
171
|
-
- -
|
217
|
+
- - '='
|
172
218
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
219
|
+
version: 3.5.3
|
174
220
|
type: :development
|
175
221
|
prerelease: false
|
176
222
|
version_requirements: !ruby/object:Gem::Requirement
|
177
223
|
requirements:
|
178
|
-
- -
|
224
|
+
- - '='
|
179
225
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
226
|
+
version: 3.5.3
|
227
|
+
- !ruby/object:Gem::Dependency
|
228
|
+
name: tzinfo-data
|
229
|
+
requirement: !ruby/object:Gem::Requirement
|
230
|
+
requirements:
|
231
|
+
- - '='
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: 1.2022.7
|
234
|
+
type: :development
|
235
|
+
prerelease: false
|
236
|
+
version_requirements: !ruby/object:Gem::Requirement
|
237
|
+
requirements:
|
238
|
+
- - '='
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: 1.2022.7
|
181
241
|
- !ruby/object:Gem::Dependency
|
182
242
|
name: opentelemetry-instrumentation-action_pack
|
183
243
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +258,14 @@ dependencies:
|
|
198
258
|
requirements:
|
199
259
|
- - "~>"
|
200
260
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
261
|
+
version: 0.21.0
|
202
262
|
type: :development
|
203
263
|
prerelease: false
|
204
264
|
version_requirements: !ruby/object:Gem::Requirement
|
205
265
|
requirements:
|
206
266
|
- - "~>"
|
207
267
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
268
|
+
version: 0.21.0
|
209
269
|
- !ruby/object:Gem::Dependency
|
210
270
|
name: rack
|
211
271
|
requirement: !ruby/object:Gem::Requirement
|
@@ -235,20 +295,20 @@ dependencies:
|
|
235
295
|
- !ruby/object:Gem::Version
|
236
296
|
version: '2.0'
|
237
297
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
298
|
+
name: rails
|
239
299
|
requirement: !ruby/object:Gem::Requirement
|
240
300
|
requirements:
|
241
|
-
- - "
|
301
|
+
- - ">="
|
242
302
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
303
|
+
version: '0'
|
244
304
|
type: :development
|
245
305
|
prerelease: false
|
246
306
|
version_requirements: !ruby/object:Gem::Requirement
|
247
307
|
requirements:
|
248
|
-
- - "
|
308
|
+
- - ">="
|
249
309
|
- !ruby/object:Gem::Version
|
250
|
-
version:
|
251
|
-
description:
|
310
|
+
version: '0'
|
311
|
+
description:
|
252
312
|
email:
|
253
313
|
- splunk-oss@splunk.com
|
254
314
|
executables: []
|
@@ -262,6 +322,7 @@ files:
|
|
262
322
|
- ".gitlab-ci.yml"
|
263
323
|
- ".lycheeignore"
|
264
324
|
- ".rubocop.yml"
|
325
|
+
- Appraisals
|
265
326
|
- CHANGELOG.md
|
266
327
|
- CODE_OF_CONDUCT.md
|
267
328
|
- CONTRIBUTING.md
|
@@ -293,6 +354,18 @@ files:
|
|
293
354
|
- examples/rails-7-barebones/docker-compose.yml
|
294
355
|
- examples/rails-7-barebones/tests-e2e/rails_7_barebones_test.rb
|
295
356
|
- examples/rails-7-barebones/wait-for.sh
|
357
|
+
- examples/sinatra_example/.gitignore
|
358
|
+
- examples/sinatra_example/.rubocop.yml
|
359
|
+
- examples/sinatra_example/CHANGELOG.md
|
360
|
+
- examples/sinatra_example/CODE_OF_CONDUCT.md
|
361
|
+
- examples/sinatra_example/Gemfile
|
362
|
+
- examples/sinatra_example/README.md
|
363
|
+
- examples/sinatra_example/Rakefile
|
364
|
+
- examples/sinatra_example/config.ru
|
365
|
+
- examples/sinatra_example/docker-compose.yml
|
366
|
+
- examples/sinatra_example/lib/sinatra_example.rb
|
367
|
+
- examples/sinatra_example/lib/sinatra_example/version.rb
|
368
|
+
- examples/sinatra_example/sinatra_example.gemspec
|
296
369
|
- examples/smart-agent/.gitignore
|
297
370
|
- examples/smart-agent/Gemfile
|
298
371
|
- examples/smart-agent/docker-compose.yml
|
@@ -316,7 +389,7 @@ homepage: https://github.com/signalfx/splunk-otel-ruby
|
|
316
389
|
licenses: []
|
317
390
|
metadata:
|
318
391
|
rubygems_mfa_required: 'true'
|
319
|
-
post_install_message:
|
392
|
+
post_install_message:
|
320
393
|
rdoc_options: []
|
321
394
|
require_paths:
|
322
395
|
- lib
|
@@ -331,8 +404,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
404
|
- !ruby/object:Gem::Version
|
332
405
|
version: '0'
|
333
406
|
requirements: []
|
334
|
-
rubygems_version: 3.
|
335
|
-
signing_key:
|
407
|
+
rubygems_version: 3.2.22
|
408
|
+
signing_key:
|
336
409
|
specification_version: 4
|
337
410
|
summary: Splunk OpenTelemetry Ruby distribution
|
338
411
|
test_files: []
|