appsignal 3.0.15-java → 3.0.16-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +1 -1
- data/CHANGELOG.md +35 -0
- data/build_matrix.yml +1 -1
- data/ext/agent.yml +25 -25
- data/ext/appsignal_extension.c +201 -0
- data/lib/appsignal/cli/diagnose.rb +16 -5
- data/lib/appsignal/config.rb +62 -56
- data/lib/appsignal/extension/jruby.rb +147 -0
- data/lib/appsignal/extension.rb +5 -0
- data/lib/appsignal/span.rb +92 -0
- data/lib/appsignal/transaction.rb +12 -1
- data/lib/appsignal/version.rb +1 -1
- data/script/lint_git +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +14 -9
- data/spec/lib/appsignal/config_spec.rb +26 -20
- data/spec/lib/appsignal/span_spec.rb +141 -0
- data/spec/lib/appsignal/transaction_spec.rb +25 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61a15fcd31446aaa4f813957c6480260938926b5aeaa737529e168bc79b5ea9b
|
4
|
+
data.tar.gz: 3a0f796a71985048fac24343f92a79d041069470280fb78f7a51121f934397b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e4764dab62e7dcb8e166d29c9b2264e47cd9285abc2b06affa8898232fa6f9ef3e734de67e3a361b01bb981acec1fdfcde4ec945162a583572a8834c68f23a6
|
7
|
+
data.tar.gz: 74d11d47c32a02ffdc5da5f42aaed1c113188bb780123304492516c4aecf0b1f14fb65b8c2a3dc711dc0dd43892598b960c3a4f1b61ccbe55cc1b979ac0e8ce1
|
data/.semaphore/semaphore.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,40 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 3.0.16
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- [fe226e99](https://github.com/appsignal/appsignal-ruby/commit/fe226e99f262bfa46e7a7630defe2fe90f8a3a13) patch - Add experimental Span API. This is not loaded by default and we do not recommend using it yet.
|
8
|
+
- [84b1ba18](https://github.com/appsignal/appsignal-ruby/commit/84b1ba18e50440e5c71d27319e560c5df180d0df) patch - Add "log_level" config option. This new option allows you to define the kind of messages
|
9
|
+
AppSignal's will log and up. The "debug" option will log all "debug", "info", "warning" and
|
10
|
+
"error" log messages. The default value is: "info"
|
11
|
+
|
12
|
+
The allowed values are:
|
13
|
+
- error
|
14
|
+
- warning
|
15
|
+
- info
|
16
|
+
- debug
|
17
|
+
- [6b2ecca2](https://github.com/appsignal/appsignal-ruby/commit/6b2ecca24603061f1b35800f60b0ee6e9f314998) patch - Clean up index values in error messages from PG index violation errors.
|
18
|
+
|
19
|
+
### Changed
|
20
|
+
|
21
|
+
- [25bde454](https://github.com/appsignal/appsignal-ruby/commit/25bde454f82776f8d2ea1fd4dbb00a73e414076e) patch - Order the config options alphabetically in diagnose report output.
|
22
|
+
- [fe226e99](https://github.com/appsignal/appsignal-ruby/commit/fe226e99f262bfa46e7a7630defe2fe90f8a3a13) patch - Use the `filter_parameters` and `filter_session_data` options to filter out specific parameter keys or session data keys for the experimental Span API. Previously only the (undocumented) `filter_data_keys` config option was available to filter out all kinds of app data.
|
23
|
+
- [fe226e99](https://github.com/appsignal/appsignal-ruby/commit/fe226e99f262bfa46e7a7630defe2fe90f8a3a13) patch - Standardize diagnose validation failure message. Explain the diagnose request failed and why.
|
24
|
+
- [fe226e99](https://github.com/appsignal/appsignal-ruby/commit/fe226e99f262bfa46e7a7630defe2fe90f8a3a13) patch - Bump agent to v-5b63505
|
25
|
+
|
26
|
+
- Only filter parameters with the `filter_parameters` config option.
|
27
|
+
- Only filter session data with the `filter_session_data` config option.
|
28
|
+
- [3ad95ea5](https://github.com/appsignal/appsignal-ruby/commit/3ad95ea5dd8a9488d293a652231950bd4a721e6c) patch - Bump agent to v-0db01c2
|
29
|
+
|
30
|
+
- Add `log_level` config option in extension.
|
31
|
+
- Deprecate `debug` and `transaction_debug_mode` option in extension.
|
32
|
+
|
33
|
+
### Deprecated
|
34
|
+
|
35
|
+
- [84b1ba18](https://github.com/appsignal/appsignal-ruby/commit/84b1ba18e50440e5c71d27319e560c5df180d0df) patch - Deprecate "debug" and "transaction_debug_mode" config options in favor of the new "log_level"
|
36
|
+
config option.
|
37
|
+
|
3
38
|
## 3.0.15
|
4
39
|
|
5
40
|
- [b40b3b4f](https://github.com/appsignal/appsignal-ruby/commit/b40b3b4f5264c6b69f9515b53806435258c73086) patch - Print String values in the diagnose report surrounded by quotes. Makes it more clear that it's a String value and not a label we print.
|
data/build_matrix.yml
CHANGED
data/ext/agent.yml
CHANGED
@@ -3,92 +3,92 @@
|
|
3
3
|
# appsignal-agent repository.
|
4
4
|
# Modifications to this file will be overwritten with the next agent release.
|
5
5
|
---
|
6
|
-
version:
|
6
|
+
version: 0db01c2
|
7
7
|
mirrors:
|
8
8
|
- https://appsignal-agent-releases.global.ssl.fastly.net
|
9
9
|
- https://d135dj0rjqvssy.cloudfront.net
|
10
10
|
triples:
|
11
11
|
x86_64-darwin:
|
12
12
|
static:
|
13
|
-
checksum:
|
13
|
+
checksum: 8a7cf35f8c9aa98e7778b720f33b38bfbdedcdedb0047035259ab187517be971
|
14
14
|
filename: appsignal-x86_64-darwin-all-static.tar.gz
|
15
15
|
dynamic:
|
16
|
-
checksum:
|
16
|
+
checksum: 4330f83a44db6f092b3f437d942204e9bf7f7022ae2cc24ade4e7b4137905d03
|
17
17
|
filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
|
18
18
|
universal-darwin:
|
19
19
|
static:
|
20
|
-
checksum:
|
20
|
+
checksum: 8a7cf35f8c9aa98e7778b720f33b38bfbdedcdedb0047035259ab187517be971
|
21
21
|
filename: appsignal-x86_64-darwin-all-static.tar.gz
|
22
22
|
dynamic:
|
23
|
-
checksum:
|
23
|
+
checksum: 4330f83a44db6f092b3f437d942204e9bf7f7022ae2cc24ade4e7b4137905d03
|
24
24
|
filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
|
25
25
|
aarch64-darwin:
|
26
26
|
static:
|
27
|
-
checksum:
|
27
|
+
checksum: a22cd07e656f194dd1921983be6507816b60c79bc0c4623d2cac5c88fda9d407
|
28
28
|
filename: appsignal-aarch64-darwin-all-static.tar.gz
|
29
29
|
dynamic:
|
30
|
-
checksum:
|
30
|
+
checksum: 0535e4506ccd2230dfa59fee5ba00ec6d3a2ff67693bf1b622e7a454fc1a5851
|
31
31
|
filename: appsignal-aarch64-darwin-all-dynamic.tar.gz
|
32
32
|
arm64-darwin:
|
33
33
|
static:
|
34
|
-
checksum:
|
34
|
+
checksum: a22cd07e656f194dd1921983be6507816b60c79bc0c4623d2cac5c88fda9d407
|
35
35
|
filename: appsignal-aarch64-darwin-all-static.tar.gz
|
36
36
|
dynamic:
|
37
|
-
checksum:
|
37
|
+
checksum: 0535e4506ccd2230dfa59fee5ba00ec6d3a2ff67693bf1b622e7a454fc1a5851
|
38
38
|
filename: appsignal-aarch64-darwin-all-dynamic.tar.gz
|
39
39
|
arm-darwin:
|
40
40
|
static:
|
41
|
-
checksum:
|
41
|
+
checksum: a22cd07e656f194dd1921983be6507816b60c79bc0c4623d2cac5c88fda9d407
|
42
42
|
filename: appsignal-aarch64-darwin-all-static.tar.gz
|
43
43
|
dynamic:
|
44
|
-
checksum:
|
44
|
+
checksum: 0535e4506ccd2230dfa59fee5ba00ec6d3a2ff67693bf1b622e7a454fc1a5851
|
45
45
|
filename: appsignal-aarch64-darwin-all-dynamic.tar.gz
|
46
46
|
aarch64-linux:
|
47
47
|
static:
|
48
|
-
checksum:
|
48
|
+
checksum: edf43f1a6b340c0afa07c7b71963def9bb68bd8d62d17cb64a7f7a36f84a4517
|
49
49
|
filename: appsignal-aarch64-linux-all-static.tar.gz
|
50
50
|
dynamic:
|
51
|
-
checksum:
|
51
|
+
checksum: 8390561e1a41e4b8bba8e4f92b9b49f957650eca21d281589143b9c3764f504e
|
52
52
|
filename: appsignal-aarch64-linux-all-dynamic.tar.gz
|
53
53
|
i686-linux:
|
54
54
|
static:
|
55
|
-
checksum:
|
55
|
+
checksum: 4179334f88dc32e00ce62aa196b3e47b4258b12ec48dd3cf722d4f6eeb4dc2c0
|
56
56
|
filename: appsignal-i686-linux-all-static.tar.gz
|
57
57
|
dynamic:
|
58
|
-
checksum:
|
58
|
+
checksum: 7c6bcc88e5d218c1986d1a9f1c9ad728c72e68a440656b2e9228d432ba300f86
|
59
59
|
filename: appsignal-i686-linux-all-dynamic.tar.gz
|
60
60
|
x86-linux:
|
61
61
|
static:
|
62
|
-
checksum:
|
62
|
+
checksum: 4179334f88dc32e00ce62aa196b3e47b4258b12ec48dd3cf722d4f6eeb4dc2c0
|
63
63
|
filename: appsignal-i686-linux-all-static.tar.gz
|
64
64
|
dynamic:
|
65
|
-
checksum:
|
65
|
+
checksum: 7c6bcc88e5d218c1986d1a9f1c9ad728c72e68a440656b2e9228d432ba300f86
|
66
66
|
filename: appsignal-i686-linux-all-dynamic.tar.gz
|
67
67
|
x86_64-linux:
|
68
68
|
static:
|
69
|
-
checksum:
|
69
|
+
checksum: d602823277cac752bdea742d928112cef457bc61ee05b960b316fc052f0cc714
|
70
70
|
filename: appsignal-x86_64-linux-all-static.tar.gz
|
71
71
|
dynamic:
|
72
|
-
checksum:
|
72
|
+
checksum: 2e9e955672dec266b408770638c0503a072410e03526b1eef2170326b083a42f
|
73
73
|
filename: appsignal-x86_64-linux-all-dynamic.tar.gz
|
74
74
|
x86_64-linux-musl:
|
75
75
|
static:
|
76
|
-
checksum:
|
76
|
+
checksum: dfbdff116339b99613fff6ed4092b772e58f0d3e667b7de347b4215fb7ea9d62
|
77
77
|
filename: appsignal-x86_64-linux-musl-all-static.tar.gz
|
78
78
|
dynamic:
|
79
|
-
checksum:
|
79
|
+
checksum: 560835ec657b471d50c765a932385cd0e3b6bdca54d2a5e28b4203e43869cf3d
|
80
80
|
filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
|
81
81
|
x86_64-freebsd:
|
82
82
|
static:
|
83
|
-
checksum:
|
83
|
+
checksum: e31a7d89798193857247bd3590a554782fcff64b65d3da86d9c451d3147e961a
|
84
84
|
filename: appsignal-x86_64-freebsd-all-static.tar.gz
|
85
85
|
dynamic:
|
86
|
-
checksum:
|
86
|
+
checksum: e7f007cc385a23977ca93b58439dc720d703b7cc5929ef52a7acd59f74703b92
|
87
87
|
filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
88
88
|
amd64-freebsd:
|
89
89
|
static:
|
90
|
-
checksum:
|
90
|
+
checksum: e31a7d89798193857247bd3590a554782fcff64b65d3da86d9c451d3147e961a
|
91
91
|
filename: appsignal-x86_64-freebsd-all-static.tar.gz
|
92
92
|
dynamic:
|
93
|
-
checksum:
|
93
|
+
checksum: e7f007cc385a23977ca93b58439dc720d703b7cc5929ef52a7acd59f74703b92
|
94
94
|
filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
data/ext/appsignal_extension.c
CHANGED
@@ -19,6 +19,7 @@ VALUE Appsignal;
|
|
19
19
|
VALUE Extension;
|
20
20
|
VALUE Transaction;
|
21
21
|
VALUE Data;
|
22
|
+
VALUE Span;
|
22
23
|
|
23
24
|
static VALUE start(VALUE self) {
|
24
25
|
appsignal_start();
|
@@ -545,6 +546,180 @@ static VALUE data_to_s(VALUE self) {
|
|
545
546
|
}
|
546
547
|
}
|
547
548
|
|
549
|
+
static VALUE root_span_new(VALUE self, VALUE namespace) {
|
550
|
+
appsignal_span_t* span;
|
551
|
+
|
552
|
+
Check_Type(namespace, T_STRING);
|
553
|
+
|
554
|
+
span = appsignal_create_root_span(make_appsignal_string(namespace));
|
555
|
+
|
556
|
+
if (span) {
|
557
|
+
return Data_Wrap_Struct(Span, NULL, appsignal_free_span, span);
|
558
|
+
} else {
|
559
|
+
return Qnil;
|
560
|
+
}
|
561
|
+
}
|
562
|
+
|
563
|
+
static VALUE child_span_new(VALUE self) {
|
564
|
+
appsignal_span_t* parent;
|
565
|
+
appsignal_span_t* span;
|
566
|
+
|
567
|
+
Data_Get_Struct(self, appsignal_span_t, parent);
|
568
|
+
|
569
|
+
span = appsignal_create_child_span(parent);
|
570
|
+
|
571
|
+
if (span) {
|
572
|
+
return Data_Wrap_Struct(Span, NULL, appsignal_free_span, span);
|
573
|
+
} else {
|
574
|
+
return Qnil;
|
575
|
+
}
|
576
|
+
}
|
577
|
+
|
578
|
+
static VALUE set_span_name(VALUE self, VALUE name) {
|
579
|
+
appsignal_span_t* span;
|
580
|
+
|
581
|
+
Check_Type(name, T_STRING);
|
582
|
+
|
583
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
584
|
+
|
585
|
+
appsignal_set_span_name(span, make_appsignal_string(name));
|
586
|
+
return Qnil;
|
587
|
+
}
|
588
|
+
|
589
|
+
static VALUE add_span_error(VALUE self, VALUE name, VALUE message, VALUE backtrace) {
|
590
|
+
appsignal_span_t* span;
|
591
|
+
appsignal_data_t* backtrace_data;
|
592
|
+
|
593
|
+
Check_Type(name, T_STRING);
|
594
|
+
Check_Type(message, T_STRING);
|
595
|
+
Check_Type(backtrace, RUBY_T_DATA);
|
596
|
+
|
597
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
598
|
+
Data_Get_Struct(backtrace, appsignal_data_t, backtrace_data);
|
599
|
+
|
600
|
+
appsignal_add_span_error(
|
601
|
+
span,
|
602
|
+
make_appsignal_string(name),
|
603
|
+
make_appsignal_string(message),
|
604
|
+
backtrace_data
|
605
|
+
);
|
606
|
+
return Qnil;
|
607
|
+
}
|
608
|
+
|
609
|
+
static VALUE set_span_sample_data(VALUE self, VALUE key, VALUE payload) {
|
610
|
+
appsignal_span_t* span;
|
611
|
+
appsignal_data_t* payload_data;
|
612
|
+
|
613
|
+
Check_Type(key, T_STRING);
|
614
|
+
Check_Type(payload, RUBY_T_DATA);
|
615
|
+
|
616
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
617
|
+
Data_Get_Struct(payload, appsignal_data_t, payload_data);
|
618
|
+
|
619
|
+
appsignal_set_span_sample_data(
|
620
|
+
span,
|
621
|
+
make_appsignal_string(key),
|
622
|
+
payload_data
|
623
|
+
);
|
624
|
+
return Qnil;
|
625
|
+
}
|
626
|
+
|
627
|
+
static VALUE set_span_attribute_string(VALUE self, VALUE key, VALUE value) {
|
628
|
+
appsignal_span_t* span;
|
629
|
+
|
630
|
+
Check_Type(key, T_STRING);
|
631
|
+
Check_Type(value, T_STRING);
|
632
|
+
|
633
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
634
|
+
|
635
|
+
appsignal_set_span_attribute_string(
|
636
|
+
span,
|
637
|
+
make_appsignal_string(key),
|
638
|
+
make_appsignal_string(value)
|
639
|
+
);
|
640
|
+
|
641
|
+
return Qnil;
|
642
|
+
}
|
643
|
+
|
644
|
+
static VALUE set_span_attribute_int(VALUE self, VALUE key, VALUE value) {
|
645
|
+
appsignal_span_t* span;
|
646
|
+
VALUE value_type = TYPE(value);
|
647
|
+
|
648
|
+
Check_Type(key, T_STRING);
|
649
|
+
|
650
|
+
if (value_type != T_FIXNUM && value_type != T_BIGNUM) {
|
651
|
+
rb_raise(rb_eTypeError, "wrong argument type %s (expected Integer)", rb_obj_classname(value));
|
652
|
+
}
|
653
|
+
|
654
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
655
|
+
|
656
|
+
appsignal_set_span_attribute_int(
|
657
|
+
span,
|
658
|
+
make_appsignal_string(key),
|
659
|
+
NUM2LONG(value)
|
660
|
+
);
|
661
|
+
|
662
|
+
return Qnil;
|
663
|
+
}
|
664
|
+
|
665
|
+
static VALUE set_span_attribute_bool(VALUE self, VALUE key, VALUE value) {
|
666
|
+
appsignal_span_t* span;
|
667
|
+
|
668
|
+
Check_Type(key, T_STRING);
|
669
|
+
|
670
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
671
|
+
|
672
|
+
appsignal_set_span_attribute_bool(
|
673
|
+
span,
|
674
|
+
make_appsignal_string(key),
|
675
|
+
RTEST(value)
|
676
|
+
);
|
677
|
+
|
678
|
+
return Qnil;
|
679
|
+
}
|
680
|
+
|
681
|
+
static VALUE set_span_attribute_double(VALUE self, VALUE key, VALUE value) {
|
682
|
+
appsignal_span_t* span;
|
683
|
+
|
684
|
+
Check_Type(key, T_STRING);
|
685
|
+
Check_Type(value, T_FLOAT);
|
686
|
+
|
687
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
688
|
+
|
689
|
+
appsignal_set_span_attribute_double(
|
690
|
+
span,
|
691
|
+
make_appsignal_string(key),
|
692
|
+
NUM2DBL(value)
|
693
|
+
);
|
694
|
+
|
695
|
+
return Qnil;
|
696
|
+
}
|
697
|
+
|
698
|
+
static VALUE span_to_json(VALUE self) {
|
699
|
+
appsignal_span_t* span;
|
700
|
+
appsignal_string_t json;
|
701
|
+
|
702
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
703
|
+
|
704
|
+
json = appsignal_span_to_json(span);
|
705
|
+
|
706
|
+
if (json.len == 0) {
|
707
|
+
return Qnil;
|
708
|
+
} else {
|
709
|
+
return make_ruby_string(json);
|
710
|
+
}
|
711
|
+
}
|
712
|
+
|
713
|
+
static VALUE close_span(VALUE self) {
|
714
|
+
appsignal_span_t* span;
|
715
|
+
|
716
|
+
Data_Get_Struct(self, appsignal_span_t, span);
|
717
|
+
|
718
|
+
appsignal_close_span(span);
|
719
|
+
|
720
|
+
return Qnil;
|
721
|
+
}
|
722
|
+
|
548
723
|
static VALUE set_gauge(VALUE self, VALUE key, VALUE value, VALUE tags) {
|
549
724
|
appsignal_data_t* tags_data;
|
550
725
|
|
@@ -652,6 +827,7 @@ void Init_appsignal_extension(void) {
|
|
652
827
|
Extension = rb_define_class_under(Appsignal, "Extension", rb_cObject);
|
653
828
|
Transaction = rb_define_class_under(Extension, "Transaction", rb_cObject);
|
654
829
|
Data = rb_define_class_under(Extension, "Data", rb_cObject);
|
830
|
+
Span = rb_define_class_under(Extension, "Span", rb_cObject);
|
655
831
|
|
656
832
|
// Starting and stopping
|
657
833
|
rb_define_singleton_method(Extension, "start", start, 0);
|
@@ -705,6 +881,31 @@ void Init_appsignal_extension(void) {
|
|
705
881
|
// Get JSON content of a data
|
706
882
|
rb_define_method(Data, "to_s", data_to_s, 0);
|
707
883
|
|
884
|
+
// Create a span
|
885
|
+
rb_define_singleton_method(Span, "root", root_span_new, 1);
|
886
|
+
rb_define_method(Span, "child", child_span_new, 0);
|
887
|
+
|
888
|
+
// Set span error
|
889
|
+
rb_define_method(Span, "add_error", add_span_error, 3);
|
890
|
+
|
891
|
+
// Set span sample data
|
892
|
+
rb_define_method(Span, "set_sample_data", set_span_sample_data, 2);
|
893
|
+
|
894
|
+
// Span name and namespace
|
895
|
+
rb_define_method(Span, "set_name", set_span_name, 1);
|
896
|
+
|
897
|
+
// Set attributes on a span
|
898
|
+
rb_define_method(Span, "set_attribute_string", set_span_attribute_string, 2);
|
899
|
+
rb_define_method(Span, "set_attribute_int", set_span_attribute_int, 2);
|
900
|
+
rb_define_method(Span, "set_attribute_bool", set_span_attribute_bool, 2);
|
901
|
+
rb_define_method(Span, "set_attribute_double", set_span_attribute_double, 2);
|
902
|
+
|
903
|
+
// Span to json
|
904
|
+
rb_define_method(Span, "to_json", span_to_json, 0);
|
905
|
+
|
906
|
+
// Close span
|
907
|
+
rb_define_method(Span, "close", close_span, 0);
|
908
|
+
|
708
909
|
// Other helper methods
|
709
910
|
rb_define_singleton_method(Extension, "install_allocation_event_hook", install_allocation_event_hook, 0);
|
710
911
|
rb_define_singleton_method(Extension, "running_in_container?", running_in_container, 0);
|
@@ -474,7 +474,6 @@ module Appsignal
|
|
474
474
|
:env => config.env_config
|
475
475
|
}
|
476
476
|
}
|
477
|
-
print_environment(config)
|
478
477
|
print_config_options(config)
|
479
478
|
end
|
480
479
|
|
@@ -483,7 +482,7 @@ module Appsignal
|
|
483
482
|
option = :env
|
484
483
|
option_sources = sources_for_option(option)
|
485
484
|
sources_label = config_sources_label(option, option_sources)
|
486
|
-
print "
|
485
|
+
print " environment: #{format_config_option(env)}"
|
487
486
|
|
488
487
|
if env == ""
|
489
488
|
message = " Warning: No environment set, no config loaded!\n" \
|
@@ -497,10 +496,22 @@ module Appsignal
|
|
497
496
|
end
|
498
497
|
|
499
498
|
def print_config_options(config)
|
500
|
-
|
499
|
+
# We add the nullified "environment" key to print it ordered
|
500
|
+
# instead of adding it at the top of the list.
|
501
|
+
ordered_config_options = config
|
502
|
+
.config_hash
|
503
|
+
.merge(:environment => nil)
|
504
|
+
.sort
|
505
|
+
|
506
|
+
ordered_config_options.each do |key, value|
|
501
507
|
option_sources = sources_for_option(key)
|
502
508
|
sources_label = config_sources_label(key, option_sources)
|
503
|
-
|
509
|
+
|
510
|
+
if key == :environment
|
511
|
+
print_environment(config)
|
512
|
+
else
|
513
|
+
puts " #{key}: #{format_config_option(value)}#{sources_label}"
|
514
|
+
end
|
504
515
|
end
|
505
516
|
|
506
517
|
puts "\nRead more about how the diagnose config output is rendered\n"\
|
@@ -566,7 +577,7 @@ module Appsignal
|
|
566
577
|
when "401"
|
567
578
|
["invalid", :red]
|
568
579
|
else
|
569
|
-
["Failed
|
580
|
+
["Failed to validate: status #{status}\n#{error.inspect}", :red]
|
570
581
|
end
|
571
582
|
data[:validation][:push_api_key] = result
|
572
583
|
puts_value "Validating Push API key", colorize(result, color)
|
data/lib/appsignal/config.rb
CHANGED
@@ -11,15 +11,26 @@ module Appsignal
|
|
11
11
|
include Appsignal::Utils::DeprecationMessage
|
12
12
|
|
13
13
|
DEFAULT_CONFIG = {
|
14
|
+
:ca_file_path => File.expand_path(File.join("../../../resources/cacert.pem"), __FILE__),
|
14
15
|
:debug => false,
|
15
|
-
:
|
16
|
+
:dns_servers => [],
|
17
|
+
:enable_allocation_tracking => true,
|
18
|
+
:enable_gc_instrumentation => false,
|
19
|
+
:enable_host_metrics => true,
|
20
|
+
:enable_minutely_probes => true,
|
21
|
+
:enable_statsd => true,
|
22
|
+
:endpoint => "https://push.appsignal.com",
|
23
|
+
:files_world_accessible => true,
|
24
|
+
:filter_parameters => [],
|
25
|
+
:filter_session_data => [],
|
16
26
|
:ignore_actions => [],
|
17
27
|
:ignore_errors => [],
|
18
28
|
:ignore_namespaces => [],
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
29
|
+
:instrument_net_http => true,
|
30
|
+
:instrument_redis => true,
|
31
|
+
:instrument_sequel => true,
|
32
|
+
:log => "file",
|
33
|
+
:log_level => "info",
|
23
34
|
:request_headers => %w[
|
24
35
|
HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING
|
25
36
|
HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_CONNECTION
|
@@ -27,56 +38,47 @@ module Appsignal
|
|
27
38
|
REQUEST_METHOD REQUEST_URI SERVER_NAME SERVER_PORT
|
28
39
|
SERVER_PROTOCOL
|
29
40
|
],
|
30
|
-
:
|
31
|
-
:
|
32
|
-
:instrument_redis => true,
|
33
|
-
:instrument_sequel => true,
|
41
|
+
:send_environment_metadata => true,
|
42
|
+
:send_params => true,
|
34
43
|
:skip_session_data => false,
|
35
|
-
:enable_allocation_tracking => true,
|
36
|
-
:enable_gc_instrumentation => false,
|
37
|
-
:enable_host_metrics => true,
|
38
|
-
:enable_minutely_probes => true,
|
39
|
-
:enable_statsd => true,
|
40
|
-
:ca_file_path => File.expand_path(File.join("../../../resources/cacert.pem"), __FILE__),
|
41
|
-
:dns_servers => [],
|
42
|
-
:files_world_accessible => true,
|
43
44
|
:transaction_debug_mode => false
|
44
45
|
}.freeze
|
45
46
|
|
46
47
|
ENV_TO_KEY_MAPPING = {
|
47
48
|
"APPSIGNAL_ACTIVE" => :active,
|
48
|
-
"APPSIGNAL_PUSH_API_KEY" => :push_api_key,
|
49
49
|
"APPSIGNAL_APP_NAME" => :name,
|
50
|
-
"
|
50
|
+
"APPSIGNAL_CA_FILE_PATH" => :ca_file_path,
|
51
51
|
"APPSIGNAL_DEBUG" => :debug,
|
52
|
-
"
|
53
|
-
"APPSIGNAL_LOG_PATH" => :log_path,
|
54
|
-
"APPSIGNAL_INSTRUMENT_NET_HTTP" => :instrument_net_http,
|
55
|
-
"APPSIGNAL_INSTRUMENT_REDIS" => :instrument_redis,
|
56
|
-
"APPSIGNAL_INSTRUMENT_SEQUEL" => :instrument_sequel,
|
57
|
-
"APPSIGNAL_SKIP_SESSION_DATA" => :skip_session_data,
|
58
|
-
"APPSIGNAL_IGNORE_ACTIONS" => :ignore_actions,
|
59
|
-
"APPSIGNAL_IGNORE_ERRORS" => :ignore_errors,
|
60
|
-
"APPSIGNAL_IGNORE_NAMESPACES" => :ignore_namespaces,
|
61
|
-
"APPSIGNAL_FILTER_PARAMETERS" => :filter_parameters,
|
62
|
-
"APPSIGNAL_FILTER_SESSION_DATA" => :filter_session_data,
|
63
|
-
"APPSIGNAL_SEND_ENVIRONMENT_METADATA" => :send_environment_metadata,
|
64
|
-
"APPSIGNAL_SEND_PARAMS" => :send_params,
|
65
|
-
"APPSIGNAL_HTTP_PROXY" => :http_proxy,
|
52
|
+
"APPSIGNAL_DNS_SERVERS" => :dns_servers,
|
66
53
|
"APPSIGNAL_ENABLE_ALLOCATION_TRACKING" => :enable_allocation_tracking,
|
67
54
|
"APPSIGNAL_ENABLE_GC_INSTRUMENTATION" => :enable_gc_instrumentation,
|
68
|
-
"APPSIGNAL_RUNNING_IN_CONTAINER" => :running_in_container,
|
69
|
-
"APPSIGNAL_WORKING_DIR_PATH" => :working_dir_path,
|
70
|
-
"APPSIGNAL_WORKING_DIRECTORY_PATH" => :working_directory_path,
|
71
55
|
"APPSIGNAL_ENABLE_HOST_METRICS" => :enable_host_metrics,
|
72
56
|
"APPSIGNAL_ENABLE_MINUTELY_PROBES" => :enable_minutely_probes,
|
73
57
|
"APPSIGNAL_ENABLE_STATSD" => :enable_statsd,
|
74
|
-
"APPSIGNAL_HOSTNAME" => :hostname,
|
75
|
-
"APPSIGNAL_CA_FILE_PATH" => :ca_file_path,
|
76
|
-
"APPSIGNAL_DNS_SERVERS" => :dns_servers,
|
77
58
|
"APPSIGNAL_FILES_WORLD_ACCESSIBLE" => :files_world_accessible,
|
59
|
+
"APPSIGNAL_FILTER_PARAMETERS" => :filter_parameters,
|
60
|
+
"APPSIGNAL_FILTER_SESSION_DATA" => :filter_session_data,
|
61
|
+
"APPSIGNAL_HOSTNAME" => :hostname,
|
62
|
+
"APPSIGNAL_HTTP_PROXY" => :http_proxy,
|
63
|
+
"APPSIGNAL_IGNORE_ACTIONS" => :ignore_actions,
|
64
|
+
"APPSIGNAL_IGNORE_ERRORS" => :ignore_errors,
|
65
|
+
"APPSIGNAL_IGNORE_NAMESPACES" => :ignore_namespaces,
|
66
|
+
"APPSIGNAL_INSTRUMENT_NET_HTTP" => :instrument_net_http,
|
67
|
+
"APPSIGNAL_INSTRUMENT_REDIS" => :instrument_redis,
|
68
|
+
"APPSIGNAL_INSTRUMENT_SEQUEL" => :instrument_sequel,
|
69
|
+
"APPSIGNAL_LOG" => :log,
|
70
|
+
"APPSIGNAL_LOG_LEVEL" => :log_level,
|
71
|
+
"APPSIGNAL_LOG_PATH" => :log_path,
|
72
|
+
"APPSIGNAL_PUSH_API_ENDPOINT" => :endpoint,
|
73
|
+
"APPSIGNAL_PUSH_API_KEY" => :push_api_key,
|
78
74
|
"APPSIGNAL_REQUEST_HEADERS" => :request_headers,
|
75
|
+
"APPSIGNAL_RUNNING_IN_CONTAINER" => :running_in_container,
|
76
|
+
"APPSIGNAL_SEND_ENVIRONMENT_METADATA" => :send_environment_metadata,
|
77
|
+
"APPSIGNAL_SEND_PARAMS" => :send_params,
|
78
|
+
"APPSIGNAL_SKIP_SESSION_DATA" => :skip_session_data,
|
79
79
|
"APPSIGNAL_TRANSACTION_DEBUG_MODE" => :transaction_debug_mode,
|
80
|
+
"APPSIGNAL_WORKING_DIRECTORY_PATH" => :working_directory_path,
|
81
|
+
"APPSIGNAL_WORKING_DIR_PATH" => :working_dir_path,
|
80
82
|
"APP_REVISION" => :revision
|
81
83
|
}.freeze
|
82
84
|
# @api private
|
@@ -86,6 +88,7 @@ module Appsignal
|
|
86
88
|
APPSIGNAL_HOSTNAME
|
87
89
|
APPSIGNAL_HTTP_PROXY
|
88
90
|
APPSIGNAL_LOG
|
91
|
+
APPSIGNAL_LOG_LEVEL
|
89
92
|
APPSIGNAL_LOG_PATH
|
90
93
|
APPSIGNAL_PUSH_API_ENDPOINT
|
91
94
|
APPSIGNAL_PUSH_API_KEY
|
@@ -268,32 +271,35 @@ module Appsignal
|
|
268
271
|
|
269
272
|
def write_to_environment # rubocop:disable Metrics/AbcSize
|
270
273
|
ENV["_APPSIGNAL_ACTIVE"] = active?.to_s
|
271
|
-
ENV["_APPSIGNAL_APP_PATH"] = root_path.to_s
|
272
274
|
ENV["_APPSIGNAL_AGENT_PATH"] = File.expand_path("../../../ext", __FILE__).to_s
|
275
|
+
ENV["_APPSIGNAL_APP_NAME"] = config_hash[:name]
|
276
|
+
ENV["_APPSIGNAL_APP_PATH"] = root_path.to_s
|
277
|
+
ENV["_APPSIGNAL_CA_FILE_PATH"] = config_hash[:ca_file_path].to_s
|
278
|
+
ENV["_APPSIGNAL_DEBUG_LOGGING"] = config_hash[:debug].to_s
|
279
|
+
ENV["_APPSIGNAL_DNS_SERVERS"] = config_hash[:dns_servers].join(",")
|
280
|
+
ENV["_APPSIGNAL_ENABLE_HOST_METRICS"] = config_hash[:enable_host_metrics].to_s
|
281
|
+
ENV["_APPSIGNAL_ENABLE_STATSD"] = config_hash[:enable_statsd].to_s
|
273
282
|
ENV["_APPSIGNAL_ENVIRONMENT"] = env
|
283
|
+
ENV["_APPSIGNAL_FILES_WORLD_ACCESSIBLE"] = config_hash[:files_world_accessible].to_s
|
284
|
+
ENV["_APPSIGNAL_FILTER_PARAMETERS"] = config_hash[:filter_parameters].join(",")
|
285
|
+
ENV["_APPSIGNAL_FILTER_SESSION_DATA"] = config_hash[:filter_session_data].join(",")
|
286
|
+
ENV["_APPSIGNAL_HOSTNAME"] = config_hash[:hostname].to_s
|
287
|
+
ENV["_APPSIGNAL_HTTP_PROXY"] = config_hash[:http_proxy]
|
288
|
+
ENV["_APPSIGNAL_IGNORE_ACTIONS"] = config_hash[:ignore_actions].join(",")
|
289
|
+
ENV["_APPSIGNAL_IGNORE_ERRORS"] = config_hash[:ignore_errors].join(",")
|
290
|
+
ENV["_APPSIGNAL_IGNORE_NAMESPACES"] = config_hash[:ignore_namespaces].join(",")
|
274
291
|
ENV["_APPSIGNAL_LANGUAGE_INTEGRATION_VERSION"] = "ruby-#{Appsignal::VERSION}"
|
275
|
-
ENV["_APPSIGNAL_DEBUG_LOGGING"] = config_hash[:debug].to_s
|
276
292
|
ENV["_APPSIGNAL_LOG"] = config_hash[:log]
|
293
|
+
ENV["_APPSIGNAL_LOG_LEVEL"] = config_hash[:log_level]
|
277
294
|
ENV["_APPSIGNAL_LOG_FILE_PATH"] = log_file_path.to_s if log_file_path
|
295
|
+
ENV["_APPSIGNAL_PROCESS_NAME"] = $PROGRAM_NAME
|
278
296
|
ENV["_APPSIGNAL_PUSH_API_ENDPOINT"] = config_hash[:endpoint]
|
279
297
|
ENV["_APPSIGNAL_PUSH_API_KEY"] = config_hash[:push_api_key]
|
280
|
-
ENV["_APPSIGNAL_APP_NAME"] = config_hash[:name]
|
281
|
-
ENV["_APPSIGNAL_HTTP_PROXY"] = config_hash[:http_proxy]
|
282
|
-
ENV["_APPSIGNAL_IGNORE_ACTIONS"] = config_hash[:ignore_actions].join(",")
|
283
|
-
ENV["_APPSIGNAL_IGNORE_ERRORS"] = config_hash[:ignore_errors].join(",")
|
284
|
-
ENV["_APPSIGNAL_IGNORE_NAMESPACES"] = config_hash[:ignore_namespaces].join(",")
|
285
298
|
ENV["_APPSIGNAL_RUNNING_IN_CONTAINER"] = config_hash[:running_in_container].to_s
|
286
|
-
ENV["_APPSIGNAL_WORKING_DIR_PATH"] = config_hash[:working_dir_path] if config_hash[:working_dir_path]
|
287
|
-
ENV["_APPSIGNAL_WORKING_DIRECTORY_PATH"] = config_hash[:working_directory_path] if config_hash[:working_directory_path]
|
288
|
-
ENV["_APPSIGNAL_ENABLE_HOST_METRICS"] = config_hash[:enable_host_metrics].to_s
|
289
|
-
ENV["_APPSIGNAL_HOSTNAME"] = config_hash[:hostname].to_s
|
290
|
-
ENV["_APPSIGNAL_PROCESS_NAME"] = $PROGRAM_NAME
|
291
|
-
ENV["_APPSIGNAL_CA_FILE_PATH"] = config_hash[:ca_file_path].to_s
|
292
|
-
ENV["_APPSIGNAL_DNS_SERVERS"] = config_hash[:dns_servers].join(",")
|
293
|
-
ENV["_APPSIGNAL_FILES_WORLD_ACCESSIBLE"] = config_hash[:files_world_accessible].to_s
|
294
|
-
ENV["_APPSIGNAL_TRANSACTION_DEBUG_MODE"] = config_hash[:transaction_debug_mode].to_s
|
295
299
|
ENV["_APPSIGNAL_SEND_ENVIRONMENT_METADATA"] = config_hash[:send_environment_metadata].to_s
|
296
|
-
ENV["
|
300
|
+
ENV["_APPSIGNAL_TRANSACTION_DEBUG_MODE"] = config_hash[:transaction_debug_mode].to_s
|
301
|
+
ENV["_APPSIGNAL_WORKING_DIRECTORY_PATH"] = config_hash[:working_directory_path] if config_hash[:working_directory_path]
|
302
|
+
ENV["_APPSIGNAL_WORKING_DIR_PATH"] = config_hash[:working_dir_path] if config_hash[:working_dir_path]
|
297
303
|
ENV["_APP_REVISION"] = config_hash[:revision].to_s
|
298
304
|
end
|
299
305
|
|