solarwinds_apm 6.1.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +49 -2
- data/ext/oboe_metal/extconf.rb +15 -9
- data/ext/oboe_metal/lib/liboboe-1.0-aarch64.so.sha256 +1 -1
- data/ext/oboe_metal/lib/liboboe-1.0-alpine-aarch64.so.sha256 +1 -1
- data/ext/oboe_metal/lib/liboboe-1.0-alpine-x86_64.so.sha256 +1 -1
- data/ext/oboe_metal/lib/liboboe-1.0-lambda-aarch64.so.sha256 +1 -1
- data/ext/oboe_metal/lib/liboboe-1.0-lambda-x86_64.so.sha256 +1 -1
- data/ext/oboe_metal/lib/liboboe-1.0-x86_64.so.sha256 +1 -1
- data/ext/oboe_metal/src/VERSION +1 -1
- data/ext/oboe_metal/src/oboe.h +2 -1
- data/ext/oboe_metal/src/oboe_api.cpp +5 -3
- data/ext/oboe_metal/src/oboe_api.h +2 -1
- data/ext/oboe_metal/src/oboe_swig_wrap.cc +219 -120
- data/lib/oboe_metal.rb +8 -4
- data/lib/rails/generators/solarwinds_apm/templates/solarwinds_apm_initializer.rb +0 -4
- data/lib/solarwinds_apm/api/custom_instrumentation.rb +80 -0
- data/lib/solarwinds_apm/api.rb +2 -0
- data/lib/solarwinds_apm/oboe_init_options.rb +14 -1
- data/lib/solarwinds_apm/opentelemetry/solarwinds_processor.rb +2 -2
- data/lib/solarwinds_apm/opentelemetry/solarwinds_response_propagator.rb +4 -3
- data/lib/solarwinds_apm/opentelemetry/solarwinds_sampler.rb +2 -0
- data/lib/solarwinds_apm/otel_config.rb +10 -0
- data/lib/solarwinds_apm/patch/tag_sql/sw_dbo_utils.rb +35 -0
- data/lib/solarwinds_apm/patch/tag_sql/sw_mysql2_patch.rb +25 -0
- data/lib/solarwinds_apm/patch/tag_sql/sw_pg_patch.rb +39 -0
- data/lib/solarwinds_apm/patch/tag_sql_patch.rb +11 -0
- data/lib/solarwinds_apm/support.rb +0 -14
- data/lib/solarwinds_apm/version.rb +1 -1
- metadata +10 -12
- data/lib/solarwinds_apm/support/swomarginalia/LICENSE +0 -20
- data/lib/solarwinds_apm/support/swomarginalia/README.md +0 -46
- data/lib/solarwinds_apm/support/swomarginalia/comment.rb +0 -206
- data/lib/solarwinds_apm/support/swomarginalia/formatter.rb +0 -20
- data/lib/solarwinds_apm/support/swomarginalia/load_swomarginalia.rb +0 -55
- data/lib/solarwinds_apm/support/swomarginalia/railtie.rb +0 -24
- data/lib/solarwinds_apm/support/swomarginalia/swomarginalia.rb +0 -89
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73f2befcea2c555995f79719d36c68d2448ae31f56656741d5c6e8d49e61963b
|
4
|
+
data.tar.gz: 4ba3986285dcda8adc5629c2e08b5221638928d06733dd6fc0c009379b97ab4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 777aebc61cfb1f6776f0640f9b0cbd6005c5c375989a046809ce4f97551a8f2925154496eeef798726ac2242641646bb590c48d23caf71165473b0ac0cfa6b52
|
7
|
+
data.tar.gz: c244cb0d3c1252cbcb85f3381cc82195ca8d59bf0ea4991f2c41f89a49d29a92efcf089ee35ae6274614493bd7e89d7ecb5851ec876a572d24fc5015ec7d5625
|
data/README.md
CHANGED
@@ -64,9 +64,11 @@ Note that if `OpenTelemetry::SDK.configure` is used to set up a `TracerProvider`
|
|
64
64
|
|
65
65
|
Several convenience and vendor-specific APIs are availabe to an application where `solarwinds_apm` has been loaded, below is a quick overview of the features provided. The full reference can be found at the [RubyDoc page for this gem](https://rubydoc.info/github/solarwinds/apm-ruby).
|
66
66
|
|
67
|
-
#### Convenience Method
|
67
|
+
#### Convenience Method: `in_span` and `add_tracer`
|
68
68
|
|
69
|
-
|
69
|
+
`in_span` acquires the correct `Tracer` so a new span can be created in a single call.
|
70
|
+
|
71
|
+
For example, using it in a Rails controller:
|
70
72
|
|
71
73
|
```ruby
|
72
74
|
class StaticController < ApplicationController
|
@@ -78,6 +80,51 @@ class StaticController < ApplicationController
|
|
78
80
|
end
|
79
81
|
```
|
80
82
|
|
83
|
+
`add_tracer` can add a custom span to the specified instance or class method that is already defined. It can optionally set the span kind and additional attributes provided in hash format:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
add_tracer :method_name, 'custom_span_name', { attributes: { 'any' => 'attributes' }, kind: :span_kind }
|
87
|
+
```
|
88
|
+
|
89
|
+
For example, if you want to instrument class or instance method `create_session` inside an application controller:
|
90
|
+
|
91
|
+
To instrument instance method
|
92
|
+
```ruby
|
93
|
+
class SessionsController < ApplicationController
|
94
|
+
include SolarWindsAPM::API::Tracer
|
95
|
+
|
96
|
+
def create
|
97
|
+
user = User.find_by(email: params[:session][:email].downcase)
|
98
|
+
create_session(user)
|
99
|
+
end
|
100
|
+
|
101
|
+
def create_session(user)
|
102
|
+
end
|
103
|
+
|
104
|
+
# instrument instance method create_session
|
105
|
+
add_tracer :create_session, 'custom_name', { attributes: { 'foo' => 'bar' }, kind: :consumer }
|
106
|
+
end
|
107
|
+
```
|
108
|
+
|
109
|
+
To instrument class method
|
110
|
+
```ruby
|
111
|
+
class SessionsController < ApplicationController
|
112
|
+
def create
|
113
|
+
user = User.find_by(email: params[:session][:email].downcase)
|
114
|
+
create_session(user)
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.create_session(user)
|
118
|
+
end
|
119
|
+
|
120
|
+
# instrument class method create_session
|
121
|
+
class << self
|
122
|
+
include SolarWindsAPM::API::Tracer
|
123
|
+
add_tracer :create_session, 'custom_name', { attributes: { 'foo' => 'bar' }, kind: :consumer }
|
124
|
+
end
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
81
128
|
#### Get Curent Trace Context Information
|
82
129
|
|
83
130
|
The `current_trace_info` method returns a `TraceInfo` object containing string representations of the current trace context that can be used in logging or manual propagation of context. This is a convenience method that wraps the OTel API `::OpenTelemetry::Trace.current_span`.
|
data/ext/oboe_metal/extconf.rb
CHANGED
@@ -18,20 +18,17 @@ CONFIG['warnflags'] = CONFIG['warnflags'].gsub('-Wdeclaration-after-statement',
|
|
18
18
|
init_mkmf(CONFIG)
|
19
19
|
|
20
20
|
ext_dir = __dir__
|
21
|
-
|
22
|
-
non_production =
|
21
|
+
oboe_env = ENV.fetch('OBOE_ENV', nil)
|
22
|
+
non_production = %w[dev stg].include? oboe_env.to_s
|
23
23
|
|
24
24
|
swo_lib_dir = File.join(ext_dir, 'lib')
|
25
25
|
version = File.read(File.join(ext_dir, 'src', 'VERSION')).strip
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
swo_path = File.join('https://agent-binaries.cloud.solarwinds.com/apm/c-lib/', version, 'relwithdebinfo')
|
30
|
-
puts 'Fetching c-lib from PRODUCTION DEBUG Build'
|
31
|
-
elsif ENV['OBOE_DEV'].to_s.casecmp('true').zero?
|
27
|
+
case oboe_env
|
28
|
+
when 'dev'
|
32
29
|
swo_path = 'https://solarwinds-apm-staging.s3.us-west-2.amazonaws.com/apm/c-lib/nightly'
|
33
30
|
puts 'Fetching c-lib from DEVELOPMENT Build'
|
34
|
-
|
31
|
+
when 'stg'
|
35
32
|
swo_path = File.join('https://agent-binaries.global.st-ssp.solarwinds.com/apm/c-lib/', version)
|
36
33
|
puts 'Fetching c-lib from STAGING Build'
|
37
34
|
else
|
@@ -39,6 +36,15 @@ else
|
|
39
36
|
puts 'Fetching c-lib from PRODUCTION Build'
|
40
37
|
end
|
41
38
|
|
39
|
+
oboe_debug = ENV['OBOE_DEBUG'].to_s.casecmp('true').zero?
|
40
|
+
|
41
|
+
if oboe_debug
|
42
|
+
swo_path = File.join(swo_path, 'relwithdebinfo')
|
43
|
+
puts "Fetching DEBUG Build based on #{oboe_env.to_s.empty? ? 'prod' : oboe_env}"
|
44
|
+
end
|
45
|
+
|
46
|
+
puts "final swo_path: #{swo_path}"
|
47
|
+
|
42
48
|
swo_arch = 'x86_64'
|
43
49
|
system_arch = `uname -m` # for mac, the command is `uname` # "Darwin\n"; try `uname -a`
|
44
50
|
system_arch.delete!("\n")
|
@@ -120,7 +126,7 @@ if success
|
|
120
126
|
dir_config('oboe', 'src', 'lib')
|
121
127
|
|
122
128
|
# create Makefile
|
123
|
-
if have_library('oboe'
|
129
|
+
if have_library('oboe')
|
124
130
|
$libs = append_library($libs, 'oboe')
|
125
131
|
$libs = append_library($libs, 'stdc++')
|
126
132
|
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
53295ec020a713c5f6fe7c14b150a10ac7db0e5ea692fbd6945ee69f7a581271
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
37407ece6aafcb662fbce8eb23f98a9b017154c66c8ec02eda835702ba14f446
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
925d65c2a940a82315525ea2e82eb357793f7db8a2a8ec529e7c03e2478bc965
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3d49133827a0b6839744231e3ca49f8c9340380063286b8c3794bde585370001
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
e2198827ce86309a59def33be14f17d0474477df33a5d75bd415d73a01c790b3
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
798a7c9551c66af743e1d6d2b736bf5667fa97fdc0ac8eec825fe4f63adaa044
|
data/ext/oboe_metal/src/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
15.0.
|
1
|
+
15.0.3
|
data/ext/oboe_metal/src/oboe.h
CHANGED
@@ -161,7 +161,7 @@ typedef struct oboe_metric_tag {
|
|
161
161
|
} oboe_metric_tag_t;
|
162
162
|
|
163
163
|
typedef struct oboe_init_options {
|
164
|
-
int version; // the version of this structure (currently on version
|
164
|
+
int version; // the version of this structure (currently on version 17)
|
165
165
|
const char *hostname_alias; // optional hostname alias
|
166
166
|
int log_level; // level at which log messages will be written to log file (0-6)
|
167
167
|
// use OBOE_INIT_LOG_LEVEL_INFO(3) for default log level
|
@@ -188,6 +188,7 @@ typedef struct oboe_init_options {
|
|
188
188
|
// only used in lambda reporter (off=0, on=1, default off)
|
189
189
|
int metric_format; // flag indicating the format of metric (0 = Both; 1 = TransactionResponseTime only; 2 = ResponseTime only; default = 0)
|
190
190
|
int log_type; // log type (0 = stderr; 1 = stdout; 2 = file; 3 = null; 4 = disabled; default = 0)
|
191
|
+
int defer_init; // defer init (0 = disable; 1 = enabled, parent process will not init oboe but fork child process will init oboe; default = 0)
|
191
192
|
} oboe_init_options_t;
|
192
193
|
|
193
194
|
typedef struct oboe_span_params {
|
@@ -587,11 +587,12 @@ Reporter::Reporter(
|
|
587
587
|
int stdout_clear_nonblocking, // flag indicating if the O_NONBLOCK flag on stdout should be cleared,
|
588
588
|
// only used in lambda reporter (off=0, on=1, default off)
|
589
589
|
int metric_format, // flag indicating the format of metric (0 = Both; 1 = TransactionResponseTime only; 2 = ResponseTime only; default = 0)
|
590
|
-
int log_type
|
590
|
+
int log_type, // log type (0 = stderr; 1 = stdout; 2 = file; 3 = null; 4 = disabled; default = 0)
|
591
|
+
int defer_init // defer init (0 = disable; 1 = enabled, parent process will not init oboe but fork child process will init oboe; default = 0)
|
591
592
|
) {
|
592
593
|
oboe_init_options_t options;
|
593
594
|
memset(&options, 0, sizeof(options));
|
594
|
-
options.version =
|
595
|
+
options.version = 17;
|
595
596
|
oboe_init_options_set_defaults(&options);
|
596
597
|
|
597
598
|
if (hostname_alias != "") {
|
@@ -628,6 +629,7 @@ Reporter::Reporter(
|
|
628
629
|
options.stdout_clear_nonblocking = stdout_clear_nonblocking;
|
629
630
|
options.metric_format = metric_format;
|
630
631
|
options.log_type = log_type;
|
632
|
+
options.defer_init = defer_init;
|
631
633
|
init_status = oboe_init(&options);
|
632
634
|
}
|
633
635
|
|
@@ -694,7 +696,7 @@ std::string Config::getVersionString() {
|
|
694
696
|
OboeAPI::OboeAPI(const OboeAPIOptions& options) {
|
695
697
|
oboe_init_options_t oboe_options;
|
696
698
|
memset(&oboe_options, 0, sizeof(oboe_options));
|
697
|
-
oboe_options.version =
|
699
|
+
oboe_options.version = 17;
|
698
700
|
oboe_init_options_set_defaults(&oboe_options);
|
699
701
|
oboe_options.log_level = options.logging_options.level;
|
700
702
|
oboe_options.log_type = options.logging_options.type;
|
@@ -463,7 +463,8 @@ class Reporter : private oboe_reporter_t {
|
|
463
463
|
int stdout_clear_nonblocking, // flag indicating if the O_NONBLOCK flag on stdout should be cleared,
|
464
464
|
// only used in lambda reporter (off=0, on=1, default off)
|
465
465
|
int metric_format, // flag indicating the format of metric (0 = Both; 1 = TransactionResponseTime only; 2 = ResponseTime only; default = 0)
|
466
|
-
int log_type
|
466
|
+
int log_type, // log type (0 = stderr; 1 = stdout; 2 = file; 3 = null; 4 = disabled; default = 0)
|
467
|
+
int defer_init // defer init (0 = disable; 1 = enabled, parent process will not init oboe but fork child process will init oboe; default = 0)
|
467
468
|
);
|
468
469
|
|
469
470
|
~Reporter();
|