Commit f8170b6
committed
NCBC-4183: Ensure correctness of recorded metrics and improve performance of AppTelemetry
Motivation
----------
Currently the App Service Level Telemetry in the SDK is its own entity and service registered with the DI container.
Its lifecycle and metric reporting is separate from our existing metrics and histograms.
The goal is to integrate it to reduce duplicate logic, and allow other code to idiomatically subscribe to the exporter,
in order to reduce potential bugs and logic mismatch with the rest of our reporting.
Changes
-------
Fixes:
- Only start MeterListener when there's at least 1 AppTelemetry endpoint available
- Always send response to GET_TELEMETRY even when no metrics were collected
- Move Query operation tracking (total) after error handling to prevent double-counting
- _sum is now exporeted as an integer
- Add operation and error tracking in SearchIndexManager
- Ignore internal KV calls like GetCid etc by having GetAppTelemetryKvRequestType return null for unrecognized OpCodes
Rest:
- Add a connection string parameter for enable_app_telemetry
- Add an AppTelemetry MeterListener independent from the other user-overridable meters
Change-Id: If5349c2b2e7ccf8a5575d2f5066a0614c4be215b
Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/241927
Reviewed-by: Emilien Bevierre <emilien.bevierre@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>1 parent 2ebe062 commit f8170b6
39 files changed
Lines changed: 2311 additions & 1635 deletions
File tree
- src/Couchbase
- Analytics
- Core
- Configuration/Server
- Diagnostics/Metrics
- AppTelemetry
- IO/HTTP
- Management
- Buckets
- Collections
- Eventing
- Internal
- Search
- Users
- Query
- Search
- Views
- tests
- Couchbase.LoadTests/Core/Diagnostics/Metrics
- Couchbase.UnitTests
- Analytics
- Core
- Configuration/Server
- Diagnostics/Metrics
- Management
- Eventing
- Query
- Query
- Search
- Utils
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
609 | 607 | | |
610 | 608 | | |
611 | 609 | | |
612 | | - | |
| 610 | + | |
613 | 611 | | |
| 612 | + | |
614 | 613 | | |
615 | 614 | | |
616 | 615 | | |
617 | | - | |
| 616 | + | |
618 | 617 | | |
619 | 618 | | |
620 | | - | |
| 619 | + | |
621 | 620 | | |
622 | 621 | | |
623 | 622 | | |
| |||
631 | 630 | | |
632 | 631 | | |
633 | 632 | | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
643 | 645 | | |
644 | 646 | | |
645 | 647 | | |
| |||
718 | 720 | | |
719 | 721 | | |
720 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
721 | 736 | | |
722 | 737 | | |
723 | 738 | | |
724 | 739 | | |
725 | 740 | | |
726 | | - | |
| 741 | + | |
727 | 742 | | |
728 | 743 | | |
729 | 744 | | |
| |||
742 | 757 | | |
743 | 758 | | |
744 | 759 | | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
756 | 772 | | |
757 | 773 | | |
758 | 774 | | |
| |||
771 | 787 | | |
772 | 788 | | |
773 | 789 | | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
783 | 802 | | |
784 | 803 | | |
785 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
Lines changed: 35 additions & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
71 | 68 | | |
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
84 | 77 | | |
85 | 78 | | |
86 | 79 | | |
| |||
98 | 91 | | |
99 | 92 | | |
100 | 93 | | |
101 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
102 | 97 | | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
106 | 101 | | |
107 | 102 | | |
108 | | - | |
109 | | - | |
| 103 | + | |
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
128 | 110 | | |
129 | | - | |
130 | | - | |
| 111 | + | |
131 | 112 | | |
132 | | - | |
| 113 | + | |
133 | 114 | | |
134 | 115 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 116 | + | |
| 117 | + | |
144 | 118 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 119 | | |
151 | 120 | | |
152 | 121 | | |
153 | 122 | | |
154 | 123 | | |
155 | 124 | | |
156 | 125 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 126 | + | |
| 127 | + | |
164 | 128 | | |
165 | 129 | | |
166 | | - | |
| 130 | + | |
167 | 131 | | |
168 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
169 | 137 | | |
170 | 138 | | |
171 | 139 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 140 | + | |
182 | 141 | | |
183 | 142 | | |
184 | 143 | | |
185 | 144 | | |
| 145 | + | |
186 | 146 | | |
187 | 147 | | |
188 | 148 | | |
| |||
0 commit comments