solarwinds_apm 5.1.2 → 5.1.4
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/.gitignore +15 -0
- data/CHANGELOG.md +14 -0
- data/README.md +4 -2
- data/ext/oboe_metal/extconf.rb +18 -5
- data/ext/oboe_metal/lib/liboboe-1.0-aarch64.so.0.0.0.sha256 +1 -0
- data/ext/oboe_metal/lib/liboboe-1.0-alpine-aarch64.so.0.0.0.sha256 +1 -0
- data/ext/oboe_metal/lib/liboboe-1.0-alpine-x86_64.so.0.0.0.sha256 +1 -1
- data/ext/oboe_metal/lib/liboboe-1.0-x86_64.so.0.0.0.sha256 +1 -1
- data/ext/oboe_metal/src/VERSION +1 -1
- data/ext/oboe_metal/src/oboe.h +2 -4
- data/ext/oboe_metal/src/oboe_api.cpp +7 -12
- data/ext/oboe_metal/src/oboe_api.h +1 -3
- data/ext/oboe_metal/src/oboe_swig_wrap.cc +3 -19
- data/lib/oboe_metal.rb +9 -0
- data/lib/solarwinds_apm/cert/star.appoptics.com.issuer.crt +24 -0
- data/lib/solarwinds_apm/inst/redis.rb +36 -29
- data/lib/solarwinds_apm/inst/redis_v4.rb +273 -0
- data/lib/solarwinds_apm/oboe_init_options.rb +23 -6
- data/lib/solarwinds_apm/util.rb +116 -42
- data/lib/solarwinds_apm/version.rb +1 -1
- data/solarwinds_apm.gemspec +5 -2
- metadata +6 -12
- data/.github/CODEOWNERS +0 -1
- data/.github/ISSUE_TEMPLATE/bug-or-feature-request.md +0 -16
- data/.github/workflows/build_and_release_gem.yml +0 -108
- data/.github/workflows/build_for_packagecloud.yml +0 -59
- data/.github/workflows/docker-images.yml +0 -53
- data/.github/workflows/run_cpluplus_tests.yml +0 -73
- data/.github/workflows/run_tests.yml +0 -154
- data/.github/workflows/scripts/test_install.rb +0 -28
- data/.github/workflows/swig/swig-v4.0.2.tar.gz +0 -0
- data/.github/workflows/test_on_4_linux.yml +0 -161
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b56699604e8448a606d69ed23ba957622c4b70d8d2cbcf070526105f2dcff87
|
4
|
+
data.tar.gz: 5b0f55643f2ea9072418c66c62a6f9ea4ca87fea74fbcec66574a341e0510c82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77f2c0e8315832f92204bc0cdd29d6588f83cbf2751f8dfac2fb0402c65091c96238f0192da4473b99a0cf5197b44a66839f7d1c58fb5521bd11ce1a96defc6
|
7
|
+
data.tar.gz: 53c8e3740a5361fa4f9e403cf863f2044d821a58a7c42ac8708c859781c363b168af78e39da50b2ceeda783b752205cf0c0cb5bdf86afa7ffa4e63e80ae4dffe
|
data/.gitignore
CHANGED
@@ -41,3 +41,18 @@ gemfiles/vendor*
|
|
41
41
|
lib/libsolarwinds_apm.so
|
42
42
|
vendor/
|
43
43
|
|
44
|
+
# test & test script
|
45
|
+
tmp.rb
|
46
|
+
apm.collector.st-ssp.solarwinds.com
|
47
|
+
test/run_tests/.ruby_version_ubuntu
|
48
|
+
test/run_tests/.ruby_version_alpine
|
49
|
+
test/run_tests/.ruby_version_centos
|
50
|
+
test/run_tests/.ruby_version_ubuntu
|
51
|
+
|
52
|
+
redis-test.*
|
53
|
+
|
54
|
+
# compiling
|
55
|
+
ext/oboe_metal/verify
|
56
|
+
|
57
|
+
# mac DS_Store
|
58
|
+
.DS_Store
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,20 @@ https://github.com/solarwindscloud/solarwinds-apm-ruby/releases
|
|
3
3
|
|
4
4
|
Dates in this file are in the format MM/DD/YYYY.
|
5
5
|
|
6
|
+
# solarwinds_apm 5.1.4 (11/23/2022)
|
7
|
+
|
8
|
+
This release includes the following features:
|
9
|
+
|
10
|
+
* Update to the latest redis-rb gem (> 5.x)
|
11
|
+
* Update latest liboboe library (11.1.0)
|
12
|
+
* Start to support solarwinds-apm-ruby arm64/aarch64
|
13
|
+
* Init message update for swo/nh backends
|
14
|
+
|
15
|
+
Pushed to Rubygems:
|
16
|
+
|
17
|
+
https://rubygems.org/gems/solarwinds_apm/versions/5.1.4
|
18
|
+
|
19
|
+
|
6
20
|
# solarwinds_apm 5.1.0 (09/15/2022)
|
7
21
|
|
8
22
|
This release includes the following features:
|
data/README.md
CHANGED
@@ -11,7 +11,8 @@ It requires an [Solarwinds] account to view metrics. Get yours,
|
|
11
11
|
|
12
12
|
[](https://badge.fury.io/rb/solarwinds_apm)
|
13
13
|
|
14
|
-
[](https://github.com/solarwindscloud/solarwinds-apm-ruby/actions/workflows/test_on_4_linux.yml)
|
15
|
+
|
15
16
|
[](https://github.com/appoptics/appoptics-apm-ruby/actions/workflows/run_cpluplus_tests.yml)
|
16
17
|
|
17
18
|
[comment]: <> ([](https://codeclimate.com/github/appoptics/appoptics-apm-ruby/maintainability))
|
@@ -363,7 +364,7 @@ To make this simpler, we've included a few rake tasks to automate this process:
|
|
363
364
|
|
364
365
|
```bash
|
365
366
|
rake clean # make sure no old stuff is around
|
366
|
-
rake
|
367
|
+
rake fetch_oboe_file["stg"] # download c-files from staging
|
367
368
|
rake compile # Build the gem's c extension
|
368
369
|
```
|
369
370
|
|
@@ -381,3 +382,4 @@ See the README in the test directory.
|
|
381
382
|
Copyright (c) 2018 SolarWinds, LLC
|
382
383
|
|
383
384
|
Released under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
385
|
+
|
data/ext/oboe_metal/extconf.rb
CHANGED
@@ -27,26 +27,39 @@ ao_include = File.join(ext_dir, 'src')
|
|
27
27
|
|
28
28
|
# Download the appropriate liboboe from Staging or Production
|
29
29
|
version = File.read(File.join(ao_include, 'VERSION')).strip
|
30
|
-
if ENV['
|
30
|
+
if ENV['OBOE_DEV'].to_s.downcase == 'true'
|
31
|
+
ao_path = "https://solarwinds-apm-staging.s3.us-west-2.amazonaws.com/apm/c-lib/nightly"
|
32
|
+
puts 'Fetching c-lib from DEVELOPMENT Build'
|
33
|
+
elsif ENV['OBOE_STAGING'].to_s.downcase == 'true'
|
31
34
|
ao_path = File.join('https://agent-binaries.global.st-ssp.solarwinds.com/apm/c-lib/', version)
|
32
35
|
puts 'Fetching c-lib from STAGING'
|
33
36
|
else
|
34
37
|
ao_path = File.join('https://agent-binaries.cloud.solarwinds.com/apm/c-lib/', version)
|
35
38
|
end
|
36
39
|
|
37
|
-
ao_arch =
|
40
|
+
ao_arch = "x86_64"
|
41
|
+
system_arch = `uname -m` # for mac, the command is `uname` # "Darwin\n"; try `uname -a`
|
42
|
+
case system_arch.gsub("\n","")
|
43
|
+
when "x86_64"
|
44
|
+
ao_arch = "x86_64"
|
45
|
+
when "aarch64"
|
46
|
+
ao_arch = "aarch64"
|
47
|
+
end
|
48
|
+
|
38
49
|
if File.exist?('/etc/alpine-release')
|
39
50
|
version = File.read('/etc/alpine-release').strip
|
40
51
|
|
52
|
+
tmp_ao_arch = ao_arch.clone
|
41
53
|
ao_arch =
|
42
54
|
if Gem::Version.new(version) < Gem::Version.new('3.9')
|
43
|
-
|
55
|
+
"alpine-libressl-#{tmp_ao_arch}"
|
44
56
|
else # openssl
|
45
|
-
|
57
|
+
"alpine-#{tmp_ao_arch}"
|
46
58
|
end
|
47
59
|
end
|
48
60
|
|
49
61
|
ao_clib = "liboboe-1.0-#{ao_arch}.so.0.0.0"
|
62
|
+
ao_clib = "liboboe-1.0-#{ao_arch}.so" if ENV['OBOE_DEV'].to_s.downcase == 'true' # for dev build only
|
50
63
|
ao_item = File.join(ao_path, ao_clib)
|
51
64
|
ao_checksum_file = File.join(ao_lib_dir, "#{ao_clib}.sha256")
|
52
65
|
clib = File.join(ao_lib_dir, ao_clib)
|
@@ -138,4 +151,4 @@ if success
|
|
138
151
|
$stderr.puts '=================================================================='
|
139
152
|
create_makefile('oboe_noop', 'noop')
|
140
153
|
end
|
141
|
-
end
|
154
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
ae491260c3b2dfbb2ada97de0c94e78424b2eb5bf19b2b752c25301057270c30
|
@@ -0,0 +1 @@
|
|
1
|
+
a1f5406931ce82b0297bbb1b2b22b151c544e47babc43f0116274f95002ce85e
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
ede3fcc827faba4d6cf09d2dd59a41325c462c9093994c2c2df202ae57416733
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
079abfef35a869c3469908a62b97ad6f0f98f85a6f79e3c60265b251dc07dac3
|
data/ext/oboe_metal/src/VERSION
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
11.1.0
|
2
2
|
|
data/ext/oboe_metal/src/oboe.h
CHANGED
@@ -169,7 +169,7 @@ typedef struct oboe_metric_tag {
|
|
169
169
|
} oboe_metric_tag_t;
|
170
170
|
|
171
171
|
typedef struct oboe_init_options {
|
172
|
-
int version; // the version of this structure (currently on version
|
172
|
+
int version; // the version of this structure (currently on version 15)
|
173
173
|
const char *hostname_alias; // optional hostname alias
|
174
174
|
int log_level; // level at which log messages will be written to log file (0-6)
|
175
175
|
// use LOGLEVEL_DEFAULT for default log level
|
@@ -182,7 +182,7 @@ typedef struct oboe_init_options {
|
|
182
182
|
const char *reporter; // the reporter to be used (ssl, upd, file, null, lambda)
|
183
183
|
const char *host; // collector endpoint (reporter=ssl), udp address (reporter=udp), or file path (reporter=file)
|
184
184
|
const char *service_key; // the service key
|
185
|
-
const char *
|
185
|
+
const char *certificates; // content of SSL certificates, passed to gRPC::SslCredentialsOptions() for collector connection verification
|
186
186
|
int buffer_size; // size of the message buffer
|
187
187
|
int trace_metrics; // flag indicating if trace metrics reporting should be enabled (default) or disabled
|
188
188
|
int histogram_precision; // the histogram precision (only for ssl)
|
@@ -194,8 +194,6 @@ typedef struct oboe_init_options {
|
|
194
194
|
const char *proxy; // HTTP proxy address and port to be used for the gRPC connection
|
195
195
|
int stdout_clear_nonblocking; // flag indicating if the O_NONBLOCK flag on stdout should be cleared,
|
196
196
|
// only used in lambda reporter (off=0, on=1, default off)
|
197
|
-
int is_grpc_clean_hack_enabled; // flag indicating if custom grpc clean hack enabled (default 0)
|
198
|
-
int mode; // depreciated; value is ignored
|
199
197
|
int metric_format; // flag indicating the format of metric (0 = Both; 1 = TransactionResponseTime only; 2 = ResponseTime only; default = 0)
|
200
198
|
} oboe_init_options_t;
|
201
199
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
**/
|
8
8
|
|
9
9
|
#include "oboe_api.h"
|
10
|
-
|
10
|
+
#include <algorithm>
|
11
11
|
/////// Metatdata ///////
|
12
12
|
|
13
13
|
Metadata::Metadata(const oboe_metadata_t *md) {
|
@@ -202,9 +202,8 @@ bool Context::isSampled() {
|
|
202
202
|
}
|
203
203
|
|
204
204
|
std::string Context::validateTransformServiceName(std::string service_key) {
|
205
|
-
char service_key_cpy[71 + 1 + 256]; // Flawfinder: ignore, key=71, colon=1, name<=255
|
206
|
-
|
207
|
-
strncpy(service_key_cpy, service_key.c_str(), sizeof(service_key_cpy) - 1); // Flawfinder: ignore
|
205
|
+
char service_key_cpy[71 + 1 + 256] = {0}; // Flawfinder: ignore, key=71, colon=1, name<=255
|
206
|
+
std::copy_n(service_key.begin(), std::min(service_key.size(), sizeof(service_key_cpy)), std::begin(service_key_cpy));
|
208
207
|
int len = strlen(service_key_cpy); // Flawfinder: ignore
|
209
208
|
int ret = oboe_validate_transform_service_name(service_key_cpy, &len);
|
210
209
|
|
@@ -591,7 +590,7 @@ Reporter::Reporter(
|
|
591
590
|
std::string reporter, // the reporter to be used ("ssl", "upd", "file", "null")
|
592
591
|
std::string host, // collector endpoint (reporter=ssl), udp address (reporter=udp), or file path (reporter=file)
|
593
592
|
std::string service_key, // the service key (also known as access_key)
|
594
|
-
std::string
|
593
|
+
std::string certificates, // content of SSL certificates, passed to gRPC::SslCredentialsOptions() for collector connection verification
|
595
594
|
|
596
595
|
int buffer_size, // size of the message buffer
|
597
596
|
int trace_metrics, // flag indicating if trace metrics reporting should be enabled (default) or disabled
|
@@ -604,13 +603,11 @@ Reporter::Reporter(
|
|
604
603
|
std::string grpc_proxy, // HTTP proxy address and port to be used for the gRPC connection
|
605
604
|
int stdout_clear_nonblocking, // flag indicating if the O_NONBLOCK flag on stdout should be cleared,
|
606
605
|
// only used in lambda reporter (off=0, on=1, default off)
|
607
|
-
int is_grpc_clean_hack_enabled, // flag indicating if custom grpc clean hack enabled (default 0)
|
608
|
-
int w3c_trace_format, // tag indicating trace id format (0 - legacy Xtrace, 1 - w3c)
|
609
606
|
int metric_format // flag indicating the format of metric (0 = Both; 1 = TransactionResponseTime only; 2 = ResponseTime only; default = 0)
|
610
607
|
) {
|
611
608
|
oboe_init_options_t options;
|
612
609
|
memset(&options, 0, sizeof(options));
|
613
|
-
options.version =
|
610
|
+
options.version = 15;
|
614
611
|
oboe_init_options_set_defaults(&options);
|
615
612
|
|
616
613
|
if (hostname_alias != "") {
|
@@ -631,8 +628,8 @@ Reporter::Reporter(
|
|
631
628
|
if (service_key != "") {
|
632
629
|
options.service_key = service_key.c_str();
|
633
630
|
}
|
634
|
-
if (
|
635
|
-
options.
|
631
|
+
if (certificates != "") {
|
632
|
+
options.certificates = certificates.c_str();
|
636
633
|
}
|
637
634
|
options.buffer_size = buffer_size;
|
638
635
|
options.trace_metrics = trace_metrics;
|
@@ -645,8 +642,6 @@ Reporter::Reporter(
|
|
645
642
|
options.proxy = grpc_proxy.c_str();
|
646
643
|
}
|
647
644
|
options.stdout_clear_nonblocking = stdout_clear_nonblocking;
|
648
|
-
options.is_grpc_clean_hack_enabled = is_grpc_clean_hack_enabled;
|
649
|
-
options.mode = w3c_trace_format;
|
650
645
|
options.metric_format = metric_format;
|
651
646
|
init_status = oboe_init(&options);
|
652
647
|
}
|
@@ -411,7 +411,7 @@ class Reporter : private oboe_reporter_t {
|
|
411
411
|
std::string reporter, // the reporter to be used ("ssl", "upd", "file", "null")
|
412
412
|
std::string host, // collector endpoint (reporter=ssl), udp address (reporter=udp), or file path (reporter=file)
|
413
413
|
std::string service_key, // the service key (also known as access_key)
|
414
|
-
std::string
|
414
|
+
std::string certificates, // content of SSL certificates, passed to gRPC::SslCredentialsOptions() for collector connection verification
|
415
415
|
|
416
416
|
int buffer_size, // size of the message buffer
|
417
417
|
int trace_metrics, // flag indicating if trace metrics reporting should be enabled (default) or disabled
|
@@ -424,8 +424,6 @@ class Reporter : private oboe_reporter_t {
|
|
424
424
|
std::string grpc_proxy, // HTTP proxy address and port to be used for the gRPC connection
|
425
425
|
int stdout_clear_nonblocking, // flag indicating if the O_NONBLOCK flag on stdout should be cleared,
|
426
426
|
// only used in lambda reporter (off=0, on=1, default off)
|
427
|
-
int is_grpc_clean_hack_enabled, // flag indicating if custom grpc clean hack enabled (default 0)
|
428
|
-
int w3c_trace_format, // depreciated; value is ignored
|
429
427
|
int metric_format // flag indicating the format of metric (0 = Both; 1 = TransactionResponseTime only; 2 = ResponseTime only; default = 0)
|
430
428
|
);
|
431
429
|
|
@@ -6806,8 +6806,6 @@ _wrap_new_Reporter(int argc, VALUE *argv, VALUE self) {
|
|
6806
6806
|
std::string arg19 ;
|
6807
6807
|
int arg20 ;
|
6808
6808
|
int arg21 ;
|
6809
|
-
int arg22 ;
|
6810
|
-
int arg23 ;
|
6811
6809
|
int val2 ;
|
6812
6810
|
int ecode2 = 0 ;
|
6813
6811
|
int val4 ;
|
@@ -6836,14 +6834,10 @@ _wrap_new_Reporter(int argc, VALUE *argv, VALUE self) {
|
|
6836
6834
|
int ecode20 = 0 ;
|
6837
6835
|
int val21 ;
|
6838
6836
|
int ecode21 = 0 ;
|
6839
|
-
int val22 ;
|
6840
|
-
int ecode22 = 0 ;
|
6841
|
-
int val23 ;
|
6842
|
-
int ecode23 = 0 ;
|
6843
6837
|
Reporter *result = 0 ;
|
6844
6838
|
|
6845
|
-
if ((argc <
|
6846
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for
|
6839
|
+
if ((argc < 21) || (argc > 21)) {
|
6840
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 21)",argc); SWIG_fail;
|
6847
6841
|
}
|
6848
6842
|
{
|
6849
6843
|
std::string *ptr = (std::string *)0;
|
@@ -6978,17 +6972,7 @@ _wrap_new_Reporter(int argc, VALUE *argv, VALUE self) {
|
|
6978
6972
|
SWIG_exception_fail(SWIG_ArgError(ecode21), Ruby_Format_TypeError( "", "int","Reporter", 21, argv[20] ));
|
6979
6973
|
}
|
6980
6974
|
arg21 = static_cast< int >(val21);
|
6981
|
-
|
6982
|
-
if (!SWIG_IsOK(ecode22)) {
|
6983
|
-
SWIG_exception_fail(SWIG_ArgError(ecode22), Ruby_Format_TypeError( "", "int","Reporter", 22, argv[21] ));
|
6984
|
-
}
|
6985
|
-
arg22 = static_cast< int >(val22);
|
6986
|
-
ecode23 = SWIG_AsVal_int(argv[22], &val23);
|
6987
|
-
if (!SWIG_IsOK(ecode23)) {
|
6988
|
-
SWIG_exception_fail(SWIG_ArgError(ecode23), Ruby_Format_TypeError( "", "int","Reporter", 23, argv[22] ));
|
6989
|
-
}
|
6990
|
-
arg23 = static_cast< int >(val23);
|
6991
|
-
result = (Reporter *)new Reporter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21,arg22,arg23);
|
6975
|
+
result = (Reporter *)new Reporter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21);
|
6992
6976
|
DATA_PTR(self) = result;
|
6993
6977
|
return self;
|
6994
6978
|
fail:
|
data/lib/oboe_metal.rb
CHANGED
@@ -66,6 +66,15 @@ module SolarWindsAPM
|
|
66
66
|
File.truncate(SolarWindsAPM::OboeInitOptions.instance.host, 0)
|
67
67
|
end
|
68
68
|
|
69
|
+
##
|
70
|
+
# hard_clear_all_traces
|
71
|
+
#
|
72
|
+
# Truncates the trace output file to zero by deleting the original bson file
|
73
|
+
#
|
74
|
+
def hard_clear_all_traces
|
75
|
+
File.delete(SolarWindsAPM::OboeInitOptions.instance.host) if File.exist?(SolarWindsAPM::OboeInitOptions.instance.host)
|
76
|
+
end
|
77
|
+
|
69
78
|
##
|
70
79
|
# get_all_traces
|
71
80
|
#
|
@@ -0,0 +1,24 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIID8TCCAtmgAwIBAgIJAMoDz7Npas2/MA0GCSqGSIb3DQEBCwUAMIGOMQswCQYD
|
3
|
+
VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5j
|
4
|
+
aXNjbzEVMBMGA1UECgwMTGlicmF0byBJbmMuMRUwEwYDVQQDDAxBcHBPcHRpY3Mg
|
5
|
+
Q0ExJDAiBgkqhkiG9w0BCQEWFXN1cHBvcnRAYXBwb3B0aWNzLmNvbTAeFw0xNzA5
|
6
|
+
MTUyMjAxMzlaFw0yNzA5MTMyMjAxMzlaMIGOMQswCQYDVQQGEwJVUzETMBEGA1UE
|
7
|
+
CAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEVMBMGA1UECgwM
|
8
|
+
TGlicmF0byBJbmMuMRUwEwYDVQQDDAxBcHBPcHRpY3MgQ0ExJDAiBgkqhkiG9w0B
|
9
|
+
CQEWFXN1cHBvcnRAYXBwb3B0aWNzLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
|
10
|
+
ADCCAQoCggEBAOxO0wsGba3iI4r3L5BMST0rAO/gGaUhpQre6nRwVTmPCnLw1bmn
|
11
|
+
GdiFgYv/oRRwU+VieumHSQqoOmyFrg+ajGmvUDp2WqQ0It+XhcbaHFiAp2H7+mLf
|
12
|
+
cUH6S43/em0WUxZHeRzRupRDyO1bX6Hh2jgxykivlFrn5HCIQD5Hx1/SaZoW9v2n
|
13
|
+
oATCbgFOiPW6kU/AVs4R0VBujon13HCehVelNKkazrAEBT1i6RvdOB6aQQ32seW+
|
14
|
+
gLV5yVWSPEJvA9ZJqad/nQ8EQUMSSlVN191WOjp4bGpkJE1svs7NmM+Oja50W56l
|
15
|
+
qOH5eWermr/8qWjdPlDJ+I0VkgN0UyHVuRECAwEAAaNQME4wHQYDVR0OBBYEFOuL
|
16
|
+
KDTFhRQXwlBRxhPqhukrNYeRMB8GA1UdIwQYMBaAFOuLKDTFhRQXwlBRxhPqhukr
|
17
|
+
NYeRMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJQtH446NZhjusy6
|
18
|
+
iCyvmnD95ybfNPDpjHmNx5n9Y6w9n+9y1o3732HUJE+WjvbLS3h1o7wujGKMcRJn
|
19
|
+
7I7eTDd26ZhLvnh5/AitYjdxrtUkQDgyxwLFJKhZu0ik2vXqj0fL961/quJL8Gyp
|
20
|
+
hNj3Nf7WMohQMSohEmCCX2sHyZGVGYmQHs5omAtkH/NNySqmsWNcpgd3M0aPDRBZ
|
21
|
+
5VFreOSGKBTJnoLNqods/S9RV0by84hm3j6aQ/tMDIVE9VCJtrE6evzC0MWyVFwR
|
22
|
+
ftgwcxyEq5SkiR+6BCwdzAMqADV37TzXDHLjwSrMIrgLV5xZM20Kk6chxI5QAr/f
|
23
|
+
7tsqAxw=
|
24
|
+
-----END CERTIFICATE-----
|
@@ -57,10 +57,9 @@ module SolarWindsAPM
|
|
57
57
|
# KVOp (no KVKey)
|
58
58
|
|
59
59
|
def self.included(klass)
|
60
|
-
#
|
61
|
-
|
62
|
-
SolarWindsAPM::Util.method_alias(klass, :
|
63
|
-
SolarWindsAPM::Util.method_alias(klass, :call_pipeline, ::Redis::Client)
|
60
|
+
# call_pipelined is alias of call in redisclient middlewares
|
61
|
+
SolarWindsAPM::Util.method_alias(klass, :call, ::RedisClient)
|
62
|
+
SolarWindsAPM::Util.method_alias(klass, :call_pipelined, ::RedisClient)
|
64
63
|
end
|
65
64
|
|
66
65
|
# Given any Redis operation command array, this method
|
@@ -69,12 +68,14 @@ module SolarWindsAPM
|
|
69
68
|
# @param command [Array] the Redis operation array
|
70
69
|
# @param r [Return] the return value from the operation
|
71
70
|
# @return [Hash] the Key/Values to report
|
72
|
-
def extract_trace_details(command, r)
|
71
|
+
def extract_trace_details(command, r, config)
|
72
|
+
SolarWindsAPM.logger.debug "extract_trace_details command => #{command.inspect}"
|
73
73
|
kvs = {}
|
74
74
|
op = command.first
|
75
|
+
op = op.to_sym
|
75
76
|
|
76
77
|
kvs[:KVOp] = command[0]
|
77
|
-
kvs[:RemoteHost] =
|
78
|
+
kvs[:RemoteHost] = config.host
|
78
79
|
unless NO_KEY_OPS.include?(op) || op == :del && command[1..-1].flatten.count > 1
|
79
80
|
if command[1].is_a?(Array)
|
80
81
|
kvs[:KVKey] = command[1].first
|
@@ -115,7 +116,7 @@ module SolarWindsAPM
|
|
115
116
|
kvs[:KVHit] = r.nil? ? 0 : 1
|
116
117
|
|
117
118
|
when :hdel, :hexists, :hget, :hset, :hsetnx
|
118
|
-
kvs[:field] = command[2] unless command[2].is_a?(Array)
|
119
|
+
kvs[:field] = command[2] unless (command[2] && command[3]) # replace the idiom of command[2].is_a?(Array)
|
119
120
|
if op == :hget
|
120
121
|
kvs[:KVHit] = r.nil? ? 0 : 1
|
121
122
|
end
|
@@ -136,7 +137,7 @@ module SolarWindsAPM
|
|
136
137
|
else
|
137
138
|
kvs[:Script] = command[2]
|
138
139
|
end
|
139
|
-
elsif command[1] ==
|
140
|
+
elsif command[1] == "exists"
|
140
141
|
if command[2].is_a?(Array)
|
141
142
|
kvs[:KVKey] = command[2].inspect
|
142
143
|
else
|
@@ -166,6 +167,10 @@ module SolarWindsAPM
|
|
166
167
|
end
|
167
168
|
end # case op
|
168
169
|
end # if KV_COLLECT_MAP[op]
|
170
|
+
# turn every string into number
|
171
|
+
# kvs.each do |k,v|
|
172
|
+
# kvs[k] = v.to_i if v.is_a(String)
|
173
|
+
# end
|
169
174
|
rescue StandardError => e
|
170
175
|
SolarWindsAPM.logger.debug "[solarwinds_apm/redis] Error collecting redis KVs: #{e.message}"
|
171
176
|
SolarWindsAPM.logger.debug e.backtrace.join('\n')
|
@@ -178,16 +183,17 @@ module SolarWindsAPM
|
|
178
183
|
#
|
179
184
|
# @param pipeline [Redis::Pipeline] the Redis pipeline instance
|
180
185
|
# @return [Hash] the Key/Values to report
|
181
|
-
def extract_pipeline_details(
|
186
|
+
def extract_pipeline_details(commands, config)
|
187
|
+
SolarWindsAPM.logger.debug "extract_pipeline_details command => #{commands.inspect}"
|
182
188
|
kvs = {}
|
183
189
|
|
184
|
-
kvs[:RemoteHost] =
|
190
|
+
kvs[:RemoteHost] = config.host
|
185
191
|
kvs[:Backtrace] = SolarWindsAPM::API.backtrace if SolarWindsAPM::Config[:redis][:collect_backtraces]
|
186
192
|
|
187
|
-
command_count =
|
193
|
+
command_count = commands.count
|
188
194
|
kvs[:KVOpCount] = command_count
|
189
195
|
|
190
|
-
kvs[:KVOp] = if
|
196
|
+
kvs[:KVOp] = if commands.first == :multi
|
191
197
|
:multi
|
192
198
|
else
|
193
199
|
:pipeline
|
@@ -197,7 +203,7 @@ module SolarWindsAPM
|
|
197
203
|
# of ops is reasonable
|
198
204
|
if command_count < 12
|
199
205
|
ops = []
|
200
|
-
|
206
|
+
commands.each do |c|
|
201
207
|
ops << c.first
|
202
208
|
end
|
203
209
|
kvs[:KVOps] = ops.join(', ')
|
@@ -210,17 +216,19 @@ module SolarWindsAPM
|
|
210
216
|
end
|
211
217
|
|
212
218
|
#
|
213
|
-
# The wrapper method for
|
219
|
+
# The wrapper method for RedisClient.call. Here
|
214
220
|
# (when tracing) we capture KVs to report and pass
|
215
221
|
# the call along
|
216
222
|
#
|
217
|
-
def call_with_sw_apm(command, &block)
|
223
|
+
def call_with_sw_apm(command, config, &block)
|
224
|
+
SolarWindsAPM.logger.debug "call_with_sw_apm command => #{command.inspect}"
|
218
225
|
if SolarWindsAPM.tracing?
|
219
226
|
SolarWindsAPM::API.log_entry(:redis, {})
|
220
227
|
|
221
228
|
begin
|
222
|
-
r = call_without_sw_apm(command, &block)
|
223
|
-
report_kvs = extract_trace_details(command, r)
|
229
|
+
r = call_without_sw_apm(command, config, &block)
|
230
|
+
report_kvs = extract_trace_details(command, r, config)
|
231
|
+
SolarWindsAPM.logger.debug "call_with_sw_apm command => #{report_kvs.inspect}"
|
224
232
|
r
|
225
233
|
rescue StandardError => e
|
226
234
|
SolarWindsAPM::API.log_exception(:redis, e)
|
@@ -230,26 +238,25 @@ module SolarWindsAPM
|
|
230
238
|
end
|
231
239
|
|
232
240
|
else
|
233
|
-
call_without_sw_apm(command, &block)
|
241
|
+
call_without_sw_apm(command, config, &block)
|
234
242
|
end
|
235
243
|
end
|
236
244
|
|
237
245
|
#
|
238
|
-
# The wrapper method for
|
246
|
+
# The wrapper method for RedisClient.call_pipeline. Here
|
239
247
|
# (when tracing) we capture KVs to report and pass the call along
|
240
|
-
#
|
241
|
-
def
|
248
|
+
# 5.0.0 + removed the deprecated pipelined and multi signature. Commands now MUST be called on the block argument, not the original redis instance
|
249
|
+
def call_pipelined_with_sw_apm(commands, config, &block)
|
250
|
+
SolarWindsAPM.logger.debug "call_pipelined_with_sw_apm command => #{commands.inspect}"
|
242
251
|
if SolarWindsAPM.tracing?
|
243
252
|
# Fall back to the raw tracing API so we can pass KVs
|
244
253
|
# back on exit (a limitation of the SolarWindsAPM::API.trace
|
245
254
|
# block method) This removes the need for an info
|
246
255
|
# event to send additonal KVs
|
247
256
|
SolarWindsAPM::API.log_entry(:redis, {})
|
248
|
-
|
249
|
-
report_kvs = extract_pipeline_details(pipeline)
|
250
|
-
|
257
|
+
report_kvs = extract_pipeline_details(commands, config)
|
251
258
|
begin
|
252
|
-
|
259
|
+
call_pipelined_without_sw_apm(commands, config, &block)
|
253
260
|
rescue StandardError => e
|
254
261
|
SolarWindsAPM::API.log_exception(:redis, e)
|
255
262
|
raise
|
@@ -257,7 +264,7 @@ module SolarWindsAPM
|
|
257
264
|
SolarWindsAPM::API.log_exit(:redis, report_kvs)
|
258
265
|
end
|
259
266
|
else
|
260
|
-
|
267
|
+
call_pipelined_without_sw_apm(commands, config, &block)
|
261
268
|
end
|
262
269
|
end
|
263
270
|
end
|
@@ -266,8 +273,8 @@ module SolarWindsAPM
|
|
266
273
|
end
|
267
274
|
|
268
275
|
if SolarWindsAPM::Config[:redis][:enabled]
|
269
|
-
if defined?(
|
270
|
-
SolarWindsAPM.logger.info
|
271
|
-
|
276
|
+
if defined?(::RedisClient)
|
277
|
+
SolarWindsAPM.logger.info "[solarwinds_apm/loading] Instrumenting redis #{Redis::VERSION}" if SolarWindsAPM::Config[:verbose]
|
278
|
+
::RedisClient.register(SolarWindsAPM::Inst::Redis::Client)
|
272
279
|
end
|
273
280
|
end
|