Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion newrelic/core/infinite_tracing_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,24 @@
PROTOBUF_VERSION = (0, 0, 0)

# Import appropriate generated pb2 file for protobuf version
if PROTOBUF_VERSION >= (5,):
if PROTOBUF_VERSION >= (6,):
from newrelic.core.infinite_tracing_v6_pb2 import AttributeValue, RecordStatus, Span, SpanBatch # noqa: F401
elif PROTOBUF_VERSION >= (5,):
from newrelic.core.infinite_tracing_v5_pb2 import AttributeValue, RecordStatus, Span, SpanBatch # noqa: F401
elif PROTOBUF_VERSION >= (4,):
from newrelic.core.infinite_tracing_v4_pb2 import AttributeValue, RecordStatus, Span, SpanBatch # noqa: F401
else:
from newrelic.core.infinite_tracing_v3_pb2 import AttributeValue, RecordStatus, Span, SpanBatch # noqa: F401

# To generate the pb2 file:
#
# 1. Install grpcio-tools
# * The exact version needed is hard to determine, trial and error is normally used.
# * The newly generated pb2 file will specify the minimum protobuf version needed, we want that to be the first version from this major version series.
# 2. Run the command below to overwrite this file with the newly generated pb2 file.
# 3. Rename the pb2 file to infinite_tracing_vX_pb2 where X is the protobuf major version.
# 4. Restore this file from git.
# 5. Update the if statements above to import the new pb2 file when using the correct protobuf version.
# 6. Validate the generated pb2 file works with the oldest protobuf version in this major version series by importing this file.
#
# python -m grpc_tools.protoc --proto_path=newrelic/core --python_out=newrelic/core newrelic/core/infinite_tracing.proto
70 changes: 70 additions & 0 deletions newrelic/core/infinite_tracing_v6_pb2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: infinite_tracing.proto
# Protobuf Python Version: 6.30.0
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
6,
30,
0,
'',
'infinite_tracing.proto'
)
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()




DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16infinite_tracing.proto\x12\x15\x63om.newrelic.trace.v1\"7\n\tSpanBatch\x12*\n\x05spans\x18\x01 \x03(\x0b\x32\x1b.com.newrelic.trace.v1.Span\"\x86\x04\n\x04Span\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12?\n\nintrinsics\x18\x02 \x03(\x0b\x32+.com.newrelic.trace.v1.Span.IntrinsicsEntry\x12H\n\x0fuser_attributes\x18\x03 \x03(\x0b\x32/.com.newrelic.trace.v1.Span.UserAttributesEntry\x12J\n\x10\x61gent_attributes\x18\x04 \x03(\x0b\x32\x30.com.newrelic.trace.v1.Span.AgentAttributesEntry\x1aX\n\x0fIntrinsicsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.com.newrelic.trace.v1.AttributeValue:\x02\x38\x01\x1a\\\n\x13UserAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.com.newrelic.trace.v1.AttributeValue:\x02\x38\x01\x1a]\n\x14\x41gentAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.com.newrelic.trace.v1.AttributeValue:\x02\x38\x01\"t\n\x0e\x41ttributeValue\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\x42\x07\n\x05value\"%\n\x0cRecordStatus\x12\x15\n\rmessages_seen\x18\x01 \x01(\x04\x32\xc5\x01\n\rIngestService\x12T\n\nRecordSpan\x12\x1b.com.newrelic.trace.v1.Span\x1a#.com.newrelic.trace.v1.RecordStatus\"\x00(\x01\x30\x01\x12^\n\x0fRecordSpanBatch\x12 .com.newrelic.trace.v1.SpanBatch\x1a#.com.newrelic.trace.v1.RecordStatus\"\x00(\x01\x30\x01\x62\x06proto3')

_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'infinite_tracing_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
DESCRIPTOR._loaded_options = None
_globals['_SPAN_INTRINSICSENTRY']._loaded_options = None
_globals['_SPAN_INTRINSICSENTRY']._serialized_options = b'8\001'
_globals['_SPAN_USERATTRIBUTESENTRY']._loaded_options = None
_globals['_SPAN_USERATTRIBUTESENTRY']._serialized_options = b'8\001'
_globals['_SPAN_AGENTATTRIBUTESENTRY']._loaded_options = None
_globals['_SPAN_AGENTATTRIBUTESENTRY']._serialized_options = b'8\001'
_globals['_SPANBATCH']._serialized_start=49
_globals['_SPANBATCH']._serialized_end=104
_globals['_SPAN']._serialized_start=107
_globals['_SPAN']._serialized_end=625
_globals['_SPAN_INTRINSICSENTRY']._serialized_start=348
_globals['_SPAN_INTRINSICSENTRY']._serialized_end=436
_globals['_SPAN_USERATTRIBUTESENTRY']._serialized_start=438
_globals['_SPAN_USERATTRIBUTESENTRY']._serialized_end=530
_globals['_SPAN_AGENTATTRIBUTESENTRY']._serialized_start=532
_globals['_SPAN_AGENTATTRIBUTESENTRY']._serialized_end=625
_globals['_ATTRIBUTEVALUE']._serialized_start=627
_globals['_ATTRIBUTEVALUE']._serialized_end=743
_globals['_RECORDSTATUS']._serialized_start=745
_globals['_RECORDSTATUS']._serialized_end=782
_globals['_INGESTSERVICE']._serialized_start=785
_globals['_INGESTSERVICE']._serialized_end=982
# @@protoc_insertion_point(module_scope)
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ envlist =
python-adapter_waitress-{py37,py38,py39}-waitress010404,
python-agent_features-{py37,py38,py39,py310,py311,py312,py313}-{with,without}_extensions,
python-agent_features-pypy310-without_extensions,
python-agent_streaming-{py37,py38,py39,py310,py311,py312,py313}-protobuf05-{with,without}_extensions,
python-agent_streaming-py39-protobuf{03,0319,04}-{with,without}_extensions,
python-agent_streaming-{py37,py38,py39,py310,py311,py312,py313}-protobuf06-{with,without}_extensions,
python-agent_streaming-py39-protobuf{03,0319,04,05}-{with,without}_extensions,
python-agent_unittests-{py37,py38,py39,py310,py311,py312,py313}-{with,without}_extensions,
python-agent_unittests-pypy310-without_extensions,
python-application_celery-{py37,py38,py39,py310,py311,py312,py313,pypy310}-celerylatest,
Expand Down Expand Up @@ -220,6 +220,7 @@ deps =
adapter_waitress-waitresslatest: waitress
agent_features: beautifulsoup4
agent_features: protobuf
agent_streaming-protobuf06: protobuf<7
agent_streaming-protobuf05: protobuf<6
agent_streaming-protobuf04: protobuf<5
agent_streaming-protobuf03: protobuf<4
Expand Down
Loading