diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index daf809f..9da58e0 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -48,5 +48,11 @@ jobs: pip install . - name: Test with pytest run: | - pip install ./tests/snowflake-telemetry-test-utils + pip install "./tests/snowflake-telemetry-test-utils[all]" pytest + - name: Test with tox + run: | + version="${{ matrix.python-version }}" + version_without_dot="${version//./}" + pip install tox + env TOX_SKIP_ENV='^(?!py'"$version_without_dot"'-)' tox diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml index 5f79026..8c82eae 100644 --- a/.github/workflows/check-codegen.yml +++ b/.github/workflows/check-codegen.yml @@ -10,6 +10,7 @@ on: paths: - "scripts/**" - "src/snowflake/telemetry/_internal/opentelemetry/proto/**" + - "src/snowflake/telemetry/_internal/proto_impl/**" - "src/snowflake/telemetry/serialize/**" - ".github/workflows/check-codegen.yml" pull_request: @@ -17,6 +18,7 @@ on: paths: - "scripts/**" - "src/snowflake/telemetry/_internal/opentelemetry/proto/**" + - "src/snowflake/telemetry/_internal/proto_impl/**" - "src/snowflake/telemetry/serialize/**" - ".github/workflows/check-codegen.yml" @@ -29,10 +31,28 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.11" - - name: Run codegen script + - name: Run py codegen script run: | rm -rf src/snowflake/telemetry/_internal/opentelemetry/proto/ + rm -rf src/snowflake/telemetry/_internal/proto_impl/py/ ./scripts/proto_codegen.sh - name: Check for changes run: | git diff --exit-code || { echo "Code generation produced changes! Regenerate the code using ./scripts/proto_codegen.sh"; exit 1; } + check-codegen-pb: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.9" + - name: Run pb codegen script + run: | + rm -rf src/snowflake/telemetry/_internal/proto_impl/v3/ + rm -rf src/snowflake/telemetry/_internal/proto_impl/v5/ + ./scripts/proto_codegen_vX.sh 3 + ./scripts/proto_codegen_vX.sh 5 + - name: Check for changes + run: | + git diff --exit-code || { echo "Code generation produced changes! Regenerate the code using ./scripts/proto_codegen_vX.sh "; exit 1; } diff --git a/.github/workflows/check-vendor.yml b/.github/workflows/check-vendor.yml index dc521fb..a0eb7e2 100644 --- a/.github/workflows/check-vendor.yml +++ b/.github/workflows/check-vendor.yml @@ -19,7 +19,7 @@ on: - ".github/workflows/check-vendor.yml" jobs: - check-codegen: + check-vendor: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index ca9d2b3..875bf87 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ cd snowflake-telemetry-python python3 -m venv .venv source .venv/bin/activate pip install --upgrade pip -pip install . ./tests/snowflake-telemetry-test-utils +pip install . "./tests/snowflake-telemetry-test-utils[all]" ``` ### Code generation diff --git a/scripts/gen-requirements-v3.txt b/scripts/gen-requirements-v3.txt new file mode 100644 index 0000000..339f815 --- /dev/null +++ b/scripts/gen-requirements-v3.txt @@ -0,0 +1,2 @@ +grpcio-tools==1.48.1 +mypy-protobuf~=3.0.0 diff --git a/scripts/gen-requirements-v5.txt b/scripts/gen-requirements-v5.txt new file mode 100644 index 0000000..06b38c4 --- /dev/null +++ b/scripts/gen-requirements-v5.txt @@ -0,0 +1,2 @@ +grpcio-tools==1.63.2 +mypy-protobuf~=3.5.0 diff --git a/scripts/plugin.py b/scripts/plugin.py index d3d0c7f..e1d938a 100755 --- a/scripts/plugin.py +++ b/scripts/plugin.py @@ -21,13 +21,24 @@ EnumValueDescriptorProto, DescriptorProto, ) -from jinja2 import Environment, FileSystemLoader +import jinja2 import black import isort.api INLINE_OPTIMIZATION = True -FILE_PATH_PREFIX = "snowflake.telemetry._internal" -FILE_NAME_SUFFIX = "_marshaler" +# The location of the pure python implementation of the protobuf messages +PY_PATH_PREFIX = "snowflake.telemetry._internal.proto_impl.py" +PY_PATH_RELATIVE = "proto_impl/py" +# The location of the protobuf v3.X.X and v4.X.X implementation of the protobuf messages +PB3_PATH_PREFIX = "snowflake.telemetry._internal.proto_impl.v3" +# The location of the protobuf v5.X.X implementation of the protobuf messages +PB5_PATH_PREFIX = "snowflake.telemetry._internal.proto_impl.v5" + +# Suffixes for the generated files +PROXY_FILE_SUFFIX = "_proxy" +PY_FILE_SUFFIX = "_marshaler" +PB_FILE_SUFFIX = "_pb2" + OPENTELEMETRY_PROTO_DIR = os.environ["OPENTELEMETRY_PROTO_DIR"] # Inline utility functions @@ -284,6 +295,9 @@ class FileTemplate: imports: List[str] = field(default_factory=list) name: str = "" preamble: str = "" + path_py: str = "" + path_pb3: str = "" + path_pb5: str = "" @staticmethod def from_descriptor(descriptor: FileDescriptorProto) -> "FileTemplate": @@ -304,17 +318,41 @@ def from_descriptor(descriptor: FileDescriptorProto) -> "FileTemplate": if descriptor.name.startswith(path): continue path = path.replace("/", ".") - path = f"{FILE_PATH_PREFIX}.{path}{FILE_NAME_SUFFIX}" + path = f"{PY_PATH_PREFIX}.{path}{PY_FILE_SUFFIX}" imports.append(path) + path = descriptor.name.replace(".proto", "").replace("/", ".") + path_py = f"{PY_PATH_PREFIX}.{path}{PY_FILE_SUFFIX}" + path_pb = f"{PB3_PATH_PREFIX}.{path}{PB_FILE_SUFFIX}" + path_pb5 = f"{PB5_PATH_PREFIX}.{path}{PB_FILE_SUFFIX}" + return FileTemplate( messages=[MessageTemplate.from_descriptor(message) for message in descriptor.message_type], enums=[EnumTemplate.from_descriptor(enum) for enum in descriptor.enum_type], imports=imports, name=descriptor.name, preamble=preamble, + path_py=path_py, + path_pb3=path_pb, + path_pb5=path_pb5, ) +def format_code_str(code: str) -> str: + code = isort.api.sort_code_string( + code = code, + show_diff=False, + profile="black", + combine_as_imports=True, + lines_after_imports=2, + quiet=True, + force_grid_wrap=2, + ) + code = black.format_str( + src_contents=code, + mode=black.Mode(), + ) + return code + def main(): request = plugin.CodeGeneratorRequest() request.ParseFromString(sys.stdin.buffer.read()) @@ -324,30 +362,26 @@ def main(): # https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md response.supported_features = plugin.CodeGeneratorResponse.FEATURE_PROTO3_OPTIONAL - template_env = Environment(loader=FileSystemLoader(f"{os.path.dirname(os.path.realpath(__file__))}/templates")) + template_env = jinja2.Environment(loader=jinja2.FileSystemLoader(f"{os.path.dirname(os.path.realpath(__file__))}/templates")) jinja_body_template = template_env.get_template("template.py.jinja2") + jinja_proxy_template = template_env.get_template("proxy.py.jinja2") for proto_file in request.proto_file: - file_name = re.sub(r"\.proto$", f"{FILE_NAME_SUFFIX}.py", proto_file.name) - file_descriptor_proto = proto_file - - file_template = FileTemplate.from_descriptor(file_descriptor_proto) + file_template = FileTemplate.from_descriptor(proto_file) + # Generate the marshaler file + file_name = re.sub(r"\.proto$", f"{PY_FILE_SUFFIX}.py", proto_file.name) + file_name = f"{PY_PATH_RELATIVE}/{file_name}" code = jinja_body_template.render(file_template=file_template) - code = isort.api.sort_code_string( - code = code, - show_diff=False, - profile="black", - combine_as_imports=True, - lines_after_imports=2, - quiet=True, - force_grid_wrap=2, - ) - code = black.format_str( - src_contents=code, - mode=black.Mode(), - ) + code = format_code_str(code) + response_file = response.file.add() + response_file.name = file_name + response_file.content = code + # Generate the proxy file + file_name = re.sub(r"\.proto$", f"{PROXY_FILE_SUFFIX}.py", proto_file.name) + code = jinja_proxy_template.render(file_template=file_template) + code = format_code_str(code) response_file = response.file.add() response_file.name = file_name response_file.content = code diff --git a/scripts/proto_codegen.sh b/scripts/proto_codegen.sh index 4c7b08b..494634f 100755 --- a/scripts/proto_codegen.sh +++ b/scripts/proto_codegen.sh @@ -20,6 +20,7 @@ PROTO_REPO_DIR=${PROTO_REPO_DIR:-"/tmp/opentelemetry-proto"} # root of opentelemetry-python repo repo_root="$(git rev-parse --show-toplevel)" venv_dir="/tmp/proto_codegen_venv" +code_dir="proto_impl/py" # run on exit even if crash cleanup() { @@ -55,8 +56,13 @@ fi cd $repo_root/src/snowflake/telemetry/_internal # clean up old generated code +# remove all the proxy files mkdir -p opentelemetry/proto -find opentelemetry/proto/ -regex ".*_marshaler\.py" -exec rm {} + +find opentelemetry/proto/ -regex ".*_proxy\.py" -exec rm {} + + +# remove all the py implementation marshaler files +mkdir -p $code_dir/opentelemetry/proto +find $code_dir/opentelemetry/proto/ -regex ".*_marshaler\.py" -exec rm {} + # generate proto code for all protos all_protos=$(find $PROTO_REPO_DIR/ -iname "*.proto") diff --git a/scripts/proto_codegen_vX.sh b/scripts/proto_codegen_vX.sh new file mode 100755 index 0000000..610c1bb --- /dev/null +++ b/scripts/proto_codegen_vX.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# +# Regenerate python code from OTLP protos in +# https://github.com/open-telemetry/opentelemetry-proto +# +# To use, update PROTO_REPO_BRANCH_OR_COMMIT variable below to a commit hash or +# tag in opentelemtry-proto repo that you want to build off of. Then, just run +# this script to update the proto files. Commit the changes as well as any +# fixes needed in the OTLP exporter. +# +# Optional envars: +# PROTO_REPO_DIR - the path to an existing checkout of the opentelemetry-proto repo + +# Pinned commit/branch/tag for the current version used in opentelemetry-proto python package. +PROTO_REPO_BRANCH_OR_COMMIT="v1.2.0" + +set -e + +PB_VERSION_MAJOR=${1:-"3"} +PROTO_REPO_DIR=${PROTO_REPO_DIR:-"/tmp/opentelemetry-proto"} +# root of opentelemetry-python repo +repo_root="$(git rev-parse --show-toplevel)" +venv_dir="/tmp/proto_codegen_venv" +code_dir="proto_impl/v$PB_VERSION_MAJOR" + +# run on exit even if crash +cleanup() { + echo "Deleting $venv_dir" + rm -rf $venv_dir +} +trap cleanup EXIT + +echo "Creating temporary virtualenv at $venv_dir using $(python3 --version)" +python3 -m venv $venv_dir +source $venv_dir/bin/activate +pip install --upgrade pip +python -m pip install --upgrade setuptools +python -m pip install \ + -c $repo_root/scripts/gen-requirements-v$PB_VERSION_MAJOR.txt \ + grpcio-tools mypy-protobuf + +echo 'python -m grpc_tools.protoc --version' +python -m grpc_tools.protoc --version + +# Clone the proto repo if it doesn't exist +if [ ! -d "$PROTO_REPO_DIR" ]; then + git clone https://github.com/open-telemetry/opentelemetry-proto.git $PROTO_REPO_DIR +fi + +# Pull in changes and switch to requested branch +( + cd $PROTO_REPO_DIR + git fetch --all + git checkout $PROTO_REPO_BRANCH_OR_COMMIT + # pull if PROTO_REPO_BRANCH_OR_COMMIT is not a detached head + git symbolic-ref -q HEAD && git pull --ff-only || true +) + +cd $repo_root/src/snowflake/telemetry/_internal + +# clean up old generated code +mkdir -p $code_dir/opentelemetry/proto +find $code_dir -regex ".*_pb2\.py" -exec rm {} + +find $code_dir -regex ".*_pb2\.pyi" -exec rm {} + + +# generate proto code for all protos +all_protos=$(find $PROTO_REPO_DIR/ -iname "*.proto") +python -m grpc_tools.protoc \ + -I $PROTO_REPO_DIR \ + --python_out=./$code_dir \ + $all_protos + +# since we do not have the generated files in the base directory +# we need to use sed to update the imports + +# If MacOS need '' after -i +# Detect the OS (macOS or Linux) +if [[ "$OSTYPE" == "darwin"* ]]; then + SED_CMD="sed -i ''" +else + SED_CMD="sed -i" +fi + +find $code_dir -type f \( -name "*.py" -o -name "*.pyi" \) -exec $SED_CMD 's/^import \([^ ]*\)_pb2 as \([^ ]*\)$/import snowflake.telemetry._internal.proto_impl.v'"$PB_VERSION_MAJOR"'.\1_pb2 as \2/' {} + +find $code_dir -type f \( -name "*.py" -o -name "*.pyi" \) -exec $SED_CMD 's/^from \([^ ]*\) import \([^ ]*\)_pb2 as \([^ ]*\)$/from snowflake.telemetry._internal.proto_impl.v'"$PB_VERSION_MAJOR"'.\1 import \2_pb2 as \3/' {} + + +find $code_dir -type f \( -name "*.py''" -o -name "*.pyi''" \) -exec rm {} + diff --git a/scripts/templates/proxy.py.jinja2 b/scripts/templates/proxy.py.jinja2 new file mode 100644 index 0000000..dd5df87 --- /dev/null +++ b/scripts/templates/proxy.py.jinja2 @@ -0,0 +1,14 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: {{ file_template.name }} +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from {{ file_template.path_pb3 }} import * +elif PROTOBUF_VERSION_MAJOR == 5: + from {{ file_template.path_pb5 }} import * +else: + from {{ file_template.path_py }} import * diff --git a/scripts/vendor_otlp_proto_common.sh b/scripts/vendor_otlp_proto_common.sh index eae16a2..4306145 100755 --- a/scripts/vendor_otlp_proto_common.sh +++ b/scripts/vendor_otlp_proto_common.sh @@ -47,12 +47,14 @@ fi # Replace all the imports strings in the copied python files # opentelemetry.exporter to snowflake.telemetry._internal.opentelemetry.exporter -# opentelemetry.proto.*_pb2 to snowflake.telemetry._internal.opentelemetry.proto.*_marshaler +# opentelemetry.proto.*_pb2 to snowflake.telemetry._internal.opentelemetry.proto.*_proxy find opentelemetry/exporter -type f -name "*.py" -exec $SED_CMD 's/opentelemetry.exporter/snowflake.telemetry._internal.opentelemetry.exporter/g' {} + -find opentelemetry/exporter -type f -name "*.py" -exec $SED_CMD 's/opentelemetry\.proto\(.*\)_pb2/snowflake.telemetry._internal.opentelemetry.proto\1_marshaler/g' {} + +find opentelemetry/exporter -type f -name "*.py" -exec $SED_CMD 's/opentelemetry\.proto\(.*\)_pb2/snowflake.telemetry._internal.opentelemetry.proto\1_proxy/g' {} + # Add a notice to the top of every file in compliance with Apache 2.0 to indicate that the file has been modified # https://www.apache.org/licenses/LICENSE-2.0 find opentelemetry/exporter -type f -name "*.py" -exec $SED_CMD '14s|^|#\n# This file has been modified from the original source code at\n#\n# https://github.com/open-telemetry/opentelemetry-python/tree/'"$REPO_BRANCH_OR_COMMIT"'\n#\n# by Snowflake Inc.\n|' {} + + +find opentelemetry/exporter -type f -name "*.py''" -exec rm {} + diff --git a/src/snowflake/telemetry/_internal/exporter/otlp/proto/logs/__init__.py b/src/snowflake/telemetry/_internal/exporter/otlp/proto/logs/__init__.py index 9361c20..9cac9b2 100644 --- a/src/snowflake/telemetry/_internal/exporter/otlp/proto/logs/__init__.py +++ b/src/snowflake/telemetry/_internal/exporter/otlp/proto/logs/__init__.py @@ -24,7 +24,7 @@ from snowflake.telemetry._internal.opentelemetry.exporter.otlp.proto.common._log_encoder import ( encode_logs, ) -from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_marshaler import LogsData +from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_proxy import LogsData from opentelemetry.sdk.resources import Resource from opentelemetry.sdk._logs import export from opentelemetry.sdk import _logs diff --git a/src/snowflake/telemetry/_internal/exporter/otlp/proto/metrics/__init__.py b/src/snowflake/telemetry/_internal/exporter/otlp/proto/metrics/__init__.py index 91ff137..e120e8c 100644 --- a/src/snowflake/telemetry/_internal/exporter/otlp/proto/metrics/__init__.py +++ b/src/snowflake/telemetry/_internal/exporter/otlp/proto/metrics/__init__.py @@ -20,7 +20,7 @@ from snowflake.telemetry._internal.opentelemetry.exporter.otlp.proto.common.metrics_encoder import ( encode_metrics, ) -from snowflake.telemetry._internal.opentelemetry.proto.metrics.v1.metrics_marshaler import MetricsData as PB2MetricsData +from snowflake.telemetry._internal.opentelemetry.proto.metrics.v1.metrics_proxy import MetricsData as PB2MetricsData from opentelemetry.sdk.metrics.export import ( AggregationTemporality, MetricExportResult, diff --git a/src/snowflake/telemetry/_internal/exporter/otlp/proto/traces/__init__.py b/src/snowflake/telemetry/_internal/exporter/otlp/proto/traces/__init__.py index 41aa617..050483e 100644 --- a/src/snowflake/telemetry/_internal/exporter/otlp/proto/traces/__init__.py +++ b/src/snowflake/telemetry/_internal/exporter/otlp/proto/traces/__init__.py @@ -19,7 +19,7 @@ from snowflake.telemetry._internal.opentelemetry.exporter.otlp.proto.common.trace_encoder import ( encode_spans, ) -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import TracesData +from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_proxy import TracesData from opentelemetry.sdk.trace import ReadableSpan from opentelemetry.sdk.trace.export import ( SpanExportResult, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py index 530528f..960193e 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py +++ b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py @@ -34,18 +34,18 @@ ) from opentelemetry.sdk.util.instrumentation import InstrumentationScope -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_proxy import ( InstrumentationScope as PB2InstrumentationScope, ) -from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_proxy import ( Resource as PB2Resource, ) -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import AnyValue as PB2AnyValue -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import KeyValue as PB2KeyValue -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_proxy import AnyValue as PB2AnyValue +from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_proxy import KeyValue as PB2KeyValue +from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_proxy import ( KeyValueList as PB2KeyValueList, ) -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_proxy import ( ArrayValue as PB2ArrayValue, ) from opentelemetry.sdk.trace import Resource diff --git a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py index 2f71a17..570a7c7 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py +++ b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/_log_encoder/__init__.py @@ -28,14 +28,14 @@ _encode_value, _encode_attributes, ) -from snowflake.telemetry._internal.opentelemetry.proto.collector.logs.v1.logs_service_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.collector.logs.v1.logs_service_proxy import ( ExportLogsServiceRequest, ) -from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_proxy import ( ScopeLogs, ResourceLogs, ) -from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_marshaler import LogRecord as PB2LogRecord +from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_proxy import LogRecord as PB2LogRecord from opentelemetry.sdk._logs import LogData diff --git a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py index 9d729cd..e15b1c5 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py +++ b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/metrics_encoder/__init__.py @@ -41,11 +41,11 @@ from opentelemetry.sdk.metrics.export import ( AggregationTemporality, ) -from snowflake.telemetry._internal.opentelemetry.proto.collector.metrics.v1.metrics_service_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.collector.metrics.v1.metrics_service_proxy import ( ExportMetricsServiceRequest, ) -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import InstrumentationScope -from snowflake.telemetry._internal.opentelemetry.proto.metrics.v1 import metrics_marshaler as pb2 +from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_proxy import InstrumentationScope +from snowflake.telemetry._internal.opentelemetry.proto.metrics.v1 import metrics_proxy as pb2 from opentelemetry.sdk.metrics.export import ( MetricsData, Gauge, @@ -54,7 +54,7 @@ ExponentialHistogram as ExponentialHistogramType, ) from typing import Dict -from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_proxy import ( Resource as PB2Resource, ) from opentelemetry.sdk.environment_variables import ( diff --git a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py index e269641..5e6314c 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py +++ b/src/snowflake/telemetry/_internal/opentelemetry/exporter/otlp/proto/common/_internal/trace_encoder/__init__.py @@ -29,16 +29,16 @@ _encode_span_id, _encode_trace_id, ) -from snowflake.telemetry._internal.opentelemetry.proto.collector.trace.v1.trace_service_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.collector.trace.v1.trace_service_proxy import ( ExportTraceServiceRequest as PB2ExportTraceServiceRequest, ) -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import ( +from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_proxy import ( ResourceSpans as PB2ResourceSpans, ) -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import ScopeSpans as PB2ScopeSpans -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import Span as PB2SPan -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import SpanFlags as PB2SpanFlags -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import Status as PB2Status +from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_proxy import ScopeSpans as PB2ScopeSpans +from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_proxy import Span as PB2SPan +from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_proxy import SpanFlags as PB2SpanFlags +from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_proxy import Status as PB2Status from opentelemetry.sdk.trace import Event, ReadableSpan from opentelemetry.trace import Link, SpanKind from opentelemetry.trace.span import SpanContext, Status, TraceState diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/logs/v1/logs_service_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/logs/v1/logs_service_proxy.py new file mode 100644 index 0000000..5cde503 --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/logs/v1/logs_service_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/collector/logs/v1/logs_service.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.collector.logs.v1.logs_service_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.collector.logs.v1.logs_service_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.collector.logs.v1.logs_service_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/metrics/v1/metrics_service_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/metrics/v1/metrics_service_proxy.py new file mode 100644 index 0000000..a84712d --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/metrics/v1/metrics_service_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/collector/metrics/v1/metrics_service.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.collector.metrics.v1.metrics_service_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.collector.metrics.v1.metrics_service_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.collector.metrics.v1.metrics_service_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/trace/v1/trace_service_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/trace/v1/trace_service_proxy.py new file mode 100644 index 0000000..ecc4946 --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/trace/v1/trace_service_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/collector/trace/v1/trace_service.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.collector.trace.v1.trace_service_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.collector.trace.v1.trace_service_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.collector.trace.v1.trace_service_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/common/v1/common_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/common/v1/common_proxy.py new file mode 100644 index 0000000..fea9b52 --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/common/v1/common_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/common/v1/common.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.common.v1.common_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.common.v1.common_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.common.v1.common_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/logs/v1/logs_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/logs/v1/logs_proxy.py new file mode 100644 index 0000000..58608da --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/logs/v1/logs_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/logs/v1/logs.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.logs.v1.logs_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.logs.v1.logs_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.logs.v1.logs_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/metrics/v1/metrics_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/metrics/v1/metrics_proxy.py new file mode 100644 index 0000000..a1da3ec --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/metrics/v1/metrics_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/metrics/v1/metrics.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.metrics.v1.metrics_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.metrics.v1.metrics_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.metrics.v1.metrics_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/resource/v1/resource_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/resource/v1/resource_proxy.py new file mode 100644 index 0000000..191f965 --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/resource/v1/resource_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/resource/v1/resource.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.resource.v1.resource_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.resource.v1.resource_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.resource.v1.resource_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/trace/v1/trace_proxy.py b/src/snowflake/telemetry/_internal/opentelemetry/proto/trace/v1/trace_proxy.py new file mode 100644 index 0000000..8a31389 --- /dev/null +++ b/src/snowflake/telemetry/_internal/opentelemetry/proto/trace/v1/trace_proxy.py @@ -0,0 +1,15 @@ +# Generated by the protoc compiler with a custom plugin. DO NOT EDIT! +# sources: opentelemetry/proto/trace/v1/trace.proto +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# + +from snowflake.telemetry._internal.proto_proxy import PROTOBUF_VERSION_MAJOR + + +if PROTOBUF_VERSION_MAJOR == 3 or PROTOBUF_VERSION_MAJOR == 4: + from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.trace.v1.trace_pb2 import * +elif PROTOBUF_VERSION_MAJOR == 5: + from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.trace.v1.trace_pb2 import * +else: + from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.trace.v1.trace_marshaler import * diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/logs/v1/logs_service_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/logs/v1/logs_service_marshaler.py similarity index 97% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/collector/logs/v1/logs_service_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/logs/v1/logs_service_marshaler.py index e023504..f0d591b 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/logs/v1/logs_service_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/logs/v1/logs_service_marshaler.py @@ -28,7 +28,7 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.logs.v1.logs_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/metrics/v1/metrics_service_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/metrics/v1/metrics_service_marshaler.py similarity index 97% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/collector/metrics/v1/metrics_service_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/metrics/v1/metrics_service_marshaler.py index 5357be0..33aecff 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/metrics/v1/metrics_service_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/metrics/v1/metrics_service_marshaler.py @@ -28,7 +28,7 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.metrics.v1.metrics_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.metrics.v1.metrics_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/trace/v1/trace_service_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/trace/v1/trace_service_marshaler.py similarity index 97% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/collector/trace/v1/trace_service_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/trace/v1/trace_service_marshaler.py index d3b9dce..41a3a0c 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/collector/trace/v1/trace_service_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/collector/trace/v1/trace_service_marshaler.py @@ -28,7 +28,7 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.trace.v1.trace_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/common/v1/common_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/common/v1/common_marshaler.py similarity index 100% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/common/v1/common_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/common/v1/common_marshaler.py diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/logs/v1/logs_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/logs/v1/logs_marshaler.py similarity index 98% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/logs/v1/logs_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/logs/v1/logs_marshaler.py index 9900914..a6664a1 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/logs/v1/logs_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/logs/v1/logs_marshaler.py @@ -28,8 +28,8 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import * -from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.common.v1.common_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.resource.v1.resource_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/metrics/v1/metrics_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/metrics/v1/metrics_marshaler.py similarity index 99% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/metrics/v1/metrics_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/metrics/v1/metrics_marshaler.py index 37fab8e..03b4762 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/metrics/v1/metrics_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/metrics/v1/metrics_marshaler.py @@ -28,8 +28,8 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import * -from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.common.v1.common_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.resource.v1.resource_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/resource/v1/resource_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/resource/v1/resource_marshaler.py similarity index 95% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/resource/v1/resource_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/resource/v1/resource_marshaler.py index f4c6664..826ac5e 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/resource/v1/resource_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/resource/v1/resource_marshaler.py @@ -28,7 +28,7 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.common.v1.common_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/opentelemetry/proto/trace/v1/trace_marshaler.py b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/trace/v1/trace_marshaler.py similarity index 98% rename from src/snowflake/telemetry/_internal/opentelemetry/proto/trace/v1/trace_marshaler.py rename to src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/trace/v1/trace_marshaler.py index 748f670..60f9678 100644 --- a/src/snowflake/telemetry/_internal/opentelemetry/proto/trace/v1/trace_marshaler.py +++ b/src/snowflake/telemetry/_internal/proto_impl/py/opentelemetry/proto/trace/v1/trace_marshaler.py @@ -28,8 +28,8 @@ import struct from typing import List -from snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler import * -from snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.common.v1.common_marshaler import * +from snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.resource.v1.resource_marshaler import * from snowflake.telemetry._internal.serialize import ( Enum, MessageMarshaler, diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py new file mode 100644 index 0000000..bc032d2 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/collector/logs/v1/logs_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.logs.v1 import logs_pb2 as opentelemetry_dot_proto_dot_logs_dot_v1_dot_logs__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8opentelemetry/proto/collector/logs/v1/logs_service.proto\x12%opentelemetry.proto.collector.logs.v1\x1a&opentelemetry/proto/logs/v1/logs.proto\"\\\n\x18\x45xportLogsServiceRequest\x12@\n\rresource_logs\x18\x01 \x03(\x0b\x32).opentelemetry.proto.logs.v1.ResourceLogs\"u\n\x19\x45xportLogsServiceResponse\x12X\n\x0fpartial_success\x18\x01 \x01(\x0b\x32?.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess\"O\n\x18\x45xportLogsPartialSuccess\x12\x1c\n\x14rejected_log_records\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t2\x9d\x01\n\x0bLogsService\x12\x8d\x01\n\x06\x45xport\x12?.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest\x1a@.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse\"\x00\x42\x98\x01\n(io.opentelemetry.proto.collector.logs.v1B\x10LogsServiceProtoP\x01Z0go.opentelemetry.io/proto/otlp/collector/logs/v1\xaa\x02%OpenTelemetry.Proto.Collector.Logs.V1b\x06proto3') + + + +_EXPORTLOGSSERVICEREQUEST = DESCRIPTOR.message_types_by_name['ExportLogsServiceRequest'] +_EXPORTLOGSSERVICERESPONSE = DESCRIPTOR.message_types_by_name['ExportLogsServiceResponse'] +_EXPORTLOGSPARTIALSUCCESS = DESCRIPTOR.message_types_by_name['ExportLogsPartialSuccess'] +ExportLogsServiceRequest = _reflection.GeneratedProtocolMessageType('ExportLogsServiceRequest', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTLOGSSERVICEREQUEST, + '__module__' : 'opentelemetry.proto.collector.logs.v1.logs_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) + }) +_sym_db.RegisterMessage(ExportLogsServiceRequest) + +ExportLogsServiceResponse = _reflection.GeneratedProtocolMessageType('ExportLogsServiceResponse', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTLOGSSERVICERESPONSE, + '__module__' : 'opentelemetry.proto.collector.logs.v1.logs_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse) + }) +_sym_db.RegisterMessage(ExportLogsServiceResponse) + +ExportLogsPartialSuccess = _reflection.GeneratedProtocolMessageType('ExportLogsPartialSuccess', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTLOGSPARTIALSUCCESS, + '__module__' : 'opentelemetry.proto.collector.logs.v1.logs_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess) + }) +_sym_db.RegisterMessage(ExportLogsPartialSuccess) + +_LOGSSERVICE = DESCRIPTOR.services_by_name['LogsService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n(io.opentelemetry.proto.collector.logs.v1B\020LogsServiceProtoP\001Z0go.opentelemetry.io/proto/otlp/collector/logs/v1\252\002%OpenTelemetry.Proto.Collector.Logs.V1' + _EXPORTLOGSSERVICEREQUEST._serialized_start=139 + _EXPORTLOGSSERVICEREQUEST._serialized_end=231 + _EXPORTLOGSSERVICERESPONSE._serialized_start=233 + _EXPORTLOGSSERVICERESPONSE._serialized_end=350 + _EXPORTLOGSPARTIALSUCCESS._serialized_start=352 + _EXPORTLOGSPARTIALSUCCESS._serialized_end=431 + _LOGSSERVICE._serialized_start=434 + _LOGSSERVICE._serialized_end=591 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py new file mode 100644 index 0000000..a0862ea --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.metrics.v1 import metrics_pb2 as opentelemetry_dot_proto_dot_metrics_dot_v1_dot_metrics__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>opentelemetry/proto/collector/metrics/v1/metrics_service.proto\x12(opentelemetry.proto.collector.metrics.v1\x1a,opentelemetry/proto/metrics/v1/metrics.proto\"h\n\x1b\x45xportMetricsServiceRequest\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"~\n\x1c\x45xportMetricsServiceResponse\x12^\n\x0fpartial_success\x18\x01 \x01(\x0b\x32\x45.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess\"R\n\x1b\x45xportMetricsPartialSuccess\x12\x1c\n\x14rejected_data_points\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t2\xac\x01\n\x0eMetricsService\x12\x99\x01\n\x06\x45xport\x12\x45.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest\x1a\x46.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse\"\x00\x42\xa4\x01\n+io.opentelemetry.proto.collector.metrics.v1B\x13MetricsServiceProtoP\x01Z3go.opentelemetry.io/proto/otlp/collector/metrics/v1\xaa\x02(OpenTelemetry.Proto.Collector.Metrics.V1b\x06proto3') + + + +_EXPORTMETRICSSERVICEREQUEST = DESCRIPTOR.message_types_by_name['ExportMetricsServiceRequest'] +_EXPORTMETRICSSERVICERESPONSE = DESCRIPTOR.message_types_by_name['ExportMetricsServiceResponse'] +_EXPORTMETRICSPARTIALSUCCESS = DESCRIPTOR.message_types_by_name['ExportMetricsPartialSuccess'] +ExportMetricsServiceRequest = _reflection.GeneratedProtocolMessageType('ExportMetricsServiceRequest', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTMETRICSSERVICEREQUEST, + '__module__' : 'opentelemetry.proto.collector.metrics.v1.metrics_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) + }) +_sym_db.RegisterMessage(ExportMetricsServiceRequest) + +ExportMetricsServiceResponse = _reflection.GeneratedProtocolMessageType('ExportMetricsServiceResponse', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTMETRICSSERVICERESPONSE, + '__module__' : 'opentelemetry.proto.collector.metrics.v1.metrics_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) + }) +_sym_db.RegisterMessage(ExportMetricsServiceResponse) + +ExportMetricsPartialSuccess = _reflection.GeneratedProtocolMessageType('ExportMetricsPartialSuccess', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTMETRICSPARTIALSUCCESS, + '__module__' : 'opentelemetry.proto.collector.metrics.v1.metrics_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess) + }) +_sym_db.RegisterMessage(ExportMetricsPartialSuccess) + +_METRICSSERVICE = DESCRIPTOR.services_by_name['MetricsService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n+io.opentelemetry.proto.collector.metrics.v1B\023MetricsServiceProtoP\001Z3go.opentelemetry.io/proto/otlp/collector/metrics/v1\252\002(OpenTelemetry.Proto.Collector.Metrics.V1' + _EXPORTMETRICSSERVICEREQUEST._serialized_start=154 + _EXPORTMETRICSSERVICEREQUEST._serialized_end=258 + _EXPORTMETRICSSERVICERESPONSE._serialized_start=260 + _EXPORTMETRICSSERVICERESPONSE._serialized_end=386 + _EXPORTMETRICSPARTIALSUCCESS._serialized_start=388 + _EXPORTMETRICSPARTIALSUCCESS._serialized_end=470 + _METRICSSERVICE._serialized_start=473 + _METRICSSERVICE._serialized_end=645 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py new file mode 100644 index 0000000..7965c2e --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/collector/trace/v1/trace_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.trace.v1 import trace_pb2 as opentelemetry_dot_proto_dot_trace_dot_v1_dot_trace__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n:opentelemetry/proto/collector/trace/v1/trace_service.proto\x12&opentelemetry.proto.collector.trace.v1\x1a(opentelemetry/proto/trace/v1/trace.proto\"`\n\x19\x45xportTraceServiceRequest\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"x\n\x1a\x45xportTraceServiceResponse\x12Z\n\x0fpartial_success\x18\x01 \x01(\x0b\x32\x41.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess\"J\n\x19\x45xportTracePartialSuccess\x12\x16\n\x0erejected_spans\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t2\xa2\x01\n\x0cTraceService\x12\x91\x01\n\x06\x45xport\x12\x41.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest\x1a\x42.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse\"\x00\x42\x9c\x01\n)io.opentelemetry.proto.collector.trace.v1B\x11TraceServiceProtoP\x01Z1go.opentelemetry.io/proto/otlp/collector/trace/v1\xaa\x02&OpenTelemetry.Proto.Collector.Trace.V1b\x06proto3') + + + +_EXPORTTRACESERVICEREQUEST = DESCRIPTOR.message_types_by_name['ExportTraceServiceRequest'] +_EXPORTTRACESERVICERESPONSE = DESCRIPTOR.message_types_by_name['ExportTraceServiceResponse'] +_EXPORTTRACEPARTIALSUCCESS = DESCRIPTOR.message_types_by_name['ExportTracePartialSuccess'] +ExportTraceServiceRequest = _reflection.GeneratedProtocolMessageType('ExportTraceServiceRequest', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTTRACESERVICEREQUEST, + '__module__' : 'opentelemetry.proto.collector.trace.v1.trace_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) + }) +_sym_db.RegisterMessage(ExportTraceServiceRequest) + +ExportTraceServiceResponse = _reflection.GeneratedProtocolMessageType('ExportTraceServiceResponse', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTTRACESERVICERESPONSE, + '__module__' : 'opentelemetry.proto.collector.trace.v1.trace_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse) + }) +_sym_db.RegisterMessage(ExportTraceServiceResponse) + +ExportTracePartialSuccess = _reflection.GeneratedProtocolMessageType('ExportTracePartialSuccess', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTTRACEPARTIALSUCCESS, + '__module__' : 'opentelemetry.proto.collector.trace.v1.trace_service_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess) + }) +_sym_db.RegisterMessage(ExportTracePartialSuccess) + +_TRACESERVICE = DESCRIPTOR.services_by_name['TraceService'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n)io.opentelemetry.proto.collector.trace.v1B\021TraceServiceProtoP\001Z1go.opentelemetry.io/proto/otlp/collector/trace/v1\252\002&OpenTelemetry.Proto.Collector.Trace.V1' + _EXPORTTRACESERVICEREQUEST._serialized_start=144 + _EXPORTTRACESERVICEREQUEST._serialized_end=240 + _EXPORTTRACESERVICERESPONSE._serialized_start=242 + _EXPORTTRACESERVICERESPONSE._serialized_end=362 + _EXPORTTRACEPARTIALSUCCESS._serialized_start=364 + _EXPORTTRACEPARTIALSUCCESS._serialized_end=438 + _TRACESERVICE._serialized_start=441 + _TRACESERVICE._serialized_end=603 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/common/v1/common_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/common/v1/common_pb2.py new file mode 100644 index 0000000..bec37ab --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/common/v1/common_pb2.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/common/v1/common.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*opentelemetry/proto/common/v1/common.proto\x12\x1dopentelemetry.proto.common.v1\"\x8c\x02\n\x08\x41nyValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12@\n\x0b\x61rray_value\x18\x05 \x01(\x0b\x32).opentelemetry.proto.common.v1.ArrayValueH\x00\x12\x43\n\x0ckvlist_value\x18\x06 \x01(\x0b\x32+.opentelemetry.proto.common.v1.KeyValueListH\x00\x12\x15\n\x0b\x62ytes_value\x18\x07 \x01(\x0cH\x00\x42\x07\n\x05value\"E\n\nArrayValue\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"G\n\x0cKeyValueList\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\"O\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"\x94\x01\n\x14InstrumentationScope\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\rB{\n io.opentelemetry.proto.common.v1B\x0b\x43ommonProtoP\x01Z(go.opentelemetry.io/proto/otlp/common/v1\xaa\x02\x1dOpenTelemetry.Proto.Common.V1b\x06proto3') + + + +_ANYVALUE = DESCRIPTOR.message_types_by_name['AnyValue'] +_ARRAYVALUE = DESCRIPTOR.message_types_by_name['ArrayValue'] +_KEYVALUELIST = DESCRIPTOR.message_types_by_name['KeyValueList'] +_KEYVALUE = DESCRIPTOR.message_types_by_name['KeyValue'] +_INSTRUMENTATIONSCOPE = DESCRIPTOR.message_types_by_name['InstrumentationScope'] +AnyValue = _reflection.GeneratedProtocolMessageType('AnyValue', (_message.Message,), { + 'DESCRIPTOR' : _ANYVALUE, + '__module__' : 'opentelemetry.proto.common.v1.common_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.AnyValue) + }) +_sym_db.RegisterMessage(AnyValue) + +ArrayValue = _reflection.GeneratedProtocolMessageType('ArrayValue', (_message.Message,), { + 'DESCRIPTOR' : _ARRAYVALUE, + '__module__' : 'opentelemetry.proto.common.v1.common_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.ArrayValue) + }) +_sym_db.RegisterMessage(ArrayValue) + +KeyValueList = _reflection.GeneratedProtocolMessageType('KeyValueList', (_message.Message,), { + 'DESCRIPTOR' : _KEYVALUELIST, + '__module__' : 'opentelemetry.proto.common.v1.common_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.KeyValueList) + }) +_sym_db.RegisterMessage(KeyValueList) + +KeyValue = _reflection.GeneratedProtocolMessageType('KeyValue', (_message.Message,), { + 'DESCRIPTOR' : _KEYVALUE, + '__module__' : 'opentelemetry.proto.common.v1.common_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.KeyValue) + }) +_sym_db.RegisterMessage(KeyValue) + +InstrumentationScope = _reflection.GeneratedProtocolMessageType('InstrumentationScope', (_message.Message,), { + 'DESCRIPTOR' : _INSTRUMENTATIONSCOPE, + '__module__' : 'opentelemetry.proto.common.v1.common_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.common.v1.InstrumentationScope) + }) +_sym_db.RegisterMessage(InstrumentationScope) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n io.opentelemetry.proto.common.v1B\013CommonProtoP\001Z(go.opentelemetry.io/proto/otlp/common/v1\252\002\035OpenTelemetry.Proto.Common.V1' + _ANYVALUE._serialized_start=78 + _ANYVALUE._serialized_end=346 + _ARRAYVALUE._serialized_start=348 + _ARRAYVALUE._serialized_end=417 + _KEYVALUELIST._serialized_start=419 + _KEYVALUELIST._serialized_end=490 + _KEYVALUE._serialized_start=492 + _KEYVALUE._serialized_end=571 + _INSTRUMENTATIONSCOPE._serialized_start=574 + _INSTRUMENTATIONSCOPE._serialized_end=722 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/logs/v1/logs_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/logs/v1/logs_pb2.py new file mode 100644 index 0000000..7f078cf --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/logs/v1/logs_pb2.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/logs/v1/logs.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&opentelemetry/proto/logs/v1/logs.proto\x12\x1bopentelemetry.proto.logs.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"L\n\x08LogsData\x12@\n\rresource_logs\x18\x01 \x03(\x0b\x32).opentelemetry.proto.logs.v1.ResourceLogs\"\xa3\x01\n\x0cResourceLogs\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12:\n\nscope_logs\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.logs.v1.ScopeLogs\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\xa0\x01\n\tScopeLogs\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12;\n\x0blog_records\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.logs.v1.LogRecord\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xef\x02\n\tLogRecord\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x1f\n\x17observed_time_unix_nano\x18\x0b \x01(\x06\x12\x44\n\x0fseverity_number\x18\x02 \x01(\x0e\x32+.opentelemetry.proto.logs.v1.SeverityNumber\x12\x15\n\rseverity_text\x18\x03 \x01(\t\x12\x35\n\x04\x62ody\x18\x05 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\x12;\n\nattributes\x18\x06 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x07 \x01(\r\x12\r\n\x05\x66lags\x18\x08 \x01(\x07\x12\x10\n\x08trace_id\x18\t \x01(\x0c\x12\x0f\n\x07span_id\x18\n \x01(\x0cJ\x04\x08\x04\x10\x05*\xc3\x05\n\x0eSeverityNumber\x12\x1f\n\x1bSEVERITY_NUMBER_UNSPECIFIED\x10\x00\x12\x19\n\x15SEVERITY_NUMBER_TRACE\x10\x01\x12\x1a\n\x16SEVERITY_NUMBER_TRACE2\x10\x02\x12\x1a\n\x16SEVERITY_NUMBER_TRACE3\x10\x03\x12\x1a\n\x16SEVERITY_NUMBER_TRACE4\x10\x04\x12\x19\n\x15SEVERITY_NUMBER_DEBUG\x10\x05\x12\x1a\n\x16SEVERITY_NUMBER_DEBUG2\x10\x06\x12\x1a\n\x16SEVERITY_NUMBER_DEBUG3\x10\x07\x12\x1a\n\x16SEVERITY_NUMBER_DEBUG4\x10\x08\x12\x18\n\x14SEVERITY_NUMBER_INFO\x10\t\x12\x19\n\x15SEVERITY_NUMBER_INFO2\x10\n\x12\x19\n\x15SEVERITY_NUMBER_INFO3\x10\x0b\x12\x19\n\x15SEVERITY_NUMBER_INFO4\x10\x0c\x12\x18\n\x14SEVERITY_NUMBER_WARN\x10\r\x12\x19\n\x15SEVERITY_NUMBER_WARN2\x10\x0e\x12\x19\n\x15SEVERITY_NUMBER_WARN3\x10\x0f\x12\x19\n\x15SEVERITY_NUMBER_WARN4\x10\x10\x12\x19\n\x15SEVERITY_NUMBER_ERROR\x10\x11\x12\x1a\n\x16SEVERITY_NUMBER_ERROR2\x10\x12\x12\x1a\n\x16SEVERITY_NUMBER_ERROR3\x10\x13\x12\x1a\n\x16SEVERITY_NUMBER_ERROR4\x10\x14\x12\x19\n\x15SEVERITY_NUMBER_FATAL\x10\x15\x12\x1a\n\x16SEVERITY_NUMBER_FATAL2\x10\x16\x12\x1a\n\x16SEVERITY_NUMBER_FATAL3\x10\x17\x12\x1a\n\x16SEVERITY_NUMBER_FATAL4\x10\x18*Y\n\x0eLogRecordFlags\x12\x1f\n\x1bLOG_RECORD_FLAGS_DO_NOT_USE\x10\x00\x12&\n!LOG_RECORD_FLAGS_TRACE_FLAGS_MASK\x10\xff\x01\x42s\n\x1eio.opentelemetry.proto.logs.v1B\tLogsProtoP\x01Z&go.opentelemetry.io/proto/otlp/logs/v1\xaa\x02\x1bOpenTelemetry.Proto.Logs.V1b\x06proto3') + +_SEVERITYNUMBER = DESCRIPTOR.enum_types_by_name['SeverityNumber'] +SeverityNumber = enum_type_wrapper.EnumTypeWrapper(_SEVERITYNUMBER) +_LOGRECORDFLAGS = DESCRIPTOR.enum_types_by_name['LogRecordFlags'] +LogRecordFlags = enum_type_wrapper.EnumTypeWrapper(_LOGRECORDFLAGS) +SEVERITY_NUMBER_UNSPECIFIED = 0 +SEVERITY_NUMBER_TRACE = 1 +SEVERITY_NUMBER_TRACE2 = 2 +SEVERITY_NUMBER_TRACE3 = 3 +SEVERITY_NUMBER_TRACE4 = 4 +SEVERITY_NUMBER_DEBUG = 5 +SEVERITY_NUMBER_DEBUG2 = 6 +SEVERITY_NUMBER_DEBUG3 = 7 +SEVERITY_NUMBER_DEBUG4 = 8 +SEVERITY_NUMBER_INFO = 9 +SEVERITY_NUMBER_INFO2 = 10 +SEVERITY_NUMBER_INFO3 = 11 +SEVERITY_NUMBER_INFO4 = 12 +SEVERITY_NUMBER_WARN = 13 +SEVERITY_NUMBER_WARN2 = 14 +SEVERITY_NUMBER_WARN3 = 15 +SEVERITY_NUMBER_WARN4 = 16 +SEVERITY_NUMBER_ERROR = 17 +SEVERITY_NUMBER_ERROR2 = 18 +SEVERITY_NUMBER_ERROR3 = 19 +SEVERITY_NUMBER_ERROR4 = 20 +SEVERITY_NUMBER_FATAL = 21 +SEVERITY_NUMBER_FATAL2 = 22 +SEVERITY_NUMBER_FATAL3 = 23 +SEVERITY_NUMBER_FATAL4 = 24 +LOG_RECORD_FLAGS_DO_NOT_USE = 0 +LOG_RECORD_FLAGS_TRACE_FLAGS_MASK = 255 + + +_LOGSDATA = DESCRIPTOR.message_types_by_name['LogsData'] +_RESOURCELOGS = DESCRIPTOR.message_types_by_name['ResourceLogs'] +_SCOPELOGS = DESCRIPTOR.message_types_by_name['ScopeLogs'] +_LOGRECORD = DESCRIPTOR.message_types_by_name['LogRecord'] +LogsData = _reflection.GeneratedProtocolMessageType('LogsData', (_message.Message,), { + 'DESCRIPTOR' : _LOGSDATA, + '__module__' : 'opentelemetry.proto.logs.v1.logs_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.logs.v1.LogsData) + }) +_sym_db.RegisterMessage(LogsData) + +ResourceLogs = _reflection.GeneratedProtocolMessageType('ResourceLogs', (_message.Message,), { + 'DESCRIPTOR' : _RESOURCELOGS, + '__module__' : 'opentelemetry.proto.logs.v1.logs_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.logs.v1.ResourceLogs) + }) +_sym_db.RegisterMessage(ResourceLogs) + +ScopeLogs = _reflection.GeneratedProtocolMessageType('ScopeLogs', (_message.Message,), { + 'DESCRIPTOR' : _SCOPELOGS, + '__module__' : 'opentelemetry.proto.logs.v1.logs_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.logs.v1.ScopeLogs) + }) +_sym_db.RegisterMessage(ScopeLogs) + +LogRecord = _reflection.GeneratedProtocolMessageType('LogRecord', (_message.Message,), { + 'DESCRIPTOR' : _LOGRECORD, + '__module__' : 'opentelemetry.proto.logs.v1.logs_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.logs.v1.LogRecord) + }) +_sym_db.RegisterMessage(LogRecord) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\036io.opentelemetry.proto.logs.v1B\tLogsProtoP\001Z&go.opentelemetry.io/proto/otlp/logs/v1\252\002\033OpenTelemetry.Proto.Logs.V1' + _SEVERITYNUMBER._serialized_start=941 + _SEVERITYNUMBER._serialized_end=1648 + _LOGRECORDFLAGS._serialized_start=1650 + _LOGRECORDFLAGS._serialized_end=1739 + _LOGSDATA._serialized_start=163 + _LOGSDATA._serialized_end=239 + _RESOURCELOGS._serialized_start=242 + _RESOURCELOGS._serialized_end=405 + _SCOPELOGS._serialized_start=408 + _SCOPELOGS._serialized_end=568 + _LOGRECORD._serialized_start=571 + _LOGRECORD._serialized_end=938 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/metrics/v1/metrics_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/metrics/v1/metrics_pb2.py new file mode 100644 index 0000000..fc3504c --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/metrics/v1/metrics_pb2.py @@ -0,0 +1,203 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/metrics/v1/metrics.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,opentelemetry/proto/metrics/v1/metrics.proto\x12\x1eopentelemetry.proto.metrics.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"X\n\x0bMetricsData\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\xaf\x01\n\x0fResourceMetrics\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12\x43\n\rscope_metrics\x18\x02 \x03(\x0b\x32,.opentelemetry.proto.metrics.v1.ScopeMetrics\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x9f\x01\n\x0cScopeMetrics\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xcd\x03\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04unit\x18\x03 \x01(\t\x12\x36\n\x05gauge\x18\x05 \x01(\x0b\x32%.opentelemetry.proto.metrics.v1.GaugeH\x00\x12\x32\n\x03sum\x18\x07 \x01(\x0b\x32#.opentelemetry.proto.metrics.v1.SumH\x00\x12>\n\thistogram\x18\t \x01(\x0b\x32).opentelemetry.proto.metrics.v1.HistogramH\x00\x12U\n\x15\x65xponential_histogram\x18\n \x01(\x0b\x32\x34.opentelemetry.proto.metrics.v1.ExponentialHistogramH\x00\x12:\n\x07summary\x18\x0b \x01(\x0b\x32\'.opentelemetry.proto.metrics.v1.SummaryH\x00\x12\x39\n\x08metadata\x18\x0c \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValueB\x06\n\x04\x64\x61taJ\x04\x08\x04\x10\x05J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\t\"M\n\x05Gauge\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\"\xba\x01\n\x03Sum\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\x12\x14\n\x0cis_monotonic\x18\x03 \x01(\x08\"\xad\x01\n\tHistogram\x12G\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x32.opentelemetry.proto.metrics.v1.HistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"\xc3\x01\n\x14\x45xponentialHistogram\x12R\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"P\n\x07Summary\x12\x45\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x30.opentelemetry.proto.metrics.v1.SummaryDataPoint\"\x86\x02\n\x0fNumberDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\x13\n\tas_double\x18\x04 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12;\n\texemplars\x18\x05 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\x08 \x01(\rB\x07\n\x05valueJ\x04\x08\x01\x10\x02\"\xe6\x02\n\x12HistogramDataPoint\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x06\x12\x17\n\x0f\x65xplicit_bounds\x18\x07 \x03(\x01\x12;\n\texemplars\x18\x08 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\n \x01(\r\x12\x10\n\x03min\x18\x0b \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\x0c \x01(\x01H\x02\x88\x01\x01\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_maxJ\x04\x08\x01\x10\x02\"\xda\x04\n\x1d\x45xponentialHistogramDataPoint\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\r\n\x05scale\x18\x06 \x01(\x11\x12\x12\n\nzero_count\x18\x07 \x01(\x06\x12W\n\x08positive\x18\x08 \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12W\n\x08negative\x18\t \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12\r\n\x05\x66lags\x18\n \x01(\r\x12;\n\texemplars\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\x10\n\x03min\x18\x0c \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\r \x01(\x01H\x02\x88\x01\x01\x12\x16\n\x0ezero_threshold\x18\x0e \x01(\x01\x1a\x30\n\x07\x42uckets\x12\x0e\n\x06offset\x18\x01 \x01(\x11\x12\x15\n\rbucket_counts\x18\x02 \x03(\x04\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_max\"\xc5\x02\n\x10SummaryDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12Y\n\x0fquantile_values\x18\x06 \x03(\x0b\x32@.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile\x12\r\n\x05\x66lags\x18\x08 \x01(\r\x1a\x32\n\x0fValueAtQuantile\x12\x10\n\x08quantile\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x01J\x04\x08\x01\x10\x02\"\xc1\x01\n\x08\x45xemplar\x12\x44\n\x13\x66iltered_attributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x16\n\x0etime_unix_nano\x18\x02 \x01(\x06\x12\x13\n\tas_double\x18\x03 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12\x0f\n\x07span_id\x18\x04 \x01(\x0c\x12\x10\n\x08trace_id\x18\x05 \x01(\x0c\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02*\x8c\x01\n\x16\x41ggregationTemporality\x12\'\n#AGGREGATION_TEMPORALITY_UNSPECIFIED\x10\x00\x12!\n\x1d\x41GGREGATION_TEMPORALITY_DELTA\x10\x01\x12&\n\"AGGREGATION_TEMPORALITY_CUMULATIVE\x10\x02*^\n\x0e\x44\x61taPointFlags\x12\x1f\n\x1b\x44\x41TA_POINT_FLAGS_DO_NOT_USE\x10\x00\x12+\n\'DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK\x10\x01\x42\x7f\n!io.opentelemetry.proto.metrics.v1B\x0cMetricsProtoP\x01Z)go.opentelemetry.io/proto/otlp/metrics/v1\xaa\x02\x1eOpenTelemetry.Proto.Metrics.V1b\x06proto3') + +_AGGREGATIONTEMPORALITY = DESCRIPTOR.enum_types_by_name['AggregationTemporality'] +AggregationTemporality = enum_type_wrapper.EnumTypeWrapper(_AGGREGATIONTEMPORALITY) +_DATAPOINTFLAGS = DESCRIPTOR.enum_types_by_name['DataPointFlags'] +DataPointFlags = enum_type_wrapper.EnumTypeWrapper(_DATAPOINTFLAGS) +AGGREGATION_TEMPORALITY_UNSPECIFIED = 0 +AGGREGATION_TEMPORALITY_DELTA = 1 +AGGREGATION_TEMPORALITY_CUMULATIVE = 2 +DATA_POINT_FLAGS_DO_NOT_USE = 0 +DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK = 1 + + +_METRICSDATA = DESCRIPTOR.message_types_by_name['MetricsData'] +_RESOURCEMETRICS = DESCRIPTOR.message_types_by_name['ResourceMetrics'] +_SCOPEMETRICS = DESCRIPTOR.message_types_by_name['ScopeMetrics'] +_METRIC = DESCRIPTOR.message_types_by_name['Metric'] +_GAUGE = DESCRIPTOR.message_types_by_name['Gauge'] +_SUM = DESCRIPTOR.message_types_by_name['Sum'] +_HISTOGRAM = DESCRIPTOR.message_types_by_name['Histogram'] +_EXPONENTIALHISTOGRAM = DESCRIPTOR.message_types_by_name['ExponentialHistogram'] +_SUMMARY = DESCRIPTOR.message_types_by_name['Summary'] +_NUMBERDATAPOINT = DESCRIPTOR.message_types_by_name['NumberDataPoint'] +_HISTOGRAMDATAPOINT = DESCRIPTOR.message_types_by_name['HistogramDataPoint'] +_EXPONENTIALHISTOGRAMDATAPOINT = DESCRIPTOR.message_types_by_name['ExponentialHistogramDataPoint'] +_EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS = _EXPONENTIALHISTOGRAMDATAPOINT.nested_types_by_name['Buckets'] +_SUMMARYDATAPOINT = DESCRIPTOR.message_types_by_name['SummaryDataPoint'] +_SUMMARYDATAPOINT_VALUEATQUANTILE = _SUMMARYDATAPOINT.nested_types_by_name['ValueAtQuantile'] +_EXEMPLAR = DESCRIPTOR.message_types_by_name['Exemplar'] +MetricsData = _reflection.GeneratedProtocolMessageType('MetricsData', (_message.Message,), { + 'DESCRIPTOR' : _METRICSDATA, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.MetricsData) + }) +_sym_db.RegisterMessage(MetricsData) + +ResourceMetrics = _reflection.GeneratedProtocolMessageType('ResourceMetrics', (_message.Message,), { + 'DESCRIPTOR' : _RESOURCEMETRICS, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.ResourceMetrics) + }) +_sym_db.RegisterMessage(ResourceMetrics) + +ScopeMetrics = _reflection.GeneratedProtocolMessageType('ScopeMetrics', (_message.Message,), { + 'DESCRIPTOR' : _SCOPEMETRICS, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.ScopeMetrics) + }) +_sym_db.RegisterMessage(ScopeMetrics) + +Metric = _reflection.GeneratedProtocolMessageType('Metric', (_message.Message,), { + 'DESCRIPTOR' : _METRIC, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.Metric) + }) +_sym_db.RegisterMessage(Metric) + +Gauge = _reflection.GeneratedProtocolMessageType('Gauge', (_message.Message,), { + 'DESCRIPTOR' : _GAUGE, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.Gauge) + }) +_sym_db.RegisterMessage(Gauge) + +Sum = _reflection.GeneratedProtocolMessageType('Sum', (_message.Message,), { + 'DESCRIPTOR' : _SUM, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.Sum) + }) +_sym_db.RegisterMessage(Sum) + +Histogram = _reflection.GeneratedProtocolMessageType('Histogram', (_message.Message,), { + 'DESCRIPTOR' : _HISTOGRAM, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.Histogram) + }) +_sym_db.RegisterMessage(Histogram) + +ExponentialHistogram = _reflection.GeneratedProtocolMessageType('ExponentialHistogram', (_message.Message,), { + 'DESCRIPTOR' : _EXPONENTIALHISTOGRAM, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.ExponentialHistogram) + }) +_sym_db.RegisterMessage(ExponentialHistogram) + +Summary = _reflection.GeneratedProtocolMessageType('Summary', (_message.Message,), { + 'DESCRIPTOR' : _SUMMARY, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.Summary) + }) +_sym_db.RegisterMessage(Summary) + +NumberDataPoint = _reflection.GeneratedProtocolMessageType('NumberDataPoint', (_message.Message,), { + 'DESCRIPTOR' : _NUMBERDATAPOINT, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.NumberDataPoint) + }) +_sym_db.RegisterMessage(NumberDataPoint) + +HistogramDataPoint = _reflection.GeneratedProtocolMessageType('HistogramDataPoint', (_message.Message,), { + 'DESCRIPTOR' : _HISTOGRAMDATAPOINT, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.HistogramDataPoint) + }) +_sym_db.RegisterMessage(HistogramDataPoint) + +ExponentialHistogramDataPoint = _reflection.GeneratedProtocolMessageType('ExponentialHistogramDataPoint', (_message.Message,), { + + 'Buckets' : _reflection.GeneratedProtocolMessageType('Buckets', (_message.Message,), { + 'DESCRIPTOR' : _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets) + }) + , + 'DESCRIPTOR' : _EXPONENTIALHISTOGRAMDATAPOINT, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint) + }) +_sym_db.RegisterMessage(ExponentialHistogramDataPoint) +_sym_db.RegisterMessage(ExponentialHistogramDataPoint.Buckets) + +SummaryDataPoint = _reflection.GeneratedProtocolMessageType('SummaryDataPoint', (_message.Message,), { + + 'ValueAtQuantile' : _reflection.GeneratedProtocolMessageType('ValueAtQuantile', (_message.Message,), { + 'DESCRIPTOR' : _SUMMARYDATAPOINT_VALUEATQUANTILE, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile) + }) + , + 'DESCRIPTOR' : _SUMMARYDATAPOINT, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.SummaryDataPoint) + }) +_sym_db.RegisterMessage(SummaryDataPoint) +_sym_db.RegisterMessage(SummaryDataPoint.ValueAtQuantile) + +Exemplar = _reflection.GeneratedProtocolMessageType('Exemplar', (_message.Message,), { + 'DESCRIPTOR' : _EXEMPLAR, + '__module__' : 'opentelemetry.proto.metrics.v1.metrics_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.metrics.v1.Exemplar) + }) +_sym_db.RegisterMessage(Exemplar) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n!io.opentelemetry.proto.metrics.v1B\014MetricsProtoP\001Z)go.opentelemetry.io/proto/otlp/metrics/v1\252\002\036OpenTelemetry.Proto.Metrics.V1' + _AGGREGATIONTEMPORALITY._serialized_start=3546 + _AGGREGATIONTEMPORALITY._serialized_end=3686 + _DATAPOINTFLAGS._serialized_start=3688 + _DATAPOINTFLAGS._serialized_end=3782 + _METRICSDATA._serialized_start=172 + _METRICSDATA._serialized_end=260 + _RESOURCEMETRICS._serialized_start=263 + _RESOURCEMETRICS._serialized_end=438 + _SCOPEMETRICS._serialized_start=441 + _SCOPEMETRICS._serialized_end=600 + _METRIC._serialized_start=603 + _METRIC._serialized_end=1064 + _GAUGE._serialized_start=1066 + _GAUGE._serialized_end=1143 + _SUM._serialized_start=1146 + _SUM._serialized_end=1332 + _HISTOGRAM._serialized_start=1335 + _HISTOGRAM._serialized_end=1508 + _EXPONENTIALHISTOGRAM._serialized_start=1511 + _EXPONENTIALHISTOGRAM._serialized_end=1706 + _SUMMARY._serialized_start=1708 + _SUMMARY._serialized_end=1788 + _NUMBERDATAPOINT._serialized_start=1791 + _NUMBERDATAPOINT._serialized_end=2053 + _HISTOGRAMDATAPOINT._serialized_start=2056 + _HISTOGRAMDATAPOINT._serialized_end=2414 + _EXPONENTIALHISTOGRAMDATAPOINT._serialized_start=2417 + _EXPONENTIALHISTOGRAMDATAPOINT._serialized_end=3019 + _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS._serialized_start=2947 + _EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS._serialized_end=2995 + _SUMMARYDATAPOINT._serialized_start=3022 + _SUMMARYDATAPOINT._serialized_end=3347 + _SUMMARYDATAPOINT_VALUEATQUANTILE._serialized_start=3291 + _SUMMARYDATAPOINT_VALUEATQUANTILE._serialized_end=3341 + _EXEMPLAR._serialized_start=3350 + _EXEMPLAR._serialized_end=3543 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/resource/v1/resource_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/resource/v1/resource_pb2.py new file mode 100644 index 0000000..b1d07d4 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/resource/v1/resource_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/resource/v1/resource.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.opentelemetry/proto/resource/v1/resource.proto\x12\x1fopentelemetry.proto.resource.v1\x1a*opentelemetry/proto/common/v1/common.proto\"i\n\x08Resource\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\rB\x83\x01\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\x01Z*go.opentelemetry.io/proto/otlp/resource/v1\xaa\x02\x1fOpenTelemetry.Proto.Resource.V1b\x06proto3') + + + +_RESOURCE = DESCRIPTOR.message_types_by_name['Resource'] +Resource = _reflection.GeneratedProtocolMessageType('Resource', (_message.Message,), { + 'DESCRIPTOR' : _RESOURCE, + '__module__' : 'opentelemetry.proto.resource.v1.resource_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.resource.v1.Resource) + }) +_sym_db.RegisterMessage(Resource) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\001Z*go.opentelemetry.io/proto/otlp/resource/v1\252\002\037OpenTelemetry.Proto.Resource.V1' + _RESOURCE._serialized_start=127 + _RESOURCE._serialized_end=232 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/trace/v1/trace_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/trace/v1/trace_pb2.py new file mode 100644 index 0000000..0e23c73 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v3/opentelemetry/proto/trace/v1/trace_pb2.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/trace/v1/trace.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 +from snowflake.telemetry._internal.proto_impl.v3.opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(opentelemetry/proto/trace/v1/trace.proto\x12\x1copentelemetry.proto.trace.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"Q\n\nTracesData\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\xa7\x01\n\rResourceSpans\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12=\n\x0bscope_spans\x18\x02 \x03(\x0b\x32(.opentelemetry.proto.trace.v1.ScopeSpans\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x97\x01\n\nScopeSpans\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x84\x08\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12\x16\n\x0eparent_span_id\x18\x04 \x01(\x0c\x12\r\n\x05\x66lags\x18\x10 \x01(\x07\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x39\n\x04kind\x18\x06 \x01(\x0e\x32+.opentelemetry.proto.trace.v1.Span.SpanKind\x12\x1c\n\x14start_time_unix_nano\x18\x07 \x01(\x06\x12\x1a\n\x12\x65nd_time_unix_nano\x18\x08 \x01(\x06\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\n \x01(\r\x12\x38\n\x06\x65vents\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.trace.v1.Span.Event\x12\x1c\n\x14\x64ropped_events_count\x18\x0c \x01(\r\x12\x36\n\x05links\x18\r \x03(\x0b\x32\'.opentelemetry.proto.trace.v1.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x0e \x01(\r\x12\x34\n\x06status\x18\x0f \x01(\x0b\x32$.opentelemetry.proto.trace.v1.Status\x1a\x8c\x01\n\x05\x45vent\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x0c\n\x04name\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\r\x1a\xac\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12;\n\nattributes\x18\x04 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x05 \x01(\r\x12\r\n\x05\x66lags\x18\x06 \x01(\x07\"\x99\x01\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x16\n\x12SPAN_KIND_INTERNAL\x10\x01\x12\x14\n\x10SPAN_KIND_SERVER\x10\x02\x12\x14\n\x10SPAN_KIND_CLIENT\x10\x03\x12\x16\n\x12SPAN_KIND_PRODUCER\x10\x04\x12\x16\n\x12SPAN_KIND_CONSUMER\x10\x05\"\xae\x01\n\x06Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x63ode\x18\x03 \x01(\x0e\x32/.opentelemetry.proto.trace.v1.Status.StatusCode\"N\n\nStatusCode\x12\x15\n\x11STATUS_CODE_UNSET\x10\x00\x12\x12\n\x0eSTATUS_CODE_OK\x10\x01\x12\x15\n\x11STATUS_CODE_ERROR\x10\x02J\x04\x08\x01\x10\x02*\x9c\x01\n\tSpanFlags\x12\x19\n\x15SPAN_FLAGS_DO_NOT_USE\x10\x00\x12 \n\x1bSPAN_FLAGS_TRACE_FLAGS_MASK\x10\xff\x01\x12*\n%SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK\x10\x80\x02\x12&\n!SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK\x10\x80\x04\x42w\n\x1fio.opentelemetry.proto.trace.v1B\nTraceProtoP\x01Z\'go.opentelemetry.io/proto/otlp/trace/v1\xaa\x02\x1cOpenTelemetry.Proto.Trace.V1b\x06proto3') + +_SPANFLAGS = DESCRIPTOR.enum_types_by_name['SpanFlags'] +SpanFlags = enum_type_wrapper.EnumTypeWrapper(_SPANFLAGS) +SPAN_FLAGS_DO_NOT_USE = 0 +SPAN_FLAGS_TRACE_FLAGS_MASK = 255 +SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256 +SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512 + + +_TRACESDATA = DESCRIPTOR.message_types_by_name['TracesData'] +_RESOURCESPANS = DESCRIPTOR.message_types_by_name['ResourceSpans'] +_SCOPESPANS = DESCRIPTOR.message_types_by_name['ScopeSpans'] +_SPAN = DESCRIPTOR.message_types_by_name['Span'] +_SPAN_EVENT = _SPAN.nested_types_by_name['Event'] +_SPAN_LINK = _SPAN.nested_types_by_name['Link'] +_STATUS = DESCRIPTOR.message_types_by_name['Status'] +_SPAN_SPANKIND = _SPAN.enum_types_by_name['SpanKind'] +_STATUS_STATUSCODE = _STATUS.enum_types_by_name['StatusCode'] +TracesData = _reflection.GeneratedProtocolMessageType('TracesData', (_message.Message,), { + 'DESCRIPTOR' : _TRACESDATA, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.TracesData) + }) +_sym_db.RegisterMessage(TracesData) + +ResourceSpans = _reflection.GeneratedProtocolMessageType('ResourceSpans', (_message.Message,), { + 'DESCRIPTOR' : _RESOURCESPANS, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.ResourceSpans) + }) +_sym_db.RegisterMessage(ResourceSpans) + +ScopeSpans = _reflection.GeneratedProtocolMessageType('ScopeSpans', (_message.Message,), { + 'DESCRIPTOR' : _SCOPESPANS, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.ScopeSpans) + }) +_sym_db.RegisterMessage(ScopeSpans) + +Span = _reflection.GeneratedProtocolMessageType('Span', (_message.Message,), { + + 'Event' : _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { + 'DESCRIPTOR' : _SPAN_EVENT, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.Span.Event) + }) + , + + 'Link' : _reflection.GeneratedProtocolMessageType('Link', (_message.Message,), { + 'DESCRIPTOR' : _SPAN_LINK, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.Span.Link) + }) + , + 'DESCRIPTOR' : _SPAN, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.Span) + }) +_sym_db.RegisterMessage(Span) +_sym_db.RegisterMessage(Span.Event) +_sym_db.RegisterMessage(Span.Link) + +Status = _reflection.GeneratedProtocolMessageType('Status', (_message.Message,), { + 'DESCRIPTOR' : _STATUS, + '__module__' : 'opentelemetry.proto.trace.v1.trace_pb2' + # @@protoc_insertion_point(class_scope:opentelemetry.proto.trace.v1.Status) + }) +_sym_db.RegisterMessage(Status) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\037io.opentelemetry.proto.trace.v1B\nTraceProtoP\001Z\'go.opentelemetry.io/proto/otlp/trace/v1\252\002\034OpenTelemetry.Proto.Trace.V1' + _SPANFLAGS._serialized_start=1782 + _SPANFLAGS._serialized_end=1938 + _TRACESDATA._serialized_start=166 + _TRACESDATA._serialized_end=247 + _RESOURCESPANS._serialized_start=250 + _RESOURCESPANS._serialized_end=417 + _SCOPESPANS._serialized_start=420 + _SCOPESPANS._serialized_end=571 + _SPAN._serialized_start=574 + _SPAN._serialized_end=1602 + _SPAN_EVENT._serialized_start=1131 + _SPAN_EVENT._serialized_end=1271 + _SPAN_LINK._serialized_start=1274 + _SPAN_LINK._serialized_end=1446 + _SPAN_SPANKIND._serialized_start=1449 + _SPAN_SPANKIND._serialized_end=1602 + _STATUS._serialized_start=1605 + _STATUS._serialized_end=1779 + _STATUS_STATUSCODE._serialized_start=1695 + _STATUS_STATUSCODE._serialized_end=1773 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py new file mode 100644 index 0000000..fa502d7 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/logs/v1/logs_service_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/collector/logs/v1/logs_service.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.logs.v1 import logs_pb2 as opentelemetry_dot_proto_dot_logs_dot_v1_dot_logs__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8opentelemetry/proto/collector/logs/v1/logs_service.proto\x12%opentelemetry.proto.collector.logs.v1\x1a&opentelemetry/proto/logs/v1/logs.proto\"\\\n\x18\x45xportLogsServiceRequest\x12@\n\rresource_logs\x18\x01 \x03(\x0b\x32).opentelemetry.proto.logs.v1.ResourceLogs\"u\n\x19\x45xportLogsServiceResponse\x12X\n\x0fpartial_success\x18\x01 \x01(\x0b\x32?.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess\"O\n\x18\x45xportLogsPartialSuccess\x12\x1c\n\x14rejected_log_records\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t2\x9d\x01\n\x0bLogsService\x12\x8d\x01\n\x06\x45xport\x12?.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest\x1a@.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse\"\x00\x42\x98\x01\n(io.opentelemetry.proto.collector.logs.v1B\x10LogsServiceProtoP\x01Z0go.opentelemetry.io/proto/otlp/collector/logs/v1\xaa\x02%OpenTelemetry.Proto.Collector.Logs.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.collector.logs.v1.logs_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n(io.opentelemetry.proto.collector.logs.v1B\020LogsServiceProtoP\001Z0go.opentelemetry.io/proto/otlp/collector/logs/v1\252\002%OpenTelemetry.Proto.Collector.Logs.V1' + _globals['_EXPORTLOGSSERVICEREQUEST']._serialized_start=139 + _globals['_EXPORTLOGSSERVICEREQUEST']._serialized_end=231 + _globals['_EXPORTLOGSSERVICERESPONSE']._serialized_start=233 + _globals['_EXPORTLOGSSERVICERESPONSE']._serialized_end=350 + _globals['_EXPORTLOGSPARTIALSUCCESS']._serialized_start=352 + _globals['_EXPORTLOGSPARTIALSUCCESS']._serialized_end=431 + _globals['_LOGSSERVICE']._serialized_start=434 + _globals['_LOGSSERVICE']._serialized_end=591 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py new file mode 100644 index 0000000..6096a2e --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/metrics/v1/metrics_service_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.metrics.v1 import metrics_pb2 as opentelemetry_dot_proto_dot_metrics_dot_v1_dot_metrics__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n>opentelemetry/proto/collector/metrics/v1/metrics_service.proto\x12(opentelemetry.proto.collector.metrics.v1\x1a,opentelemetry/proto/metrics/v1/metrics.proto\"h\n\x1b\x45xportMetricsServiceRequest\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"~\n\x1c\x45xportMetricsServiceResponse\x12^\n\x0fpartial_success\x18\x01 \x01(\x0b\x32\x45.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess\"R\n\x1b\x45xportMetricsPartialSuccess\x12\x1c\n\x14rejected_data_points\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t2\xac\x01\n\x0eMetricsService\x12\x99\x01\n\x06\x45xport\x12\x45.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest\x1a\x46.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse\"\x00\x42\xa4\x01\n+io.opentelemetry.proto.collector.metrics.v1B\x13MetricsServiceProtoP\x01Z3go.opentelemetry.io/proto/otlp/collector/metrics/v1\xaa\x02(OpenTelemetry.Proto.Collector.Metrics.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.collector.metrics.v1.metrics_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n+io.opentelemetry.proto.collector.metrics.v1B\023MetricsServiceProtoP\001Z3go.opentelemetry.io/proto/otlp/collector/metrics/v1\252\002(OpenTelemetry.Proto.Collector.Metrics.V1' + _globals['_EXPORTMETRICSSERVICEREQUEST']._serialized_start=154 + _globals['_EXPORTMETRICSSERVICEREQUEST']._serialized_end=258 + _globals['_EXPORTMETRICSSERVICERESPONSE']._serialized_start=260 + _globals['_EXPORTMETRICSSERVICERESPONSE']._serialized_end=386 + _globals['_EXPORTMETRICSPARTIALSUCCESS']._serialized_start=388 + _globals['_EXPORTMETRICSPARTIALSUCCESS']._serialized_end=470 + _globals['_METRICSSERVICE']._serialized_start=473 + _globals['_METRICSSERVICE']._serialized_end=645 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py new file mode 100644 index 0000000..06fdc0a --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/collector/trace/v1/trace_service_pb2.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/collector/trace/v1/trace_service.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.trace.v1 import trace_pb2 as opentelemetry_dot_proto_dot_trace_dot_v1_dot_trace__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n:opentelemetry/proto/collector/trace/v1/trace_service.proto\x12&opentelemetry.proto.collector.trace.v1\x1a(opentelemetry/proto/trace/v1/trace.proto\"`\n\x19\x45xportTraceServiceRequest\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"x\n\x1a\x45xportTraceServiceResponse\x12Z\n\x0fpartial_success\x18\x01 \x01(\x0b\x32\x41.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess\"J\n\x19\x45xportTracePartialSuccess\x12\x16\n\x0erejected_spans\x18\x01 \x01(\x03\x12\x15\n\rerror_message\x18\x02 \x01(\t2\xa2\x01\n\x0cTraceService\x12\x91\x01\n\x06\x45xport\x12\x41.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest\x1a\x42.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse\"\x00\x42\x9c\x01\n)io.opentelemetry.proto.collector.trace.v1B\x11TraceServiceProtoP\x01Z1go.opentelemetry.io/proto/otlp/collector/trace/v1\xaa\x02&OpenTelemetry.Proto.Collector.Trace.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.collector.trace.v1.trace_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n)io.opentelemetry.proto.collector.trace.v1B\021TraceServiceProtoP\001Z1go.opentelemetry.io/proto/otlp/collector/trace/v1\252\002&OpenTelemetry.Proto.Collector.Trace.V1' + _globals['_EXPORTTRACESERVICEREQUEST']._serialized_start=144 + _globals['_EXPORTTRACESERVICEREQUEST']._serialized_end=240 + _globals['_EXPORTTRACESERVICERESPONSE']._serialized_start=242 + _globals['_EXPORTTRACESERVICERESPONSE']._serialized_end=362 + _globals['_EXPORTTRACEPARTIALSUCCESS']._serialized_start=364 + _globals['_EXPORTTRACEPARTIALSUCCESS']._serialized_end=438 + _globals['_TRACESERVICE']._serialized_start=441 + _globals['_TRACESERVICE']._serialized_end=603 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/common/v1/common_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/common/v1/common_pb2.py new file mode 100644 index 0000000..cc6ebbd --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/common/v1/common_pb2.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/common/v1/common.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*opentelemetry/proto/common/v1/common.proto\x12\x1dopentelemetry.proto.common.v1\"\x8c\x02\n\x08\x41nyValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x02 \x01(\x08H\x00\x12\x13\n\tint_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x04 \x01(\x01H\x00\x12@\n\x0b\x61rray_value\x18\x05 \x01(\x0b\x32).opentelemetry.proto.common.v1.ArrayValueH\x00\x12\x43\n\x0ckvlist_value\x18\x06 \x01(\x0b\x32+.opentelemetry.proto.common.v1.KeyValueListH\x00\x12\x15\n\x0b\x62ytes_value\x18\x07 \x01(\x0cH\x00\x42\x07\n\x05value\"E\n\nArrayValue\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"G\n\x0cKeyValueList\x12\x37\n\x06values\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\"O\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x36\n\x05value\x18\x02 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\"\x94\x01\n\x14InstrumentationScope\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\rB{\n io.opentelemetry.proto.common.v1B\x0b\x43ommonProtoP\x01Z(go.opentelemetry.io/proto/otlp/common/v1\xaa\x02\x1dOpenTelemetry.Proto.Common.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.common.v1.common_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n io.opentelemetry.proto.common.v1B\013CommonProtoP\001Z(go.opentelemetry.io/proto/otlp/common/v1\252\002\035OpenTelemetry.Proto.Common.V1' + _globals['_ANYVALUE']._serialized_start=78 + _globals['_ANYVALUE']._serialized_end=346 + _globals['_ARRAYVALUE']._serialized_start=348 + _globals['_ARRAYVALUE']._serialized_end=417 + _globals['_KEYVALUELIST']._serialized_start=419 + _globals['_KEYVALUELIST']._serialized_end=490 + _globals['_KEYVALUE']._serialized_start=492 + _globals['_KEYVALUE']._serialized_end=571 + _globals['_INSTRUMENTATIONSCOPE']._serialized_start=574 + _globals['_INSTRUMENTATIONSCOPE']._serialized_end=722 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/logs/v1/logs_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/logs/v1/logs_pb2.py new file mode 100644 index 0000000..cc3c706 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/logs/v1/logs_pb2.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/logs/v1/logs.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&opentelemetry/proto/logs/v1/logs.proto\x12\x1bopentelemetry.proto.logs.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"L\n\x08LogsData\x12@\n\rresource_logs\x18\x01 \x03(\x0b\x32).opentelemetry.proto.logs.v1.ResourceLogs\"\xa3\x01\n\x0cResourceLogs\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12:\n\nscope_logs\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.logs.v1.ScopeLogs\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\xa0\x01\n\tScopeLogs\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12;\n\x0blog_records\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.logs.v1.LogRecord\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xef\x02\n\tLogRecord\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x1f\n\x17observed_time_unix_nano\x18\x0b \x01(\x06\x12\x44\n\x0fseverity_number\x18\x02 \x01(\x0e\x32+.opentelemetry.proto.logs.v1.SeverityNumber\x12\x15\n\rseverity_text\x18\x03 \x01(\t\x12\x35\n\x04\x62ody\x18\x05 \x01(\x0b\x32\'.opentelemetry.proto.common.v1.AnyValue\x12;\n\nattributes\x18\x06 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x07 \x01(\r\x12\r\n\x05\x66lags\x18\x08 \x01(\x07\x12\x10\n\x08trace_id\x18\t \x01(\x0c\x12\x0f\n\x07span_id\x18\n \x01(\x0cJ\x04\x08\x04\x10\x05*\xc3\x05\n\x0eSeverityNumber\x12\x1f\n\x1bSEVERITY_NUMBER_UNSPECIFIED\x10\x00\x12\x19\n\x15SEVERITY_NUMBER_TRACE\x10\x01\x12\x1a\n\x16SEVERITY_NUMBER_TRACE2\x10\x02\x12\x1a\n\x16SEVERITY_NUMBER_TRACE3\x10\x03\x12\x1a\n\x16SEVERITY_NUMBER_TRACE4\x10\x04\x12\x19\n\x15SEVERITY_NUMBER_DEBUG\x10\x05\x12\x1a\n\x16SEVERITY_NUMBER_DEBUG2\x10\x06\x12\x1a\n\x16SEVERITY_NUMBER_DEBUG3\x10\x07\x12\x1a\n\x16SEVERITY_NUMBER_DEBUG4\x10\x08\x12\x18\n\x14SEVERITY_NUMBER_INFO\x10\t\x12\x19\n\x15SEVERITY_NUMBER_INFO2\x10\n\x12\x19\n\x15SEVERITY_NUMBER_INFO3\x10\x0b\x12\x19\n\x15SEVERITY_NUMBER_INFO4\x10\x0c\x12\x18\n\x14SEVERITY_NUMBER_WARN\x10\r\x12\x19\n\x15SEVERITY_NUMBER_WARN2\x10\x0e\x12\x19\n\x15SEVERITY_NUMBER_WARN3\x10\x0f\x12\x19\n\x15SEVERITY_NUMBER_WARN4\x10\x10\x12\x19\n\x15SEVERITY_NUMBER_ERROR\x10\x11\x12\x1a\n\x16SEVERITY_NUMBER_ERROR2\x10\x12\x12\x1a\n\x16SEVERITY_NUMBER_ERROR3\x10\x13\x12\x1a\n\x16SEVERITY_NUMBER_ERROR4\x10\x14\x12\x19\n\x15SEVERITY_NUMBER_FATAL\x10\x15\x12\x1a\n\x16SEVERITY_NUMBER_FATAL2\x10\x16\x12\x1a\n\x16SEVERITY_NUMBER_FATAL3\x10\x17\x12\x1a\n\x16SEVERITY_NUMBER_FATAL4\x10\x18*Y\n\x0eLogRecordFlags\x12\x1f\n\x1bLOG_RECORD_FLAGS_DO_NOT_USE\x10\x00\x12&\n!LOG_RECORD_FLAGS_TRACE_FLAGS_MASK\x10\xff\x01\x42s\n\x1eio.opentelemetry.proto.logs.v1B\tLogsProtoP\x01Z&go.opentelemetry.io/proto/otlp/logs/v1\xaa\x02\x1bOpenTelemetry.Proto.Logs.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.logs.v1.logs_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\036io.opentelemetry.proto.logs.v1B\tLogsProtoP\001Z&go.opentelemetry.io/proto/otlp/logs/v1\252\002\033OpenTelemetry.Proto.Logs.V1' + _globals['_SEVERITYNUMBER']._serialized_start=941 + _globals['_SEVERITYNUMBER']._serialized_end=1648 + _globals['_LOGRECORDFLAGS']._serialized_start=1650 + _globals['_LOGRECORDFLAGS']._serialized_end=1739 + _globals['_LOGSDATA']._serialized_start=163 + _globals['_LOGSDATA']._serialized_end=239 + _globals['_RESOURCELOGS']._serialized_start=242 + _globals['_RESOURCELOGS']._serialized_end=405 + _globals['_SCOPELOGS']._serialized_start=408 + _globals['_SCOPELOGS']._serialized_end=568 + _globals['_LOGRECORD']._serialized_start=571 + _globals['_LOGRECORD']._serialized_end=938 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/metrics/v1/metrics_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/metrics/v1/metrics_pb2.py new file mode 100644 index 0000000..9eab60b --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/metrics/v1/metrics_pb2.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/metrics/v1/metrics.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,opentelemetry/proto/metrics/v1/metrics.proto\x12\x1eopentelemetry.proto.metrics.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"X\n\x0bMetricsData\x12I\n\x10resource_metrics\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.ResourceMetrics\"\xaf\x01\n\x0fResourceMetrics\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12\x43\n\rscope_metrics\x18\x02 \x03(\x0b\x32,.opentelemetry.proto.metrics.v1.ScopeMetrics\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x9f\x01\n\x0cScopeMetrics\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x37\n\x07metrics\x18\x02 \x03(\x0b\x32&.opentelemetry.proto.metrics.v1.Metric\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\xcd\x03\n\x06Metric\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04unit\x18\x03 \x01(\t\x12\x36\n\x05gauge\x18\x05 \x01(\x0b\x32%.opentelemetry.proto.metrics.v1.GaugeH\x00\x12\x32\n\x03sum\x18\x07 \x01(\x0b\x32#.opentelemetry.proto.metrics.v1.SumH\x00\x12>\n\thistogram\x18\t \x01(\x0b\x32).opentelemetry.proto.metrics.v1.HistogramH\x00\x12U\n\x15\x65xponential_histogram\x18\n \x01(\x0b\x32\x34.opentelemetry.proto.metrics.v1.ExponentialHistogramH\x00\x12:\n\x07summary\x18\x0b \x01(\x0b\x32\'.opentelemetry.proto.metrics.v1.SummaryH\x00\x12\x39\n\x08metadata\x18\x0c \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValueB\x06\n\x04\x64\x61taJ\x04\x08\x04\x10\x05J\x04\x08\x06\x10\x07J\x04\x08\x08\x10\t\"M\n\x05Gauge\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\"\xba\x01\n\x03Sum\x12\x44\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32/.opentelemetry.proto.metrics.v1.NumberDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\x12\x14\n\x0cis_monotonic\x18\x03 \x01(\x08\"\xad\x01\n\tHistogram\x12G\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x32.opentelemetry.proto.metrics.v1.HistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"\xc3\x01\n\x14\x45xponentialHistogram\x12R\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32=.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint\x12W\n\x17\x61ggregation_temporality\x18\x02 \x01(\x0e\x32\x36.opentelemetry.proto.metrics.v1.AggregationTemporality\"P\n\x07Summary\x12\x45\n\x0b\x64\x61ta_points\x18\x01 \x03(\x0b\x32\x30.opentelemetry.proto.metrics.v1.SummaryDataPoint\"\x86\x02\n\x0fNumberDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\x13\n\tas_double\x18\x04 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12;\n\texemplars\x18\x05 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\x08 \x01(\rB\x07\n\x05valueJ\x04\x08\x01\x10\x02\"\xe6\x02\n\x12HistogramDataPoint\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\x15\n\rbucket_counts\x18\x06 \x03(\x06\x12\x17\n\x0f\x65xplicit_bounds\x18\x07 \x03(\x01\x12;\n\texemplars\x18\x08 \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\r\n\x05\x66lags\x18\n \x01(\r\x12\x10\n\x03min\x18\x0b \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\x0c \x01(\x01H\x02\x88\x01\x01\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_maxJ\x04\x08\x01\x10\x02\"\xda\x04\n\x1d\x45xponentialHistogramDataPoint\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x10\n\x03sum\x18\x05 \x01(\x01H\x00\x88\x01\x01\x12\r\n\x05scale\x18\x06 \x01(\x11\x12\x12\n\nzero_count\x18\x07 \x01(\x06\x12W\n\x08positive\x18\x08 \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12W\n\x08negative\x18\t \x01(\x0b\x32\x45.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets\x12\r\n\x05\x66lags\x18\n \x01(\r\x12;\n\texemplars\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.metrics.v1.Exemplar\x12\x10\n\x03min\x18\x0c \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03max\x18\r \x01(\x01H\x02\x88\x01\x01\x12\x16\n\x0ezero_threshold\x18\x0e \x01(\x01\x1a\x30\n\x07\x42uckets\x12\x0e\n\x06offset\x18\x01 \x01(\x11\x12\x15\n\rbucket_counts\x18\x02 \x03(\x04\x42\x06\n\x04_sumB\x06\n\x04_minB\x06\n\x04_max\"\xc5\x02\n\x10SummaryDataPoint\x12;\n\nattributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x1c\n\x14start_time_unix_nano\x18\x02 \x01(\x06\x12\x16\n\x0etime_unix_nano\x18\x03 \x01(\x06\x12\r\n\x05\x63ount\x18\x04 \x01(\x06\x12\x0b\n\x03sum\x18\x05 \x01(\x01\x12Y\n\x0fquantile_values\x18\x06 \x03(\x0b\x32@.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile\x12\r\n\x05\x66lags\x18\x08 \x01(\r\x1a\x32\n\x0fValueAtQuantile\x12\x10\n\x08quantile\x18\x01 \x01(\x01\x12\r\n\x05value\x18\x02 \x01(\x01J\x04\x08\x01\x10\x02\"\xc1\x01\n\x08\x45xemplar\x12\x44\n\x13\x66iltered_attributes\x18\x07 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12\x16\n\x0etime_unix_nano\x18\x02 \x01(\x06\x12\x13\n\tas_double\x18\x03 \x01(\x01H\x00\x12\x10\n\x06\x61s_int\x18\x06 \x01(\x10H\x00\x12\x0f\n\x07span_id\x18\x04 \x01(\x0c\x12\x10\n\x08trace_id\x18\x05 \x01(\x0c\x42\x07\n\x05valueJ\x04\x08\x01\x10\x02*\x8c\x01\n\x16\x41ggregationTemporality\x12\'\n#AGGREGATION_TEMPORALITY_UNSPECIFIED\x10\x00\x12!\n\x1d\x41GGREGATION_TEMPORALITY_DELTA\x10\x01\x12&\n\"AGGREGATION_TEMPORALITY_CUMULATIVE\x10\x02*^\n\x0e\x44\x61taPointFlags\x12\x1f\n\x1b\x44\x41TA_POINT_FLAGS_DO_NOT_USE\x10\x00\x12+\n\'DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK\x10\x01\x42\x7f\n!io.opentelemetry.proto.metrics.v1B\x0cMetricsProtoP\x01Z)go.opentelemetry.io/proto/otlp/metrics/v1\xaa\x02\x1eOpenTelemetry.Proto.Metrics.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.metrics.v1.metrics_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n!io.opentelemetry.proto.metrics.v1B\014MetricsProtoP\001Z)go.opentelemetry.io/proto/otlp/metrics/v1\252\002\036OpenTelemetry.Proto.Metrics.V1' + _globals['_AGGREGATIONTEMPORALITY']._serialized_start=3546 + _globals['_AGGREGATIONTEMPORALITY']._serialized_end=3686 + _globals['_DATAPOINTFLAGS']._serialized_start=3688 + _globals['_DATAPOINTFLAGS']._serialized_end=3782 + _globals['_METRICSDATA']._serialized_start=172 + _globals['_METRICSDATA']._serialized_end=260 + _globals['_RESOURCEMETRICS']._serialized_start=263 + _globals['_RESOURCEMETRICS']._serialized_end=438 + _globals['_SCOPEMETRICS']._serialized_start=441 + _globals['_SCOPEMETRICS']._serialized_end=600 + _globals['_METRIC']._serialized_start=603 + _globals['_METRIC']._serialized_end=1064 + _globals['_GAUGE']._serialized_start=1066 + _globals['_GAUGE']._serialized_end=1143 + _globals['_SUM']._serialized_start=1146 + _globals['_SUM']._serialized_end=1332 + _globals['_HISTOGRAM']._serialized_start=1335 + _globals['_HISTOGRAM']._serialized_end=1508 + _globals['_EXPONENTIALHISTOGRAM']._serialized_start=1511 + _globals['_EXPONENTIALHISTOGRAM']._serialized_end=1706 + _globals['_SUMMARY']._serialized_start=1708 + _globals['_SUMMARY']._serialized_end=1788 + _globals['_NUMBERDATAPOINT']._serialized_start=1791 + _globals['_NUMBERDATAPOINT']._serialized_end=2053 + _globals['_HISTOGRAMDATAPOINT']._serialized_start=2056 + _globals['_HISTOGRAMDATAPOINT']._serialized_end=2414 + _globals['_EXPONENTIALHISTOGRAMDATAPOINT']._serialized_start=2417 + _globals['_EXPONENTIALHISTOGRAMDATAPOINT']._serialized_end=3019 + _globals['_EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS']._serialized_start=2947 + _globals['_EXPONENTIALHISTOGRAMDATAPOINT_BUCKETS']._serialized_end=2995 + _globals['_SUMMARYDATAPOINT']._serialized_start=3022 + _globals['_SUMMARYDATAPOINT']._serialized_end=3347 + _globals['_SUMMARYDATAPOINT_VALUEATQUANTILE']._serialized_start=3291 + _globals['_SUMMARYDATAPOINT_VALUEATQUANTILE']._serialized_end=3341 + _globals['_EXEMPLAR']._serialized_start=3350 + _globals['_EXEMPLAR']._serialized_end=3543 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/resource/v1/resource_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/resource/v1/resource_pb2.py new file mode 100644 index 0000000..4d49807 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/resource/v1/resource_pb2.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/resource/v1/resource.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.opentelemetry/proto/resource/v1/resource.proto\x12\x1fopentelemetry.proto.resource.v1\x1a*opentelemetry/proto/common/v1/common.proto\"i\n\x08Resource\x12;\n\nattributes\x18\x01 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\rB\x83\x01\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\x01Z*go.opentelemetry.io/proto/otlp/resource/v1\xaa\x02\x1fOpenTelemetry.Proto.Resource.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.resource.v1.resource_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\"io.opentelemetry.proto.resource.v1B\rResourceProtoP\001Z*go.opentelemetry.io/proto/otlp/resource/v1\252\002\037OpenTelemetry.Proto.Resource.V1' + _globals['_RESOURCE']._serialized_start=127 + _globals['_RESOURCE']._serialized_end=232 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/trace/v1/trace_pb2.py b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/trace/v1/trace_pb2.py new file mode 100644 index 0000000..2db3d06 --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_impl/v5/opentelemetry/proto/trace/v1/trace_pb2.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: opentelemetry/proto/trace/v1/trace.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.common.v1 import common_pb2 as opentelemetry_dot_proto_dot_common_dot_v1_dot_common__pb2 +from snowflake.telemetry._internal.proto_impl.v5.opentelemetry.proto.resource.v1 import resource_pb2 as opentelemetry_dot_proto_dot_resource_dot_v1_dot_resource__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(opentelemetry/proto/trace/v1/trace.proto\x12\x1copentelemetry.proto.trace.v1\x1a*opentelemetry/proto/common/v1/common.proto\x1a.opentelemetry/proto/resource/v1/resource.proto\"Q\n\nTracesData\x12\x43\n\x0eresource_spans\x18\x01 \x03(\x0b\x32+.opentelemetry.proto.trace.v1.ResourceSpans\"\xa7\x01\n\rResourceSpans\x12;\n\x08resource\x18\x01 \x01(\x0b\x32).opentelemetry.proto.resource.v1.Resource\x12=\n\x0bscope_spans\x18\x02 \x03(\x0b\x32(.opentelemetry.proto.trace.v1.ScopeSpans\x12\x12\n\nschema_url\x18\x03 \x01(\tJ\x06\x08\xe8\x07\x10\xe9\x07\"\x97\x01\n\nScopeSpans\x12\x42\n\x05scope\x18\x01 \x01(\x0b\x32\x33.opentelemetry.proto.common.v1.InstrumentationScope\x12\x31\n\x05spans\x18\x02 \x03(\x0b\x32\".opentelemetry.proto.trace.v1.Span\x12\x12\n\nschema_url\x18\x03 \x01(\t\"\x84\x08\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12\x16\n\x0eparent_span_id\x18\x04 \x01(\x0c\x12\r\n\x05\x66lags\x18\x10 \x01(\x07\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\x39\n\x04kind\x18\x06 \x01(\x0e\x32+.opentelemetry.proto.trace.v1.Span.SpanKind\x12\x1c\n\x14start_time_unix_nano\x18\x07 \x01(\x06\x12\x1a\n\x12\x65nd_time_unix_nano\x18\x08 \x01(\x06\x12;\n\nattributes\x18\t \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\n \x01(\r\x12\x38\n\x06\x65vents\x18\x0b \x03(\x0b\x32(.opentelemetry.proto.trace.v1.Span.Event\x12\x1c\n\x14\x64ropped_events_count\x18\x0c \x01(\r\x12\x36\n\x05links\x18\r \x03(\x0b\x32\'.opentelemetry.proto.trace.v1.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x0e \x01(\r\x12\x34\n\x06status\x18\x0f \x01(\x0b\x32$.opentelemetry.proto.trace.v1.Status\x1a\x8c\x01\n\x05\x45vent\x12\x16\n\x0etime_unix_nano\x18\x01 \x01(\x06\x12\x0c\n\x04name\x18\x02 \x01(\t\x12;\n\nattributes\x18\x03 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x04 \x01(\r\x1a\xac\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\x0c\x12\x0f\n\x07span_id\x18\x02 \x01(\x0c\x12\x13\n\x0btrace_state\x18\x03 \x01(\t\x12;\n\nattributes\x18\x04 \x03(\x0b\x32\'.opentelemetry.proto.common.v1.KeyValue\x12 \n\x18\x64ropped_attributes_count\x18\x05 \x01(\r\x12\r\n\x05\x66lags\x18\x06 \x01(\x07\"\x99\x01\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x16\n\x12SPAN_KIND_INTERNAL\x10\x01\x12\x14\n\x10SPAN_KIND_SERVER\x10\x02\x12\x14\n\x10SPAN_KIND_CLIENT\x10\x03\x12\x16\n\x12SPAN_KIND_PRODUCER\x10\x04\x12\x16\n\x12SPAN_KIND_CONSUMER\x10\x05\"\xae\x01\n\x06Status\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x63ode\x18\x03 \x01(\x0e\x32/.opentelemetry.proto.trace.v1.Status.StatusCode\"N\n\nStatusCode\x12\x15\n\x11STATUS_CODE_UNSET\x10\x00\x12\x12\n\x0eSTATUS_CODE_OK\x10\x01\x12\x15\n\x11STATUS_CODE_ERROR\x10\x02J\x04\x08\x01\x10\x02*\x9c\x01\n\tSpanFlags\x12\x19\n\x15SPAN_FLAGS_DO_NOT_USE\x10\x00\x12 \n\x1bSPAN_FLAGS_TRACE_FLAGS_MASK\x10\xff\x01\x12*\n%SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK\x10\x80\x02\x12&\n!SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK\x10\x80\x04\x42w\n\x1fio.opentelemetry.proto.trace.v1B\nTraceProtoP\x01Z\'go.opentelemetry.io/proto/otlp/trace/v1\xaa\x02\x1cOpenTelemetry.Proto.Trace.V1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'opentelemetry.proto.trace.v1.trace_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\037io.opentelemetry.proto.trace.v1B\nTraceProtoP\001Z\'go.opentelemetry.io/proto/otlp/trace/v1\252\002\034OpenTelemetry.Proto.Trace.V1' + _globals['_SPANFLAGS']._serialized_start=1782 + _globals['_SPANFLAGS']._serialized_end=1938 + _globals['_TRACESDATA']._serialized_start=166 + _globals['_TRACESDATA']._serialized_end=247 + _globals['_RESOURCESPANS']._serialized_start=250 + _globals['_RESOURCESPANS']._serialized_end=417 + _globals['_SCOPESPANS']._serialized_start=420 + _globals['_SCOPESPANS']._serialized_end=571 + _globals['_SPAN']._serialized_start=574 + _globals['_SPAN']._serialized_end=1602 + _globals['_SPAN_EVENT']._serialized_start=1131 + _globals['_SPAN_EVENT']._serialized_end=1271 + _globals['_SPAN_LINK']._serialized_start=1274 + _globals['_SPAN_LINK']._serialized_end=1446 + _globals['_SPAN_SPANKIND']._serialized_start=1449 + _globals['_SPAN_SPANKIND']._serialized_end=1602 + _globals['_STATUS']._serialized_start=1605 + _globals['_STATUS']._serialized_end=1779 + _globals['_STATUS_STATUSCODE']._serialized_start=1695 + _globals['_STATUS_STATUSCODE']._serialized_end=1773 +# @@protoc_insertion_point(module_scope) diff --git a/src/snowflake/telemetry/_internal/proto_proxy/__init__.py b/src/snowflake/telemetry/_internal/proto_proxy/__init__.py new file mode 100644 index 0000000..1aee7be --- /dev/null +++ b/src/snowflake/telemetry/_internal/proto_proxy/__init__.py @@ -0,0 +1,25 @@ +# +# Copyright (c) 2012-2024 Snowflake Inc. All rights reserved. +# +import os + +try: + if os.environ.get("SNOWFLAKE_TELEMETRY_NO_PROTOBUF") is not None: + raise ImportError + import google.protobuf + protobuf_version = google.protobuf.__version__ + major = int(protobuf_version.split('.')[0]) + minor = int(protobuf_version.split('.')[1]) + if major >= 6: + raise ImportError + # support protobuf >=3.19, <6.0 + if major >= 5 and major < 6: + PROTOBUF_VERSION_MAJOR = 5 + elif major >= 4: + PROTOBUF_VERSION_MAJOR = 4 + elif major == 3 and minor >= 19: + PROTOBUF_VERSION_MAJOR = 3 + else: + raise ImportError +except: + PROTOBUF_VERSION_MAJOR = -1 diff --git a/tests/snowflake-telemetry-test-utils/setup.py b/tests/snowflake-telemetry-test-utils/setup.py index 6254955..dd50764 100644 --- a/tests/snowflake-telemetry-test-utils/setup.py +++ b/tests/snowflake-telemetry-test-utils/setup.py @@ -6,6 +6,18 @@ DESCRIPTION = 'Snowflake Telemetry Test Utils' LONG_DESCRIPTION = 'This package provides test utils for testing snowflake-telemetry-python' +benchmark_requires = [ + "google-benchmark" +] +code_gen_requires = [ + "Jinja2 == 3.1.4", + "grpcio-tools >= 1.62.3", + "black >= 24.1.0", + "isort >= 5.12.0", +] +tox_requires = [ + "tox >= 4.0.0" +] setup( name="snowflake-telemetry-test-utils", @@ -15,16 +27,17 @@ description=DESCRIPTION, long_description=LONG_DESCRIPTION, install_requires=[ - "opentelemetry-exporter-otlp-proto-common == 1.26.0", + "opentelemetry-proto", "pytest >= 7.0.0", "snowflake-telemetry-python == 0.6.0.dev", - "Jinja2 == 3.1.4", - "grpcio-tools >= 1.62.3", - "black >= 24.1.0", - "isort >= 5.12.0", "hypothesis >= 6.0.0", - "google-benchmark", ], + extras_require={ + "benchmark": benchmark_requires, + "code-gen": code_gen_requires, + "tox": tox_requires, + "all": benchmark_requires + code_gen_requires + tox_requires, + }, packages=find_namespace_packages( where='src' ), diff --git a/tests/snowflake-telemetry-test-utils/src/snowflake/telemetry/test/exporter_otlp_proto_common_helper.py b/tests/snowflake-telemetry-test-utils/src/snowflake/telemetry/test/exporter_otlp_proto_common_helper.py new file mode 100644 index 0000000..0036cc6 --- /dev/null +++ b/tests/snowflake-telemetry-test-utils/src/snowflake/telemetry/test/exporter_otlp_proto_common_helper.py @@ -0,0 +1,87 @@ +import logging +from typing import Any, List, Mapping, Optional, Sequence +from opentelemetry.util.types import Attributes +from opentelemetry.trace import SpanKind +from opentelemetry.sdk.trace import Status +from opentelemetry.proto.common.v1.common_pb2 import ( + AnyValue as PB2AnyValue, + ArrayValue as PB2ArrayValue, + KeyValue as PB2KeyValue, + KeyValueList as PB2KeyValueList, +) +from opentelemetry.proto.trace.v1.trace_pb2 import ( + Status as PB2Status, + Span as PB2SPan, +) + + +_logger = logging.getLogger(__name__) + + +def _encode_span_id(span_id: int) -> bytes: + return span_id.to_bytes(length=8, byteorder="big", signed=False) + + +def _encode_trace_id(trace_id: int) -> bytes: + return trace_id.to_bytes(length=16, byteorder="big", signed=False) + + +def _encode_key_value(key: str, value: Any) -> PB2KeyValue: + return PB2KeyValue(key=key, value=_encode_value(value)) + + +def _encode_attributes( + attributes: Attributes, +) -> Optional[List[PB2KeyValue]]: + if attributes: + pb2_attributes = [] + for key, value in attributes.items(): + # pylint: disable=broad-exception-caught + try: + pb2_attributes.append(_encode_key_value(key, value)) + except Exception as error: + _logger.exception("Failed to encode key %s: %s", key, error) + else: + pb2_attributes = None + return pb2_attributes + + +def _encode_value(value: Any) -> PB2AnyValue: + if isinstance(value, bool): + return PB2AnyValue(bool_value=value) + if isinstance(value, str): + return PB2AnyValue(string_value=value) + if isinstance(value, int): + return PB2AnyValue(int_value=value) + if isinstance(value, float): + return PB2AnyValue(double_value=value) + if isinstance(value, Sequence): + return PB2AnyValue( + array_value=PB2ArrayValue(values=[_encode_value(v) for v in value]) + ) + elif isinstance(value, Mapping): + return PB2AnyValue( + kvlist_value=PB2KeyValueList( + values=[_encode_key_value(str(k), v) for k, v in value.items()] + ) + ) + raise Exception(f"Invalid type {type(value)} of value {value}") + + +_SPAN_KIND_MAP = { + SpanKind.INTERNAL: PB2SPan.SpanKind.SPAN_KIND_INTERNAL, + SpanKind.SERVER: PB2SPan.SpanKind.SPAN_KIND_SERVER, + SpanKind.CLIENT: PB2SPan.SpanKind.SPAN_KIND_CLIENT, + SpanKind.PRODUCER: PB2SPan.SpanKind.SPAN_KIND_PRODUCER, + SpanKind.CONSUMER: PB2SPan.SpanKind.SPAN_KIND_CONSUMER, +} + + +def _encode_status(status: Status) -> Optional[PB2Status]: + pb2_status = None + if status is not None: + pb2_status = PB2Status( + code=status.status_code.value, + message=status.description, + ) + return pb2_status diff --git a/tests/test_log_encoder.py b/tests/test_log_encoder.py index dcf0e4e..07bc694 100644 --- a/tests/test_log_encoder.py +++ b/tests/test_log_encoder.py @@ -16,7 +16,7 @@ from typing import Sequence, Tuple from opentelemetry._logs import SeverityNumber -from opentelemetry.exporter.otlp.proto.common._internal import ( +from snowflake.telemetry.test.exporter_otlp_proto_common_helper import ( _encode_attributes, _encode_span_id, _encode_trace_id, @@ -69,7 +69,7 @@ def test_proto_log_exporter(self): def test_dropped_attributes_count(self): sdk_logs = self._get_test_logs_dropped_attributes() - encoded_logs = bytes(encode_logs(sdk_logs)) + encoded_logs = encode_logs(sdk_logs).SerializeToString() decoded_logs = PB2LogsData() decoded_logs.ParseFromString(encoded_logs) self.assertTrue(hasattr(sdk_logs[0].log_record, "dropped_attributes")) diff --git a/tests/test_proto_serialization.py b/tests/test_proto_serialization.py index 5e3458f..4cb4b86 100644 --- a/tests/test_proto_serialization.py +++ b/tests/test_proto_serialization.py @@ -17,11 +17,11 @@ import opentelemetry.proto.metrics.v1.metrics_pb2 as metrics_pb2 import opentelemetry.proto.resource.v1.resource_pb2 as resource_pb2 -import snowflake.telemetry._internal.opentelemetry.proto.logs.v1.logs_marshaler as logs_sf -import snowflake.telemetry._internal.opentelemetry.proto.trace.v1.trace_marshaler as trace_sf -import snowflake.telemetry._internal.opentelemetry.proto.common.v1.common_marshaler as common_sf -import snowflake.telemetry._internal.opentelemetry.proto.metrics.v1.metrics_marshaler as metrics_sf -import snowflake.telemetry._internal.opentelemetry.proto.resource.v1.resource_marshaler as resource_sf +import snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.logs.v1.logs_marshaler as logs_sf +import snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.trace.v1.trace_marshaler as trace_sf +import snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.common.v1.common_marshaler as common_sf +import snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.metrics.v1.metrics_marshaler as metrics_sf +import snowflake.telemetry._internal.proto_impl.py.opentelemetry.proto.resource.v1.resource_marshaler as resource_sf # Strategy for generating protobuf types def nullable(type): return st.one_of(st.none(), type) diff --git a/tests/test_protoc_plugin.py b/tests/test_protoc_plugin.py index c27d923..3edf56a 100644 --- a/tests/test_protoc_plugin.py +++ b/tests/test_protoc_plugin.py @@ -79,7 +79,7 @@ def test_protoc_plugin(self): generated_code_file_dir = tempfile.gettempdir() generated_code_file_name = proto_file_name.replace(".proto", "_marshaler.py") - generated_code_file = os.path.join(generated_code_file_dir, generated_code_file_name) + generated_code_file = os.path.join(generated_code_file_dir, "proto_impl", "py", generated_code_file_name) # Ensure generated code file exists self.assertTrue(os.path.exists(generated_code_file)) diff --git a/tests/test_trace_encoder.py b/tests/test_trace_encoder.py index d8b326e..72b63bd 100644 --- a/tests/test_trace_encoder.py +++ b/tests/test_trace_encoder.py @@ -17,11 +17,9 @@ import unittest from typing import List, Tuple -from opentelemetry.exporter.otlp.proto.common._internal import ( +from snowflake.telemetry.test.exporter_otlp_proto_common_helper import ( _encode_span_id, _encode_trace_id, -) -from opentelemetry.exporter.otlp.proto.common._internal.trace_encoder import ( _SPAN_KIND_MAP, _encode_status, ) diff --git a/tests/test_vendored_exporter_version.py b/tests/test_vendored_exporter_version.py index d6509b1..4bd25f9 100644 --- a/tests/test_vendored_exporter_version.py +++ b/tests/test_vendored_exporter_version.py @@ -3,9 +3,7 @@ from snowflake.telemetry._internal.opentelemetry.exporter.otlp.proto.common.version import __version__ as vendored_version from opentelemetry.sdk.version import __version__ as sdk_version -from opentelemetry.exporter.otlp.proto.common.version import __version__ as exporter_version class TestVendoredExporterVersion(unittest.TestCase): def test_version(self): self.assertEqual(sdk_version, vendored_version, "SDK version should match vendored version") - self.assertEqual(exporter_version, vendored_version, "Exporter version should match vendored version") diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..63f7561 --- /dev/null +++ b/tox.ini @@ -0,0 +1,42 @@ +[tox] +envlist = + py{38,39,310,311,312}, + py{38,39,310,311,312}-no-protobuf, + py{38,39,310,311,312}-protobuf-v{3,4,5}, + py{38,39,310,311,312}-codegen, + py{38,39,310,311,312}-marshaler + +[testenv] +description = Run tests +deps = + . + ./tests/snowflake-telemetry-test-utils +commands = + pytest --ignore=tests/test_proto_serialization.py --ignore=tests/test_protoc_plugin.py {posargs} + +[testenv:py{38,39,310,311,312}-no-protobuf] +description = Run tests without protobuf +setenv = + SNOWFLAKE_TELEMETRY_NO_PROTOBUF = 1 + +[testenv:py{38,39,310,311,312}-protobuf-v{3,4,5}] +description = Run tests with protobuf versions +deps = + . + ./tests/snowflake-telemetry-test-utils + v3: protobuf>=3.19,<4 + v4: protobuf>=4,<5 + v5: protobuf>=5,<6 + +[testenv:py{38,39,310,311,312}-codegen] +description = Run codegen tests +deps = + . + ./tests/snowflake-telemetry-test-utils[code-gen] +commands = + pytest tests/test_protoc_plugin.py + +[testenv:py{38,39,310,311,312}-marshaler] +description = Run marshaler tests +commands = + pytest tests/test_proto_serialization.py