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
# Licensed under the Apache License, Version 2.0 (the "License");
4
+
# you may not use this file except in compliance with the License.
5
+
# You may obtain a copy of the License at
6
+
#
7
+
# http://www.apache.org/licenses/LICENSE-2.0
8
+
#
9
+
# Unless required by applicable law or agreed to in writing, software
10
+
# distributed under the License is distributed on an "AS IS" BASIS,
11
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+
# See the License for the specific language governing permissions and
13
+
# limitations under the License.
14
+
15
+
importabc
16
+
importrandom
17
+
18
+
19
+
classIdsGenerator(abc.ABC):
20
+
@abc.abstractmethod
21
+
defgenerate_span_id(self) ->int:
22
+
"""Get a new span ID.
23
+
24
+
Returns:
25
+
A 64-bit int for use as a span ID
26
+
"""
27
+
28
+
@abc.abstractmethod
29
+
defgenerate_trace_id(self) ->int:
30
+
"""Get a new trace ID.
31
+
32
+
Implementations should at least make the 64 least significant bits
33
+
uniformly random. Samplers like the `TraceIdRatioBased` sampler rely on
34
+
this randomness to make sampling decisions.
35
+
36
+
See `the specification on TraceIdRatioBased <https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/sdk.md#traceidratiobased>`_.
37
+
38
+
Returns:
39
+
A 128-bit int for use as a trace ID
40
+
"""
41
+
42
+
43
+
classRandomIdsGenerator(IdsGenerator):
44
+
"""The default IDs generator for TracerProvider which randomly generates all
- Add support for `OTEL_BSP_MAX_QUEUE_SIZE`, `OTEL_BSP_SCHEDULE_DELAY_MILLIS`, `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` and `OTEL_BSP_EXPORT_TIMEOUT_MILLIS` environment variables
0 commit comments