-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1063081 Bump opentelemetry-python dependencies to 1.23.0 (#19)
- Loading branch information
1 parent
51b5692
commit 01adb2b
Showing
15 changed files
with
435 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
src/snowflake/telemetry/_internal/encoder/otlp/proto/common/log_encoder.py
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/snowflake/telemetry/_internal/encoder/otlp/proto/common/metrics_encoder.py
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/snowflake/telemetry/_internal/encoder/otlp/proto/common/trace_encoder.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/snowflake-telemetry-test-utils/src/snowflake/telemetry/test/logs_test_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved. | ||
# | ||
|
||
import typing | ||
|
||
from opentelemetry.proto.logs.v1.logs_pb2 import ( | ||
LogsData, | ||
) | ||
from snowflake.telemetry._internal.exporter.otlp.proto.logs import ( | ||
LogWriter, | ||
) | ||
|
||
|
||
class InMemoryLogWriter(LogWriter): | ||
"""Implementation of :class:`.LogWriter` that stores protobufs in memory. | ||
This class is intended for testing purposes. It stores the deserialized | ||
protobuf messages in a list in memory that can be retrieved using the | ||
:func:`.get_finished_protos` method. | ||
""" | ||
|
||
def __init__(self): | ||
self._protos = [] | ||
|
||
def write_logs(self, serialized_logs: bytes) -> None: | ||
message = LogsData() | ||
message.ParseFromString(serialized_logs) | ||
self._protos.append(message) | ||
|
||
def get_finished_protos(self) -> typing.Tuple[LogsData, ...]: | ||
return tuple(self._protos) | ||
|
||
def clear(self): | ||
self._protos.clear() |
36 changes: 36 additions & 0 deletions
36
tests/snowflake-telemetry-test-utils/src/snowflake/telemetry/test/metrics_test_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# | ||
# Copyright (c) 2012-2024 Snowflake Computing Inc. All rights reserved. | ||
# | ||
|
||
import typing | ||
|
||
from opentelemetry.proto.metrics.v1.metrics_pb2 import ( | ||
MetricsData, | ||
) | ||
from snowflake.telemetry._internal.exporter.otlp.proto.metrics import ( | ||
MetricWriter, | ||
) | ||
|
||
|
||
class InMemoryMetricWriter(MetricWriter): | ||
"""Implementation of :class:`.MetricWriter` that stores protobufs in | ||
memory. | ||
This class is intended for testing purposes. It stores the deserialized | ||
protobuf messages in a list in memory that can be retrieved using the | ||
:func:`.get_finished_protos` method. | ||
""" | ||
|
||
def __init__(self): | ||
self._protos = [] | ||
|
||
def write_metrics(self, serialized_metrics: bytes) -> None: | ||
message = MetricsData() | ||
message.ParseFromString(serialized_metrics) | ||
self._protos.append(message) | ||
|
||
def get_finished_protos(self) -> typing.Tuple[MetricsData, ...]: | ||
return tuple(self._protos) | ||
|
||
def clear(self): | ||
self._protos.clear() |
Oops, something went wrong.