File tree Expand file tree Collapse file tree 8 files changed +38
-107
lines changed
opentelemetry-exporter-otlp-proto-common
src/opentelemetry/exporter/otlp/proto/common/_internal
opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http Expand file tree Collapse file tree 8 files changed +38
-107
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ classifiers = [
2828]
2929dependencies = [
3030 " opentelemetry-proto == 1.35.0.dev" ,
31- " requests ~= 2.7" ,
3231]
3332
3433[project .urls ]
Original file line number Diff line number Diff line change 2727 TypeVar ,
2828)
2929
30- import requests
31-
3230from opentelemetry .proto .common .v1 .common_pb2 import AnyValue as PB2AnyValue
3331from opentelemetry .proto .common .v1 .common_pb2 import (
3432 ArrayValue as PB2ArrayValue ,
@@ -110,14 +108,6 @@ def _encode_key_value(
110108 )
111109
112110
113- def _is_retryable (resp : requests .Response ) -> bool :
114- if resp .status_code == 408 :
115- return True
116- if resp .status_code >= 500 and resp .status_code <= 599 :
117- return True
118- return False
119-
120-
121111def _encode_array (
122112 array : Sequence [Any ], allow_null : bool = False
123113) -> Sequence [PB2AnyValue ]:
Original file line number Diff line number Diff line change 11asgiref==3.7.2
22importlib-metadata==6.11.0
33iniconfig==2.0.0
4- requests == 2.7.0
54packaging==24.0
65pluggy==1.5.0
76protobuf==5.26.1
Original file line number Diff line number Diff line change 1+ # Copyright The OpenTelemetry Authors
2+ #
3+ # 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+ import requests
16+
17+ def _is_retryable (resp : requests .Response ) -> bool :
18+ if resp .status_code == 408 :
19+ return True
20+ if resp .status_code >= 500 and resp .status_code <= 599 :
21+ return True
22+ return False
Original file line number Diff line number Diff line change 2424import requests
2525from requests .exceptions import ConnectionError
2626
27- from opentelemetry .exporter .otlp .proto .common ._internal import (
28- _is_retryable ,
29- )
3027from opentelemetry .exporter .otlp .proto .common ._log_encoder import encode_logs
3128from opentelemetry .exporter .otlp .proto .http import (
3229 _OTLP_HTTP_HEADERS ,
3330 Compression ,
3431)
32+ from opentelemetry .exporter .otlp .proto .http ._common import (
33+ _is_retryable ,
34+ )
3535from opentelemetry .sdk ._logs import LogData
3636from opentelemetry .sdk ._logs .export import (
3737 LogExporter ,
Original file line number Diff line number Diff line change 3535
3636from opentelemetry .exporter .otlp .proto .common ._internal import (
3737 _get_resource_data ,
38- _is_retryable ,
3938)
4039from opentelemetry .exporter .otlp .proto .common ._internal .metrics_encoder import (
4140 OTLPMetricExporterMixin ,
4746 _OTLP_HTTP_HEADERS ,
4847 Compression ,
4948)
49+ from opentelemetry .exporter .otlp .proto .http ._common import (
50+ _is_retryable ,
51+ )
5052from opentelemetry .proto .collector .metrics .v1 .metrics_service_pb2 import ( # noqa: F401
5153 ExportMetricsServiceRequest ,
5254)
Original file line number Diff line number Diff line change 2424import requests
2525from requests .exceptions import ConnectionError
2626
27- from opentelemetry .exporter .otlp .proto .common ._internal import (
28- _is_retryable ,
29- )
3027from opentelemetry .exporter .otlp .proto .common .trace_encoder import (
3128 encode_spans ,
3229)
3330from opentelemetry .exporter .otlp .proto .http import (
3431 _OTLP_HTTP_HEADERS ,
3532 Compression ,
3633)
34+ from opentelemetry .exporter .otlp .proto .http ._common import (
35+ _is_retryable ,
36+ )
3737from opentelemetry .sdk .environment_variables import (
3838 OTEL_EXPORTER_OTLP_CERTIFICATE ,
3939 OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE ,
You can’t perform that action at this time.
0 commit comments