You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: opentelemetry-sdk/src/opentelemetry/sdk/metrics/export/exemplars.py
+23-42Lines changed: 23 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -12,24 +12,23 @@
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
-
"""
16
-
Exemplars are sample data points for aggregators. For more information, see the `spec <https://github.com/open-telemetry/oteps/pull/113>`_
15
+
"""Exemplars are sample data points for aggregators. For more information, see the `spec <https://github.com/open-telemetry/oteps/pull/113>`_
17
16
18
-
Every synchronous aggregator is instrumented with two exemplar recorders:
19
-
1. A "trace" exemplar sampler, which only samples exemplars if they have a sampled trace context (and can pick exemplars with other biases, ie min + max).
20
-
2. A "statistical" exemplar sampler, which samples exemplars without bias (ie no preferenced for traced exemplars)
17
+
Every synchronous aggregator is instrumented with two exemplar recorders:
18
+
1. A "trace" exemplar sampler, which only samples exemplars if they have a sampled trace context (and can pick exemplars with other biases, ie min + max).
19
+
2. A "statistical" exemplar sampler, which samples exemplars without bias (ie no preferenced for traced exemplars)
21
20
22
-
To use an exemplar recorder, pass in two arguments to the aggregator config in views (see the :ref:`Exemplars` example for an example):
23
-
"num_exemplars": The number of exemplars to record (if applicable, in each bucket). Note that in non-statistical mode the recorder may not use "num_exemplars"
24
-
"statistical_exemplars": If exemplars should be recorded statistically
21
+
To use an exemplar recorder, pass in two arguments to the aggregator config in views (see the :ref:`Exemplars` example for an example):
22
+
"num_exemplars": The number of exemplars to record (if applicable, in each bucket). Note that in non-statistical mode the recorder may not use "num_exemplars"
23
+
"statistical_exemplars": If exemplars should be recorded statistically
25
24
26
-
For exemplars to be recorded, `num_exemplars` must be greater than 0.
25
+
For exemplars to be recorded, `num_exemplars` must be greater than 0.
27
26
"""
28
27
29
28
importabc
30
29
importitertools
31
30
importrandom
32
-
fromtypingimportList, Optional, Tuple, Union
31
+
fromtypingimportList, Optional, Tuple, Type, Union
33
32
34
33
fromopentelemetry.contextimportget_current
35
34
fromopentelemetry.utilimporttime_ns
@@ -95,7 +94,8 @@ def sample_count(self):
95
94
"""For statistical exemplars, how many measurements a single exemplar represents"""
96
95
returnself._sample_count
97
96
98
-
defset_sample_count(self, count: float):
97
+
@sample_count.setter
98
+
defsample_count(self, count: float):
99
99
self._sample_count=count
100
100
101
101
@@ -122,11 +122,14 @@ def sample_set(self):
122
122
Return the list of exemplars that have been sampled
0 commit comments