splunk-otel 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +17 -0
- data/.github/workflows/main.yml +28 -10
- data/.gitignore +3 -0
- data/.gitlab-ci.yml +13 -0
- data/.lycheeignore +2 -0
- data/.rubocop.yml +4 -0
- data/Appraisals +11 -0
- data/CHANGELOG.md +35 -0
- data/MIGRATING.md +110 -23
- data/README.md +85 -6
- data/docker-compose.yml +1 -1
- data/docs/advanced-config.md +38 -19
- 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/smart-agent/.gitignore +1 -0
- data/examples/smart-agent/Gemfile +6 -0
- data/examples/smart-agent/docker-compose.yml +8 -0
- data/examples/smart-agent/runner.rb +22 -0
- data/examples/smart-agent/smart-agent-config.yaml +5 -0
- data/lib/splunk/otel/instrumentation/rack/middleware.rb +5 -1
- data/lib/splunk/otel/proprietary_exporters.rb +54 -0
- data/lib/splunk/otel/version.rb +1 -1
- data/lib/splunk/otel.rb +45 -15
- data/scripts/install-release-deps.sh +9 -1
- data/splunk-otel.gemspec +15 -12
- metadata +90 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22ebfcc16e49baa0feef01f353c7c50ce65dc28774bb3ee408c1e996feb5a87b
|
4
|
+
data.tar.gz: '082b71bf0cca5feb45251792308cd7ddf83995a41f3ffab01e2ba94dd75817d6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2e7706f749a7f53866cc7f4d4fd05d2ae6c826b694a490d2bcd79ace5c6f46e9c74c0fa3fc65df53e0b28abdd72e5878d99f8f5f91732465ec24fc423a571b
|
7
|
+
data.tar.gz: 6fc797ae357239f04bb51aba388e2a161df6e6ea949dc27759ed9e037914cf422e6504e8ffc37986bfc2e1425bef20446a62831914a137d7283825808d1868e6
|
@@ -0,0 +1,17 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
open-pull-requests-limit: 10
|
8
|
+
- package-ecosystem: "github-actions"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "weekly"
|
12
|
+
day: "friday"
|
13
|
+
- package-ecosystem: "docker"
|
14
|
+
directory: "/examples/rails-7-barebones/"
|
15
|
+
schedule:
|
16
|
+
interval: "weekly"
|
17
|
+
day: "friday"
|
data/.github/workflows/main.yml
CHANGED
@@ -8,31 +8,40 @@ 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.1", appraisal: "rails-7.0" },
|
17
|
+
{ ruby: "3.0", appraisal: "rails-7.0" },
|
18
|
+
{ ruby: "2.7", appraisal: "rails-7.0" },
|
19
|
+
{ ruby: "2.7", appraisal: "rails-6.1" },
|
20
|
+
{ ruby: "2.6", appraisal: "rails-6.1" }
|
21
|
+
]
|
16
22
|
|
17
23
|
steps:
|
18
|
-
- uses: actions/checkout@
|
24
|
+
- uses: actions/checkout@v3.0.2
|
19
25
|
|
20
26
|
- name: Run Collector
|
21
27
|
run: docker-compose up -d
|
22
28
|
|
23
|
-
- name: Set up Ruby ${{ matrix.ruby
|
24
|
-
uses: ruby/setup-ruby@v1
|
29
|
+
- name: Set up Ruby ${{ matrix.rubygems.ruby }}
|
30
|
+
uses: ruby/setup-ruby@v1.117.0
|
25
31
|
with:
|
26
|
-
ruby-version: ${{ matrix.ruby
|
27
|
-
bundler-cache: true
|
32
|
+
ruby-version: ${{ matrix.rubygems.ruby }}
|
28
33
|
- name: Apply RubyGems fixes
|
29
34
|
run: gem update --system
|
30
35
|
- name: Install dependencies
|
31
36
|
run: bundle install
|
37
|
+
- name: Install appraisal dependencies
|
38
|
+
run: bundle exec appraisal install
|
32
39
|
- name: Rubocop
|
33
40
|
run: bundle exec rubocop
|
34
41
|
- name: Run tests
|
35
|
-
run: bundle exec rake test
|
42
|
+
run: bundle exec appraisal ${{ matrix.rubygems.appraisal }} rake test
|
43
|
+
- name: Upload coverage to Codecov
|
44
|
+
uses: codecov/codecov-action@v3.1.1
|
36
45
|
- name: Run basic example e2e test
|
37
46
|
run: ruby console.rb
|
38
47
|
working-directory: ./examples/basic/
|
@@ -40,9 +49,18 @@ jobs:
|
|
40
49
|
TEST: true
|
41
50
|
|
42
51
|
test-e2e-rails-7-barebones:
|
43
|
-
runs-on: ubuntu-
|
52
|
+
runs-on: ubuntu-20.04
|
44
53
|
steps:
|
45
|
-
- uses: actions/checkout@
|
54
|
+
- uses: actions/checkout@v3.0.2
|
46
55
|
- name: Run e2e tests via Docker
|
47
56
|
working-directory: ./examples/rails-7-barebones
|
48
57
|
run: docker-compose up --build --exit-code-from tester
|
58
|
+
|
59
|
+
linkChecker:
|
60
|
+
runs-on: ubuntu-20.04
|
61
|
+
steps:
|
62
|
+
- uses: actions/checkout@v3.0.2
|
63
|
+
- name: Link Checker
|
64
|
+
uses: lycheeverse/lychee-action@v1.5.1
|
65
|
+
with:
|
66
|
+
fail: true
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
CHANGED
@@ -1,18 +1,31 @@
|
|
1
1
|
image:
|
2
2
|
name: "docker-hub.repo.splunkdev.net/ruby:3.1.2"
|
3
3
|
|
4
|
+
include:
|
5
|
+
- project: 'ci-cd/templates'
|
6
|
+
ref: master
|
7
|
+
file: '/prodsec/.oss-scan.yml'
|
8
|
+
|
4
9
|
stages:
|
5
10
|
- build
|
11
|
+
- scan
|
6
12
|
- release
|
7
13
|
|
8
14
|
build:
|
9
15
|
stage: build
|
16
|
+
artifacts:
|
17
|
+
paths:
|
18
|
+
- Gemfile.lock
|
10
19
|
script: |
|
11
20
|
gem update --system
|
12
21
|
bundle install
|
13
22
|
bundle exec rubocop
|
14
23
|
bundle exec rake test
|
15
24
|
|
25
|
+
oss-scan:
|
26
|
+
stage: scan
|
27
|
+
extends: .oss-scan
|
28
|
+
|
16
29
|
release:
|
17
30
|
stage: release
|
18
31
|
rules:
|
data/.lycheeignore
ADDED
data/.rubocop.yml
CHANGED
@@ -4,6 +4,7 @@ AllCops:
|
|
4
4
|
Exclude:
|
5
5
|
- 'bin/*'
|
6
6
|
- 'examples/rails-7-barebones/bin/*'
|
7
|
+
- 'gemfiles/*'
|
7
8
|
|
8
9
|
# github actions' weirdness
|
9
10
|
# https://github.com/rubocop/rubocop/issues/9832#issuecomment-882111229
|
@@ -25,3 +26,6 @@ Metrics/AbcSize:
|
|
25
26
|
|
26
27
|
Metrics/MethodLength:
|
27
28
|
Max: 15
|
29
|
+
|
30
|
+
Metrics/ModuleLength:
|
31
|
+
Max: 105
|
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
@@ -7,4 +7,39 @@ 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
|
10
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
|
+
|
23
|
+
## v0.2.0 - 2022-09-06
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- OpenTelemetry Ruby SDK and API are updated to 1.0
|
28
|
+
- [pre-configured support for Smart
|
29
|
+
Agent](https://github.com/signalfx/splunk-otel-ruby/pull/8)
|
30
|
+
- [support for SPLUNK_TRACE_RESPONSE_HEADER_ENABLED environment
|
31
|
+
variable](https://github.com/signalfx/splunk-otel-ruby/pull/38)
|
32
|
+
|
33
|
+
## v0.1.0 - 2022-07-27
|
34
|
+
|
35
|
+
### Added
|
36
|
+
|
37
|
+
- [railtie based RUM Rack instrumentation](https://github.com/signalfx/splunk-otel-ruby/pull/26)
|
38
|
+
- [basic example using splunk distro](https://github.com/signalfx/splunk-otel-ruby/pull/20)
|
39
|
+
- [example of the most simplified rails setup](https://github.com/signalfx/splunk-otel-ruby/pull/24)
|
40
|
+
- [Rack RUM middleware](https://github.com/signalfx/splunk-otel-ruby/pull/23)
|
41
|
+
- [splunk.distro.version to resource attributes](https://github.com/signalfx/splunk-otel-ruby/pull/9)
|
42
|
+
- [MIGRATING.md docs for migrating from SignalFX Tracing Library](https://github.com/signalfx/splunk-otel-ruby/pull/18)
|
43
|
+
- [standard logging correlation formatter](https://github.com/signalfx/splunk-otel-ruby/pull/11)
|
44
|
+
- support `SPLUNK_ACCESS_TOKEN` and `SPLUNK_REALM` environment variables for direct
|
45
|
+
to Splunk exporting
|
data/MIGRATING.md
CHANGED
@@ -1,20 +1,27 @@
|
|
1
1
|
# Migrate from the SignalFx Tracing Library for Ruby
|
2
2
|
|
3
|
-
The SignalFx Tracing Library for Ruby is deprecated
|
4
|
-
|
3
|
+
The SignalFx Tracing Library for Ruby is scheduled to be deprecated by the end of 2022.
|
4
|
+
Replace it with the Splunk Distribution of OpenTelemetry Ruby.
|
5
5
|
|
6
|
-
|
7
|
-
the OpenTelemetry Instrumentation for Ruby,
|
8
|
-
uses the OpenTelemetry API.
|
9
|
-
|
10
|
-
Read the following instructions to learn how to migrate to the Splunk
|
11
|
-
Ruby OTel agent.
|
6
|
+
Splunk Distribution of OpenTelemetry Ruby is based on and compatible with
|
7
|
+
the OpenTelemetry Instrumentation for Ruby,
|
8
|
+
an open-source project that uses the OpenTelemetry API.
|
12
9
|
|
13
10
|
## Compatibility and requirements
|
14
11
|
|
15
12
|
The Splunk Distribution of OpenTelemetry Ruby requires Ruby 2.6 and
|
16
13
|
higher.
|
17
14
|
|
15
|
+
## Known limitations compared to SignalFx Tracing for Ruby
|
16
|
+
|
17
|
+
- Different subset of supported Ruby versions, see previous section
|
18
|
+
- Currently no auto-instrumentation for:
|
19
|
+
- `elasticsearch` (<https://github.com/elastic/elasticsearch-ruby>)
|
20
|
+
- `grape` (<https://github.com/ruby-grape/grape>)
|
21
|
+
- `sequel` (<https://github.com/jeremyevans/sequel>)
|
22
|
+
|
23
|
+
More details in [OTel instrumentation equivalents](#signalfx-instrumentations-equivalents).
|
24
|
+
|
18
25
|
## Migrate to the Splunk Distribution of OpenTelemetry Ruby
|
19
26
|
|
20
27
|
To migrate from the SignalFx Tracing Library for Ruby to the Splunk
|
@@ -26,6 +33,7 @@ Distribution of OpenTelemetry Ruby, follow these steps:
|
|
26
33
|
|
27
34
|
> Semantic conventions for span names and attributes change when you
|
28
35
|
migrate.
|
36
|
+
|
29
37
|
### Remove the SignalFx Tracing Library for Ruby
|
30
38
|
|
31
39
|
Follow these steps to remove the tracing library and its dependencies:
|
@@ -36,26 +44,105 @@ Follow these steps to remove the tracing library and its dependencies:
|
|
36
44
|
gem uninstall signalfx
|
37
45
|
```
|
38
46
|
|
39
|
-
|
47
|
+
1. Remove `signalfx` from your Gemfile.
|
40
48
|
|
41
|
-
|
42
|
-
installed.
|
49
|
+
## Migrate to the Splunk Distribution of OpenTelemetry Ruby
|
43
50
|
|
44
|
-
|
51
|
+
We're currently only testing installation using Bundler with RubyGems as a source.
|
52
|
+
[Contact us](mailto:ssg-observability-instrumentals-ruby@splunk.com) if you require a different way of installation.
|
45
53
|
|
46
|
-
|
54
|
+
If you installed
|
55
|
+
[Smart Agent](https://github.com/signalfx/signalfx-agent)
|
56
|
+
to serve as a gateway (traces/metrics data proxy)
|
57
|
+
migrate to
|
58
|
+
[OpenTelemetry Collector](https://docs.splunk.com/Observability/gdi/opentelemetry/resources.html)
|
59
|
+
first, as soon as (if) possible.
|
47
60
|
|
48
|
-
###
|
61
|
+
### Deploy the Splunk Distribution of OpenTelemetry Ruby
|
49
62
|
|
50
|
-
To
|
51
|
-
Distribution of OpenTelemetry Ruby, rename the following environment
|
52
|
-
variables:
|
63
|
+
To install the Splunk Distribution of OpenTelemetry Ruby, see the [README.md](README.md).
|
53
64
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
65
|
+
### Replace SignalFx / OpenTracing gems with OTel equivalents
|
66
|
+
|
67
|
+
1. Make a list of all `signalfx-*` instrumentation gems from your Gemfile, see
|
68
|
+
[this table](https://github.com/signalfx/signalfx-ruby-tracing#supported-libraries)
|
69
|
+
for a complete list.
|
70
|
+
|
71
|
+
1. Replace them with OpenTelemetry, as per the table below.
|
72
|
+
|
73
|
+
1. Replace any other OpenTracing instrumentation packages you might have installed yourself.
|
74
|
+
|
75
|
+
<a name="signalfx-instrumentations-equivalents"></a>
|
76
|
+
#### OTel equivalents of SignalFx instrumentation gems
|
77
|
+
|
78
|
+
| SignalFx instrumentation name | OTel instrumentation name | notes |
|
79
|
+
| ----------------------------- | ------------------------- | ----- |
|
80
|
+
| signalfx-activerecord-opentracing | opentelemetry-instrumentation-active_record | |
|
81
|
+
| signalfx-elasticsearch-instrumentation | no known equivalents | [open issue in OTel](https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/8) |
|
82
|
+
| signalfx-faraday-instrumentation | opentelemetry-instrumentation-faraday | |
|
83
|
+
| signalfx-grape-instrumentation | no known equivalents | [open issue in OTel](https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/9) |
|
84
|
+
| signalfgx-mongodb-instrumentation | opentelemetry-instrumentation-mongo | |
|
85
|
+
| signalfx-mysql2-instrumentation | opentelemetry-instrumentation-mysql2 | |
|
86
|
+
| signalfx-nethttp-instrumentation | opentelemetry-instrumentation-net_http | |
|
87
|
+
| signalfx-pg-instrumentation | opentelemetry-instrumentation-pg | |
|
88
|
+
| signalfx-rack-tracer | opentelemetry-instrumentation-rack | |
|
89
|
+
| signalfx-rails-instrumentation | opentelemetry-instrumentation-rails | |
|
90
|
+
| signalfx-redis-instrumentation | opentelemetry-instrumentation-redis | |
|
91
|
+
| signalfx-restclient-instrumentation | opentelemetry-instrumentation-restclient | |
|
92
|
+
| signalfx-sequel-instrumentation | no known equivalents | [open issue in OTel](https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues/11) |
|
93
|
+
| signalfx-sidekiq-opentracing | opentelemetry-instrumentation-sidekiq | |
|
94
|
+
| signalfx-sinatra-instrumentation | opentelemetry-instrumentation-sinatra | |
|
95
|
+
|
96
|
+
#### OTel equivalents of other Open Tracing instrumentation gems
|
97
|
+
|
98
|
+
See the
|
99
|
+
[list of all known OTel Ruby instrumentations](https://opentelemetry.io/registry/?language=ruby&component=instrumentation)
|
100
|
+
in OpenTelemetry registry.
|
101
|
+
|
102
|
+
### Migrate settings for the Splunk Distribution of OpenTelemetry Ruby
|
103
|
+
|
104
|
+
1. `SIGNALFX_ENDPOINT_URL` or `ingest_url` configuration parameter
|
105
|
+
- if you installed Smart Agent and can migrate to OpenTelemetry Collector, do that first, then see the point below
|
106
|
+
- if you have OpenTelemetry Collector available up as a sidecar (via `localhost`),
|
107
|
+
and it accepts OTLP on default ports, just remove this setting, we export OTLP to OTel Collector by default
|
108
|
+
- if you need to keep using Smart Agent, you have to set up a jaeger exporter yourself
|
109
|
+
- if you export directly to our backend (without OTel Collector as a proxy),
|
110
|
+
just set `SPLUNK_REALM` to your realm
|
111
|
+
(it's part of the URL, ie. `https://app.<realm>.signalfx.com/`, or `us0` if it's missing)
|
112
|
+
|
113
|
+
1. `SIGNALFX_SERVICE_NAME` or `service_name` configuration parameter
|
114
|
+
- to set in environment, use `OTEL_SERVICE_NAME`
|
115
|
+
- to set in code, use `Splunk::Otel.configure(service_name: 'your service name', ...`
|
116
|
+
|
117
|
+
1. `SIGNALFX_ACCESS_TOKEN` or `access_token` configuration parameter
|
118
|
+
- to set in environment, use `SPLUNK_ACCESS_TOKEN`
|
119
|
+
|
120
|
+
1. `SIGNALFX_SPAN_TAGS` or `span_tags` configuration parameter
|
121
|
+
- to set in environment:
|
122
|
+
- first, you need to rewrite the existing value to the,
|
123
|
+
which has a syntax of comma-separated `<key>=<value>` pairs (e.g. `key1=value1,key2=value2`)
|
124
|
+
- set `OTEL_RESOURCE_ATTRIBUTES` to the new value
|
125
|
+
- to set in code:
|
126
|
+
- call `OpenTelemetry::SDK::Resources::Resource.create` with a `Hash`
|
127
|
+
consisting of your existing key-value pairs
|
128
|
+
- pass the newly created `Resource` to the `resource=` attribute in configuration
|
129
|
+
- for example:
|
130
|
+
```ruby
|
131
|
+
Splunk::Otel.configure(other_args) do |c|
|
132
|
+
c.resource = OpenTelemetry::SDK::Resources::Resource.create(
|
133
|
+
"key" => "value"
|
134
|
+
)
|
135
|
+
# ...
|
136
|
+
end
|
137
|
+
```
|
138
|
+
|
139
|
+
1. `SIGNALFX_RECORDED_VALUE_MAX_LENGTH`
|
140
|
+
- can be set in environment using `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`
|
141
|
+
- see
|
142
|
+
[the list of span limits settings](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#span-limits)
|
143
|
+
to learn more
|
144
|
+
|
145
|
+
1. `tracer` configuration parameter
|
146
|
+
- if you need to set its equivalent, open an issue, and tell us about your use case
|
60
147
|
|
61
148
|
For more information about Splunk Ruby OTel settings, see [advanced-config.md](docs/advanced-config.md).
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ This Splunk distribution comes with the following defaults:
|
|
36
36
|
baggage](https://www.w3.org/TR/baggage/) context propagation.
|
37
37
|
- OTLP over HTTP exporter configured to send spans to a locally running [Splunk
|
38
38
|
OpenTelemetry Connector](https://github.com/signalfx/splunk-otel-collector)
|
39
|
-
|
39
|
+
at http://localhost:4318.
|
40
40
|
- Unlimited default limits for configuration options to support full-fidelity
|
41
41
|
traces.
|
42
42
|
|
@@ -46,6 +46,12 @@ Install the gem by adding it to your project's `Gemfile`:
|
|
46
46
|
gem "splunk-otel", "~> 0.1"
|
47
47
|
```
|
48
48
|
|
49
|
+
or
|
50
|
+
|
51
|
+
```shell
|
52
|
+
bundle add splunk-otel --version "~> 0.1"
|
53
|
+
```
|
54
|
+
|
49
55
|
Configure OpenTelemetry using the `Splunk::Otel` module from `splunk/otel`:
|
50
56
|
|
51
57
|
``` ruby
|
@@ -69,10 +75,20 @@ Other resource attributes are not strictly required, but
|
|
69
75
|
are available. These can be set through the environment variable
|
70
76
|
`OTEL_RESOURCE_ATTRIBUTES`:
|
71
77
|
|
72
|
-
```
|
78
|
+
```
|
73
79
|
OTEL_RESOURCE_ATTRIBUTES="service.version=1.2.3,deployment.environment=production"
|
74
80
|
```
|
75
81
|
|
82
|
+
alternatively, if needed, more attributes can be added in code using:
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
Splunk::Otel.configure(service_name: "my-service") do |c|
|
86
|
+
c.resource = OpenTelemetry::SDK::Resources::Resource.create(
|
87
|
+
"key" => "value"
|
88
|
+
)
|
89
|
+
end
|
90
|
+
```
|
91
|
+
|
76
92
|
## Advanced configuration
|
77
93
|
|
78
94
|
See [advanced-config.md](docs/advanced-config.md) for information on how to
|
@@ -88,7 +104,7 @@ See [Correlating traces and logs](docs/correlating-traces-and-logs.md) for more
|
|
88
104
|
## Library instrumentation
|
89
105
|
|
90
106
|
Supported libraries are listed
|
91
|
-
[here](https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation).
|
107
|
+
[here](https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation).
|
92
108
|
The corresponding gems for the instrumentation libraries can be found under the
|
93
109
|
[opentelemetry-ruby](https://rubygems.org/profiles/opentelemetry-ruby) profile
|
94
110
|
on [rubygems.org](https://rubygems.org).
|
@@ -103,7 +119,7 @@ the
|
|
103
119
|
gem in your Gemfile:
|
104
120
|
|
105
121
|
``` ruby
|
106
|
-
gem "opentelemetry-instrumentation-all", "~> 0.23"
|
122
|
+
gem "opentelemetry-instrumentation-all", "~> 0.23"
|
107
123
|
```
|
108
124
|
|
109
125
|
Enable the instrumentations from the gem by passing `auto_instrument:true` to
|
@@ -143,10 +159,23 @@ OpenTelemetry::SDK.configure do |c|
|
|
143
159
|
end
|
144
160
|
```
|
145
161
|
|
146
|
-
To enable instrumentation libraries manually, see [Manual instrumentation](#
|
162
|
+
To enable instrumentation libraries manually, see [Manual library instrumentation](#manual-library-instrumentation).
|
147
163
|
|
148
164
|
### Manual instrumentation
|
149
165
|
|
166
|
+
Documentation on how to manually instrument a Ruby application is available in the
|
167
|
+
[OpenTelemetry official documentation](https://opentelemetry.io/docs/instrumentation/ruby/manual/).
|
168
|
+
|
169
|
+
To extend the instrumentation with the OpenTelemetry Instrumentation for Ruby,
|
170
|
+
you have to use a compatible API version.
|
171
|
+
|
172
|
+
The Splunk Distribution of OpenTelemetry Ruby is compatible with:
|
173
|
+
|
174
|
+
- OpenTelemetry API version 1.0.0
|
175
|
+
- OpenTelemetry SDK version 1.0.0
|
176
|
+
|
177
|
+
### Manual library instrumentation
|
178
|
+
|
150
179
|
Instrumentation gems can also be installed and enabled individually. This may be
|
151
180
|
preferred in order to control exactly which gems are fetched when building your project.
|
152
181
|
|
@@ -155,7 +184,7 @@ the project's `Gemfile`. For example, to install the
|
|
155
184
|
[Sinatra](https://rubygems.org/gems/opentelemetry-instrumentation-sinatra)
|
156
185
|
instrumentation:
|
157
186
|
|
158
|
-
```
|
187
|
+
```
|
159
188
|
gem "opentelemetry-instrumentation-sinatra", "~> 0.19"
|
160
189
|
```
|
161
190
|
|
@@ -171,6 +200,54 @@ Splunk::Otel.configure do |c|
|
|
171
200
|
end
|
172
201
|
```
|
173
202
|
|
203
|
+
### Real User Monitoring
|
204
|
+
|
205
|
+
For [Real User Monitoring
|
206
|
+
(RUM)](https://www.splunk.com/en_us/products/real-user-monitoring.html) a
|
207
|
+
[Rack](https://github.com/rack/rack) middleware is provided which will add trace
|
208
|
+
context to the `Server-Timing` header in the response if there is an active
|
209
|
+
Span. To use the middleware configure `Splunk::Otel` to use the `Rack`
|
210
|
+
instrumentation:
|
211
|
+
|
212
|
+
``` ruby
|
213
|
+
Splunk::Otel.configure do |c|
|
214
|
+
c.use "OpenTelemetry::Instrumentation::Rack"
|
215
|
+
end
|
216
|
+
```
|
217
|
+
|
218
|
+
And add the middleware in `Rack::Builder`:
|
219
|
+
|
220
|
+
``` ruby
|
221
|
+
Rack::Builder.app do
|
222
|
+
use OpenTelemetry::Instrumentation::Rack::Middlewares::TracerMiddleware
|
223
|
+
use Splunk::Otel::Rack::RumMiddleware
|
224
|
+
run ->(_env) { [200, { "content-type" => "text/plain" }, ["OK"]] }
|
225
|
+
end
|
226
|
+
```
|
227
|
+
|
228
|
+
When using [ActionPack](https://rubygems.org/gems/actionpack/), which Rails
|
229
|
+
does, the middleware will be added automatically if the Instrumentation Library
|
230
|
+
for ActionPack, "Splunk::Otel::Instrumentation::ActionPack", is used:
|
231
|
+
|
232
|
+
``` ruby
|
233
|
+
Splunk::Otel.configure do |c|
|
234
|
+
c.use "OpenTelemetry::Instrumentation::ActionPack"
|
235
|
+
c.use "Splunk::Otel::Instrumentation::ActionPack"
|
236
|
+
end
|
237
|
+
```
|
238
|
+
|
239
|
+
To disable the response headers being added the environment variable
|
240
|
+
`SPLUNK_TRACE_RESPONSE_HEADER_ENABLED` can be set to `false`, or pass
|
241
|
+
`trace_response_header_enabled: false` to `Splunk::Otel.configure`.
|
242
|
+
|
243
|
+
## Configure for use with Smart Agent
|
244
|
+
|
245
|
+
This distribution includes the `jaeger-thrift-splunk` exporter, which is preconfigured to send data to local instance of the [SignalFx Smart Agent](https://github.com/signalfx/signalfx-agent).
|
246
|
+
|
247
|
+
To use the `jaeger-thrift-splunk` exporter, set the`OTEL_TRACES_EXPORTER` environment variable to `jaeger-thrift-splunk`, or append the exporter to the existing values. For example, `OTEL_TRACES_EXPORTER=otlp,jaeger-thrift-splunk`.
|
248
|
+
|
249
|
+
If the `SPLUNK_REALM` or the `OTEL_EXPORTER_JAEGER_ENDPOINT` environmental variables are set, the default endpoint is overwritten.
|
250
|
+
|
174
251
|
## Troubleshooting
|
175
252
|
|
176
253
|
For troubleshooting information, see the [Troubleshooting](docs/troubleshooting.md) documentation.
|
@@ -188,3 +265,5 @@ file](./LICENSE).
|
|
188
265
|
> http://www.apache.org/licenses/LICENSE-2.0
|
189
266
|
>
|
190
267
|
> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
268
|
+
|
269
|
+
>ℹ️ SignalFx was acquired by Splunk in October 2019. See [Splunk SignalFx](https://www.splunk.com/en_us/investor-relations/acquisitions/signalfx.html) for more information.
|
data/docker-compose.yml
CHANGED
data/docs/advanced-config.md
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
## Trace exporters
|
4
4
|
|
5
|
-
| Environment variable
|
6
|
-
|
7
|
-
| `OTEL_TRACES_EXPORTER`
|
8
|
-
| `OTEL_EXPORTER_OTLP_ENDPOINT`
|
5
|
+
| Environment variable | Default value | Support | Description |
|
6
|
+
|-------------------------------|-------------------------|---------|-----------------------------------------------------------------------------------|
|
7
|
+
| `OTEL_TRACES_EXPORTER` | `otlp` | Stable | Select the traces exporter to use. We recommend using the OTLP exporter (`otlp`). |
|
8
|
+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:4318` | Stable | The OTLP endpoint to connect to. |
|
9
9
|
|
10
|
-
The Splunk Distribution of OpenTelemetry Ruby uses the OTLP traces exporter as
|
10
|
+
The Splunk Distribution of OpenTelemetry Ruby uses the HTTP OTLP traces exporter as
|
11
11
|
the default setting. For debugging purposes, use the `console` exporter, which writes
|
12
12
|
spans directly to the console.
|
13
13
|
|
@@ -17,20 +17,35 @@ An example of setting an alternate trace exporter:
|
|
17
17
|
export OTEL_TRACES_EXPORTER=console
|
18
18
|
```
|
19
19
|
|
20
|
+
Supported values for `OTEL_TRACES_EXPORTER` are `otlp` and
|
21
|
+
`jaeger-thrift-splunk`. Only the HTTP version of `otlp` is supported by the
|
22
|
+
OpenTelemetry Ruby.
|
23
|
+
|
20
24
|
## Exporting directly to Splunk Observability Cloud
|
21
25
|
|
22
26
|
To export traces directly to Splunk Observability Cloud, bypassing the Collector,
|
23
27
|
set the `SPLUNK_ACCESS_TOKEN` and `SPLUNK_REALM` environment variables.
|
24
28
|
|
25
|
-
| Environment variable | Default value | Support
|
26
|
-
|
27
|
-
| `SPLUNK_ACCESS_TOKEN` | unset | Stable
|
28
|
-
| `SPLUNK_REALM` |
|
29
|
+
| Environment variable | Config Option | Default value | Support | Description |
|
30
|
+
|----------------------------------------|---------------------------------|---------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
31
|
+
| `SPLUNK_ACCESS_TOKEN` | | unset | Stable | Splunk authentication token that lets exporters send data directly to Splunk Observability Cloud. Unset by default. Not required unless you need to send data to the Observability Cloud ingest endpoint. See [Create and manage authentication tokens using Splunk Observability Cloud](https://docs.splunk.com/Observability/admin/authentication-tokens/tokens.html#admin-tokens). |
|
32
|
+
| `SPLUNK_REALM` | | unset | Stable | The name of your organization’s realm, for example, us0. When you set the realm, traces are sent directly to the ingest endpoint of Splunk Observability Cloud, bypassing the Splunk OpenTelemetry Collector. |
|
33
|
+
| `SPLUNK_TRACE_RESPONSE_HEADER_ENABLED` | `trace_response_header_enabled` | `True` | Stable | Enables adding server trace information to HTTP response headers in Rack middleware. |
|
34
|
+
|
35
|
+
## Exporting to the Smart Agent
|
36
|
+
|
37
|
+
This distribution includes the `jaeger-thrift-splunk` exporter, which is preconfigured to send data to local instance of the [SignalFx Smart Agent](https://github.com/signalfx/signalfx-agent).
|
38
|
+
|
39
|
+
| Environment variable | Config Option | Default value | Support | Description |
|
40
|
+
|---------------------------------|---------------|---------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
41
|
+
| `OTEL_EXPORTER_JAEGER_ENDPOINT` | | unset | Stable | The endpoint to export traces using the `jaeger-thrift-splunk` exporter. If set this overrides the default jaeger endpint of `http://127.0.0.1:9080/v1/trace`. |
|
42
|
+
|
29
43
|
|
30
44
|
## Propagators configuration
|
31
45
|
|
32
|
-
| Environment variable | Default value
|
33
|
-
|
|
46
|
+
| Environment variable | Config Option | Default value | Support | Description |
|
47
|
+
| ---------------------- | ------------- | ---------------------- | ------- | ---------------------------------------------------- |
|
48
|
+
| `OTEL_PROPAGATORS` | | `tracecontext,baggage` | Stable | Comma-separated list of propagator names to be used. |
|
34
49
|
|
35
50
|
To keep backward compatibility with manual instrumentation for the SignalFx Ruby Tracing library, set the trace propagator to B3:
|
36
51
|
|
@@ -38,15 +53,19 @@ To keep backward compatibility with manual instrumentation for the SignalFx Ruby
|
|
38
53
|
export OTEL_PROPAGATORS=b3multi
|
39
54
|
```
|
40
55
|
|
56
|
+
|
57
|
+
Supported values for `OTEL_PROPAGATORS` are `tracecontext`, `baggage`, `b3`,
|
58
|
+
`b3multi`, `jaeger`, `xray`, `ottrace` and `none`.
|
59
|
+
|
41
60
|
## Trace configuration
|
42
61
|
|
43
62
|
| Environment variable | Config Option | Default value | Notes |
|
44
63
|
| ------------------------- | --------------------- | ------------------------- | ---------------------------------------------------------------------- |
|
45
|
-
| OTEL_SERVICE_NAME | service_name | `unnamed-ruby-service` | The service name of this Ruby application. |
|
46
|
-
| OTEL_RESOURCE_ATTRIBUTES | | unset | Comma-separated list of resource attributes added to every reported span. <details><summary>Example</summary>`service.name=my-ruby-service,service.version=3.1,deployment.environment=production`</details> |
|
47
|
-
| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | |
|
48
|
-
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | |
|
49
|
-
| OTEL_LINK_ATTRIBUTE_COUNT_LIMIT | |
|
50
|
-
| OTEL_SPAN_EVENT_COUNT_LIMIT | |
|
51
|
-
| OTEL_SPAN_LINK_COUNT_LIMIT | | `1000` | Maximum number of links per span. |
|
52
|
-
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | | `12000` | Maximum length of strings for span attribute values. Values larger than the limit are truncated. |
|
64
|
+
| `OTEL_SERVICE_NAME` | `service_name` | `unnamed-ruby-service` | The service name of this Ruby application. |
|
65
|
+
| `OTEL_RESOURCE_ATTRIBUTES` | | unset | Comma-separated list of resource attributes added to every reported span. <details><summary>Example</summary>`service.name=my-ruby-service,service.version=3.1,deployment.environment=production`</details> |
|
66
|
+
| `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` | | unset (unlimited) | Maximum number of attributes per span. |
|
67
|
+
| `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT` | | unset (unlimited) | Maximum number of attributes per event. |
|
68
|
+
| `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT` | | unset (unlimited) | Maximum number of attributes per link. |
|
69
|
+
| `OTEL_SPAN_EVENT_COUNT_LIMIT` | | unset (unlimited) | Maximum number of events per span. |
|
70
|
+
| `OTEL_SPAN_LINK_COUNT_LIMIT` | | `1000` | Maximum number of links per span. |
|
71
|
+
| `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | | `12000` | Maximum length of strings for span attribute values. Values larger than the limit are truncated. |
|
@@ -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~deb10u1" \
|
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 @@
|
|
1
|
+
Gemfile.lock
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "bundler/setup"
|
5
|
+
Bundler.require(:default)
|
6
|
+
|
7
|
+
Splunk::Otel.configure do |configurator|
|
8
|
+
$configurator = configurator # rubocop:disable Style/GlobalVars
|
9
|
+
|
10
|
+
class << configurator
|
11
|
+
def test_shutdown
|
12
|
+
@span_processors.each(&:shutdown)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
tracer = OpenTelemetry.tracer_provider.tracer("test", "1.0")
|
18
|
+
tracer.in_span("test-span") do
|
19
|
+
puts "test-span execution"
|
20
|
+
end
|
21
|
+
|
22
|
+
$configurator.test_shutdown # rubocop:disable Style/GlobalVars
|
@@ -15,7 +15,11 @@ module Splunk
|
|
15
15
|
def call(env)
|
16
16
|
status, headers, body = @app.call(env)
|
17
17
|
|
18
|
-
headers = Splunk::Otel
|
18
|
+
headers = if Splunk::Otel.trace_response_header_enabled
|
19
|
+
Splunk::Otel::Common.rum_headers(headers)
|
20
|
+
else
|
21
|
+
headers
|
22
|
+
end
|
19
23
|
|
20
24
|
[status, headers, body]
|
21
25
|
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Splunk
|
4
|
+
module Otel
|
5
|
+
OUR_EXPORTERS_KEYS = ["jaeger-thrift-splunk"].freeze
|
6
|
+
private_constant :OUR_EXPORTERS_KEYS
|
7
|
+
|
8
|
+
# internal module for allowing our exporters to be set via ENV
|
9
|
+
module ExporterExtensions
|
10
|
+
def effective_splunk_jaeger_endpoint
|
11
|
+
return "https://ingest.#{ENV["SPLUNK_REALM"]}.signalfx.com/v1/trace" if ENV["SPLUNK_REALM"]
|
12
|
+
return ENV["OTEL_EXPORTER_JAEGER_ENDPOINT"] if ENV["OTEL_EXPORTER_JAEGER_ENDPOINT"]
|
13
|
+
|
14
|
+
"http://127.0.0.1:9080/v1/trace"
|
15
|
+
end
|
16
|
+
|
17
|
+
def wrapped_exporters_from_env
|
18
|
+
original_env_value = ENV.fetch("OTEL_TRACES_EXPORTER", "otlp")
|
19
|
+
exporters_keys = original_env_value.split(",").map(&:strip)
|
20
|
+
non_proprietary_exporters_keys = exporters_keys - OUR_EXPORTERS_KEYS
|
21
|
+
|
22
|
+
ENV["OTEL_TRACES_EXPORTER"] = non_proprietary_exporters_keys.join(",")
|
23
|
+
original_exporters = super
|
24
|
+
ENV["OTEL_TRACES_EXPORTER"] = original_env_value
|
25
|
+
|
26
|
+
original_exporters + proprietary_exporters(exporters_keys)
|
27
|
+
end
|
28
|
+
|
29
|
+
def proprietary_exporters(exporters_keys)
|
30
|
+
(exporters_keys & OUR_EXPORTERS_KEYS).map do |exporter_key|
|
31
|
+
case exporter_key
|
32
|
+
when "jaeger-thrift-splunk"
|
33
|
+
args = {
|
34
|
+
endpoint: effective_splunk_jaeger_endpoint
|
35
|
+
}
|
36
|
+
fetch_exporter_with_args("jaeger-thrift-splunk", "OpenTelemetry::Exporter::Jaeger::CollectorExporter",
|
37
|
+
**args)
|
38
|
+
end
|
39
|
+
end.compact
|
40
|
+
end
|
41
|
+
|
42
|
+
def fetch_exporter_with_args(name, class_name, **args)
|
43
|
+
# TODO: warn if jaeger exporter gem is not present
|
44
|
+
exporter = Kernel.const_get(class_name).new(**args)
|
45
|
+
OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new exporter
|
46
|
+
rescue NameError
|
47
|
+
OpenTelemetry.logger.warn "The #{name} exporter cannot be configured" \
|
48
|
+
"- please add opentelemetry-exporter-#{name} to your Gemfile" \
|
49
|
+
", spans will not be exported.."
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
data/lib/splunk/otel/version.rb
CHANGED
data/lib/splunk/otel.rb
CHANGED
@@ -1,18 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "otel/version"
|
4
3
|
require "opentelemetry/sdk"
|
5
|
-
|
6
|
-
# FIXME: without this, otlp doesn't work out-of-the-box
|
7
4
|
require "opentelemetry-exporter-otlp"
|
8
5
|
|
6
|
+
require_relative "otel/version"
|
7
|
+
require_relative "otel/proprietary_exporters"
|
8
|
+
|
9
9
|
module Splunk
|
10
10
|
# main module for application startup configuration
|
11
|
-
module Otel
|
11
|
+
module Otel # rubocop:disable Metrics/ModuleLength
|
12
12
|
# custom exception types in this gem must inherit from Splunk::Otel::Error
|
13
13
|
# this allows the user to rescue a generic exception type to catch all exceptions
|
14
14
|
class Error < StandardError; end
|
15
15
|
|
16
|
+
attr_reader(:trace_response_header_enabled)
|
17
|
+
|
18
|
+
@trace_response_header_enabled = true
|
19
|
+
|
16
20
|
# Configures the OpenTelemetry SDK and instrumentation with Splunk defaults.
|
17
21
|
#
|
18
22
|
# @yieldparam [Configurator] configurator Yields a configurator to the
|
@@ -49,21 +53,25 @@ module Splunk
|
|
49
53
|
# c.use_all
|
50
54
|
# end
|
51
55
|
def configure(service_name: ENV.fetch("OTEL_SERVICE_NAME", "unnamed-ruby-service"),
|
52
|
-
auto_instrument: false
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
56
|
+
auto_instrument: false,
|
57
|
+
trace_response_header_enabled: ENV.fetch("SPLUNK_TRACE_RESPONSE_HEADER_ENABLED", "true"))
|
58
|
+
@trace_response_header_enabled = to_boolean(trace_response_header_enabled)
|
59
|
+
|
60
|
+
set_defaults
|
57
61
|
|
58
62
|
# run SDK's setup function
|
59
|
-
OpenTelemetry::SDK.configure do |
|
60
|
-
|
61
|
-
|
63
|
+
OpenTelemetry::SDK.configure do |configurator|
|
64
|
+
class << configurator
|
65
|
+
include Splunk::Otel::ExporterExtensions
|
66
|
+
end
|
67
|
+
|
68
|
+
configurator.service_name = service_name
|
69
|
+
configurator.resource = OpenTelemetry::SDK::Resources::Resource.create(
|
62
70
|
"splunk.distro.version" => Splunk::Otel::VERSION
|
63
71
|
)
|
64
72
|
|
65
|
-
|
66
|
-
yield
|
73
|
+
configurator.use_all if auto_instrument
|
74
|
+
yield configurator if block_given?
|
67
75
|
end
|
68
76
|
|
69
77
|
# set span limits to GDI defaults if not set by the user
|
@@ -72,6 +80,13 @@ module Splunk
|
|
72
80
|
verify_service_name
|
73
81
|
end
|
74
82
|
|
83
|
+
def set_defaults
|
84
|
+
set_default_propagators
|
85
|
+
set_access_token_header
|
86
|
+
set_default_exporter
|
87
|
+
set_default_span_limits
|
88
|
+
end
|
89
|
+
|
75
90
|
# verify `service.name` is set and print a warning if it is still the default
|
76
91
|
def verify_service_name
|
77
92
|
provider_resource = OpenTelemetry.tracer_provider.instance_variable_get(:@resource)
|
@@ -151,6 +166,20 @@ module Splunk
|
|
151
166
|
end
|
152
167
|
end
|
153
168
|
|
169
|
+
def to_boolean(val)
|
170
|
+
# val could already be a boolean so just return the value if it is already
|
171
|
+
# true or false
|
172
|
+
case val
|
173
|
+
when true then true
|
174
|
+
when false then false
|
175
|
+
else
|
176
|
+
!%w[false
|
177
|
+
no
|
178
|
+
f
|
179
|
+
0].include?(val.strip.downcase)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
154
183
|
def service_name_warning
|
155
184
|
<<~WARNING
|
156
185
|
service.name attribute is not set, your service is unnamed and will be difficult to identify.
|
@@ -161,7 +190,8 @@ module Splunk
|
|
161
190
|
|
162
191
|
module_function :configure, :gdi_span_limits, :set_default_propagators, :set_default_exporter,
|
163
192
|
:verify_service_name, :service_name_warning, :default_env_vars,
|
164
|
-
:set_default_span_limits, :set_access_token_header, :set_endpoint
|
193
|
+
:set_default_span_limits, :set_access_token_header, :set_endpoint,
|
194
|
+
:to_boolean, :trace_response_header_enabled, :set_defaults
|
165
195
|
end
|
166
196
|
end
|
167
197
|
|
@@ -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,24 +26,27 @@ 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", "
|
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
31
|
spec.add_dependency "opentelemetry-instrumentation-base", "~> 0.21.0"
|
32
|
-
spec.add_dependency "opentelemetry-propagator-b3", "
|
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 "rake", "
|
38
|
-
spec.add_development_dependency "rubocop", "
|
39
|
-
spec.add_development_dependency "rubocop-rake", "
|
40
|
-
spec.add_development_dependency "simplecov", "
|
41
|
-
spec.add_development_dependency "
|
35
|
+
# development tooling
|
36
|
+
spec.add_development_dependency "appraisal", "2.4.1"
|
37
|
+
spec.add_development_dependency "rake", "13.0.6"
|
38
|
+
spec.add_development_dependency "rubocop", "1.36.0"
|
39
|
+
spec.add_development_dependency "rubocop-rake", "0.6.0"
|
40
|
+
spec.add_development_dependency "simplecov", "0.21.2"
|
41
|
+
spec.add_development_dependency "simplecov-cobertura", "2.1.0"
|
42
|
+
spec.add_development_dependency "test-unit", "3.5.3"
|
42
43
|
|
44
|
+
# development dependencies for integration testing
|
43
45
|
spec.add_development_dependency "opentelemetry-instrumentation-action_pack", "~> 0.2.0"
|
44
|
-
spec.add_development_dependency "opentelemetry-instrumentation-rack", "~> 0.21"
|
46
|
+
spec.add_development_dependency "opentelemetry-instrumentation-rack", "~> 0.21.0"
|
45
47
|
spec.add_development_dependency "rack", "~> 2.2"
|
46
|
-
spec.add_development_dependency "rack-test", "~>
|
48
|
+
spec.add_development_dependency "rack-test", "~> 2.0"
|
49
|
+
spec.add_development_dependency "rails"
|
47
50
|
|
48
51
|
spec.metadata = {
|
49
52
|
"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.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Splunk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -28,30 +28,42 @@ 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
|
@@ -70,16 +82,22 @@ dependencies:
|
|
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,103 @@ 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
|
111
129
|
- !ruby/object:Gem::Dependency
|
112
130
|
name: rake
|
113
131
|
requirement: !ruby/object:Gem::Requirement
|
114
132
|
requirements:
|
115
|
-
- -
|
133
|
+
- - '='
|
116
134
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
135
|
+
version: 13.0.6
|
118
136
|
type: :development
|
119
137
|
prerelease: false
|
120
138
|
version_requirements: !ruby/object:Gem::Requirement
|
121
139
|
requirements:
|
122
|
-
- -
|
140
|
+
- - '='
|
123
141
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
142
|
+
version: 13.0.6
|
125
143
|
- !ruby/object:Gem::Dependency
|
126
144
|
name: rubocop
|
127
145
|
requirement: !ruby/object:Gem::Requirement
|
128
146
|
requirements:
|
129
|
-
- -
|
147
|
+
- - '='
|
130
148
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
149
|
+
version: 1.36.0
|
132
150
|
type: :development
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
135
153
|
requirements:
|
136
|
-
- -
|
154
|
+
- - '='
|
137
155
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
156
|
+
version: 1.36.0
|
139
157
|
- !ruby/object:Gem::Dependency
|
140
158
|
name: rubocop-rake
|
141
159
|
requirement: !ruby/object:Gem::Requirement
|
142
160
|
requirements:
|
143
|
-
- -
|
161
|
+
- - '='
|
144
162
|
- !ruby/object:Gem::Version
|
145
163
|
version: 0.6.0
|
146
164
|
type: :development
|
147
165
|
prerelease: false
|
148
166
|
version_requirements: !ruby/object:Gem::Requirement
|
149
167
|
requirements:
|
150
|
-
- -
|
168
|
+
- - '='
|
151
169
|
- !ruby/object:Gem::Version
|
152
170
|
version: 0.6.0
|
153
171
|
- !ruby/object:Gem::Dependency
|
154
172
|
name: simplecov
|
155
173
|
requirement: !ruby/object:Gem::Requirement
|
156
174
|
requirements:
|
157
|
-
- -
|
175
|
+
- - '='
|
158
176
|
- !ruby/object:Gem::Version
|
159
177
|
version: 0.21.2
|
160
178
|
type: :development
|
161
179
|
prerelease: false
|
162
180
|
version_requirements: !ruby/object:Gem::Requirement
|
163
181
|
requirements:
|
164
|
-
- -
|
182
|
+
- - '='
|
165
183
|
- !ruby/object:Gem::Version
|
166
184
|
version: 0.21.2
|
185
|
+
- !ruby/object:Gem::Dependency
|
186
|
+
name: simplecov-cobertura
|
187
|
+
requirement: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - '='
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: 2.1.0
|
192
|
+
type: :development
|
193
|
+
prerelease: false
|
194
|
+
version_requirements: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - '='
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: 2.1.0
|
167
199
|
- !ruby/object:Gem::Dependency
|
168
200
|
name: test-unit
|
169
201
|
requirement: !ruby/object:Gem::Requirement
|
170
202
|
requirements:
|
171
|
-
- -
|
203
|
+
- - '='
|
172
204
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
205
|
+
version: 3.5.3
|
174
206
|
type: :development
|
175
207
|
prerelease: false
|
176
208
|
version_requirements: !ruby/object:Gem::Requirement
|
177
209
|
requirements:
|
178
|
-
- -
|
210
|
+
- - '='
|
179
211
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
212
|
+
version: 3.5.3
|
181
213
|
- !ruby/object:Gem::Dependency
|
182
214
|
name: opentelemetry-instrumentation-action_pack
|
183
215
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +230,14 @@ dependencies:
|
|
198
230
|
requirements:
|
199
231
|
- - "~>"
|
200
232
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
233
|
+
version: 0.21.0
|
202
234
|
type: :development
|
203
235
|
prerelease: false
|
204
236
|
version_requirements: !ruby/object:Gem::Requirement
|
205
237
|
requirements:
|
206
238
|
- - "~>"
|
207
239
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
240
|
+
version: 0.21.0
|
209
241
|
- !ruby/object:Gem::Dependency
|
210
242
|
name: rack
|
211
243
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,14 +258,28 @@ dependencies:
|
|
226
258
|
requirements:
|
227
259
|
- - "~>"
|
228
260
|
- !ruby/object:Gem::Version
|
229
|
-
version: '
|
261
|
+
version: '2.0'
|
230
262
|
type: :development
|
231
263
|
prerelease: false
|
232
264
|
version_requirements: !ruby/object:Gem::Requirement
|
233
265
|
requirements:
|
234
266
|
- - "~>"
|
235
267
|
- !ruby/object:Gem::Version
|
236
|
-
version: '
|
268
|
+
version: '2.0'
|
269
|
+
- !ruby/object:Gem::Dependency
|
270
|
+
name: rails
|
271
|
+
requirement: !ruby/object:Gem::Requirement
|
272
|
+
requirements:
|
273
|
+
- - ">="
|
274
|
+
- !ruby/object:Gem::Version
|
275
|
+
version: '0'
|
276
|
+
type: :development
|
277
|
+
prerelease: false
|
278
|
+
version_requirements: !ruby/object:Gem::Requirement
|
279
|
+
requirements:
|
280
|
+
- - ">="
|
281
|
+
- !ruby/object:Gem::Version
|
282
|
+
version: '0'
|
237
283
|
description:
|
238
284
|
email:
|
239
285
|
- splunk-oss@splunk.com
|
@@ -242,10 +288,13 @@ extensions: []
|
|
242
288
|
extra_rdoc_files: []
|
243
289
|
files:
|
244
290
|
- ".github/CODEOWNERS"
|
291
|
+
- ".github/dependabot.yml"
|
245
292
|
- ".github/workflows/main.yml"
|
246
293
|
- ".gitignore"
|
247
294
|
- ".gitlab-ci.yml"
|
295
|
+
- ".lycheeignore"
|
248
296
|
- ".rubocop.yml"
|
297
|
+
- Appraisals
|
249
298
|
- CHANGELOG.md
|
250
299
|
- CODE_OF_CONDUCT.md
|
251
300
|
- CONTRIBUTING.md
|
@@ -277,6 +326,11 @@ files:
|
|
277
326
|
- examples/rails-7-barebones/docker-compose.yml
|
278
327
|
- examples/rails-7-barebones/tests-e2e/rails_7_barebones_test.rb
|
279
328
|
- examples/rails-7-barebones/wait-for.sh
|
329
|
+
- examples/smart-agent/.gitignore
|
330
|
+
- examples/smart-agent/Gemfile
|
331
|
+
- examples/smart-agent/docker-compose.yml
|
332
|
+
- examples/smart-agent/runner.rb
|
333
|
+
- examples/smart-agent/smart-agent-config.yaml
|
280
334
|
- lib/splunk/otel.rb
|
281
335
|
- lib/splunk/otel/common.rb
|
282
336
|
- lib/splunk/otel/instrumentation/action_pack.rb
|
@@ -286,6 +340,7 @@ files:
|
|
286
340
|
- lib/splunk/otel/instrumentation/rack.rb
|
287
341
|
- lib/splunk/otel/instrumentation/rack/middleware.rb
|
288
342
|
- lib/splunk/otel/logging.rb
|
343
|
+
- lib/splunk/otel/proprietary_exporters.rb
|
289
344
|
- lib/splunk/otel/version.rb
|
290
345
|
- scripts/install-release-deps.sh
|
291
346
|
- scripts/release.sh
|