Skip to content

Commit

Permalink
Add opentelemetry as a submodule for latest xDS API (grpc#26850)
Browse files Browse the repository at this point in the history
* Add opentelemetry

* Python changes for opentelemetry

* Add opentelemetry to check submodules
  • Loading branch information
lidizheng authored Aug 2, 2021
1 parent 931f91b commit eb4b65a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
[submodule "third_party/opencensus-proto"]
path = third_party/opencensus-proto
url = https://github.com/census-instrumentation/opencensus-proto.git
[submodule "third_party/opentelemetry"]
path = third_party/opentelemetry
url = https://github.com/open-telemetry/opentelemetry-proto.git
1 change: 1 addition & 0 deletions third_party/opentelemetry
Submodule opentelemetry added at 60fa87
2 changes: 2 additions & 0 deletions tools/distrib/python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ validate/
google/
opencensus/
xds/
build/
opentelemetry/
7 changes: 6 additions & 1 deletion tools/distrib/python/xds_protos/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
VALIDATE_ROOT = os.path.join(GRPC_ROOT, 'third_party', 'protoc-gen-validate')
OPENCENSUS_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party',
'opencensus-proto', 'src')
OPENTELEMETRY_PROTO_ROOT = os.path.join(GRPC_ROOT, 'third_party',
'opentelemetry')
WELL_KNOWN_PROTOS_INCLUDE = pkg_resources.resource_filename(
'grpc_tools', '_proto')
OUTPUT_PATH = WORK_DIR
Expand Down Expand Up @@ -68,6 +70,7 @@ def add_test_import(proto_package_path: str,
'--proto_path={}'.format(VALIDATE_ROOT),
'--proto_path={}'.format(WELL_KNOWN_PROTOS_INCLUDE),
'--proto_path={}'.format(OPENCENSUS_PROTO_ROOT),
'--proto_path={}'.format(OPENTELEMETRY_PROTO_ROOT),
'--python_out={}'.format(OUTPUT_PATH),
]
COMPILE_BOTH = COMPILE_PROTO_ONLY + ['--grpc_python_out={}'.format(OUTPUT_PATH)]
Expand Down Expand Up @@ -121,11 +124,13 @@ def main():
compile_protos(GOOGLEAPIS_ROOT, os.path.join('google', 'type'))
compile_protos(VALIDATE_ROOT, 'validate')
compile_protos(OPENCENSUS_PROTO_ROOT)
compile_protos(OPENTELEMETRY_PROTO_ROOT)

# Generate __init__.py files for all modules
create_init_file(WORK_DIR)
for proto_root_module in [
'envoy', 'google', 'opencensus', 'udpa', 'validate', 'xds'
'envoy', 'google', 'opencensus', 'udpa', 'validate', 'xds',
'opentelemetry'
]:
for root, _, _ in os.walk(os.path.join(WORK_DIR, proto_root_module)):
package_path = os.path.relpath(root, WORK_DIR)
Expand Down
2 changes: 1 addition & 1 deletion tools/distrib/python/xds_protos/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
SETUP_REQUIRES = INSTALL_REQUIRES + ['grpcio-tools']
setuptools.setup(
name='xds-protos',
version='0.0.10',
version='0.0.11',
packages=PACKAGES,
description='Generated Python code from envoyproxy/data-plane-api',
long_description_content_type='text/x-rst',
Expand Down
1 change: 1 addition & 0 deletions tools/run_tests/sanity/check_submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ third_party/googleapis 82944da21578a53b74e547774cf62ed31a05b841
third_party/googletest c9ccac7cb7345901884aabf5d1a786cfa6e2f397
third_party/libuv 15ae750151ac9341e5945eb38f8982d59fb99201
third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89
third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df
third_party/protobuf 436bd7880e458532901c58f4d9d1ea23fa7edd52
third_party/protoc-gen-validate 872b28c457822ed9c2a5405da3c33f386ac0e86f
third_party/re2 aecba11114cf1fac5497aeb844b6966106de3eb6
Expand Down

0 comments on commit eb4b65a

Please sign in to comment.