Skip to content

Commit 2e2feab

Browse files
Merge branch 'GoogleCloudPlatform:main' into configurator
2 parents 97c0dac + 73b6ac1 commit 2e2feab

File tree

108 files changed

+4036
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+4036
-342
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ docs/
33
.tox
44
**/venv/
55
.mypy_cache/
6+
**/__pycache__/
7+
e2e-test-server/wheels/

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99

1010
jobs:
1111
test:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
strategy:
1414
matrix:
1515
py:
@@ -18,6 +18,8 @@ jobs:
1818
- { version: "3.9", tox: "39" }
1919
- { version: "3.10", tox: "310" }
2020
- { version: "3.11", tox: "311" }
21+
- { version: "3.12", tox: "312" }
22+
- { version: "3.13", tox: "313" }
2123
env:
2224
run-matrix-combo: ${{ matrix.py.version }}
2325

@@ -43,7 +45,7 @@ jobs:
4345
-f py${{ matrix.py.tox }}-ci
4446
4547
lint:
46-
runs-on: ubuntu-latest
48+
runs-on: ubuntu-22.04
4749
strategy:
4850
matrix:
4951
target: [lint-ci, docs-ci, mypy-ci]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "CodeQL Analysis"
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# ┌───────────── minute (0 - 59)
7+
# │ ┌───────────── hour (0 - 23)
8+
# │ │ ┌───────────── day of the month (1 - 31)
9+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
10+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
11+
# │ │ │ │ │
12+
# │ │ │ │ │
13+
# │ │ │ │ │
14+
# * * * * *
15+
- cron: '30 1 * * *'
16+
push:
17+
branches: [ main ]
18+
pull_request:
19+
20+
jobs:
21+
CodeQL-Build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
# Initializes the CodeQL tools for scanning.
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: python
33+
34+
- name: Autobuild
35+
uses: github/codeql-action/autobuild@v2
36+
37+
- name: Perform CodeQL Analysis
38+
uses: github/codeql-action/analyze@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ venv/
115115
ENV/
116116
env.bak/
117117
venv.bak/
118+
myproject/
118119

119120
# Spyder project settings
120121
.spyderproject

.pylintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ contextmanager-decorators=contextlib.contextmanager
160160
# List of members which are set dynamically and missed by pylint inference
161161
# system, and so shouldn't trigger E1101 when accessed. Python regular
162162
# expressions are accepted.
163-
generated-members=
163+
164+
# Ignore protobuf https://github.com/protocolbuffers/protobuf/issues/10372
165+
generated-members=.*_pb2\..*
164166

165167
# Tells whether missing members accessed in mixin class should be ignored. A
166168
# mixin class is detected if its name ends with "mixin" (case insensitive).

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
[![Documentation Status](https://readthedocs.org/projects/google-cloud-opentelemetry/badge/?version=latest)](https://google-cloud-opentelemetry.readthedocs.io/en/latest/?badge=latest)
44
<!-- todo add pypi badges here -->
55

6-
Provides OpenTelemetry Python exporters, propagators, and resource detectors
6+
This repo provides OpenTelemetry Python exporters, propagators, and resource detectors
77
for Google Cloud Platform.
88

9+
To get started with instrumentation in Google Cloud, see [Generate traces and metrics with
10+
Python](https://cloud.google.com/stackdriver/docs/instrumentation/setup/python).
11+
912
## Documentation
1013

11-
Docs are available at <https://google-cloud-opentelemetry.readthedocs.io/en/latest/>
14+
To learn more about instrumentation and observability, including opinionated recommendations
15+
for Google Cloud Observability, visit [Instrumentation and
16+
observability](https://cloud.google.com/stackdriver/docs/instrumentation/overview).
17+
18+
API docs and additional examples are available at <https://google-cloud-opentelemetry.readthedocs.io/en/latest/>
1219

1320
## Installation
1421

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
steps:
16+
# Build function source zip with vendored wheels of packages in this monorepo
17+
- name: python:3.11-slim
18+
id: build
19+
script: |
20+
set -xe
21+
apt-get update
22+
apt-get install -y zip
23+
24+
cd e2e-test-server/
25+
# package monorepo libraries into wheels in local wheels/ directory
26+
pip wheel \
27+
--no-deps \
28+
--wheel-dir wheels \
29+
../opentelemetry-exporter-gcp-trace/ \
30+
../opentelemetry-resourcedetector-gcp/ \
31+
../opentelemetry-propagator-gcp
32+
33+
zip -qr function-source.zip .
34+
35+
# Run the test
36+
- name: $_TEST_RUNNER_IMAGE
37+
id: run-tests-cloud-run
38+
dir: /
39+
env: ["PROJECT_ID=$PROJECT_ID"]
40+
args:
41+
- cloud-functions-gen2
42+
- --functionsource=/workspace/e2e-test-server/function-source.zip
43+
- --runtime=python311
44+
- --entrypoint=cloud_functions_handler
45+
46+
logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs
47+
substitutions:
48+
_TEST_RUNNER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-e2e-testing:0.20.1

cloudbuild-e2e-cloud-run.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ steps:
3232

3333
logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs
3434
substitutions:
35-
_TEST_RUNNER_IMAGE: gcr.io/${PROJECT_ID}/opentelemetry-operations-e2e-testing:0.17.0
36-
_TEST_SERVER_IMAGE: gcr.io/${PROJECT_ID}/opentelemetry-operations-python-e2e-test-server:${SHORT_SHA}
35+
_TEST_RUNNER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-e2e-testing:0.20.1
36+
_TEST_SERVER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-python-e2e-test-server:${SHORT_SHA}

cloudbuild-e2e-gae-standard.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
steps:
16+
# Build function source zip with vendored wheels of packages in this monorepo
17+
- name: python:3.11-slim
18+
id: build
19+
script: |
20+
set -xe
21+
apt-get update
22+
apt-get install -y zip
23+
24+
cd e2e-test-server/
25+
# package monorepo libraries into wheels in local wheels/ directory
26+
pip wheel \
27+
--no-deps \
28+
--wheel-dir wheels \
29+
../opentelemetry-exporter-gcp-trace/ \
30+
../opentelemetry-resourcedetector-gcp/ \
31+
../opentelemetry-propagator-gcp
32+
33+
zip -qr appsource.zip .
34+
35+
# Run the test
36+
- name: $_TEST_RUNNER_IMAGE
37+
id: run-tests-gae-standard
38+
dir: /
39+
env: ["PROJECT_ID=$PROJECT_ID"]
40+
args:
41+
- gae-standard
42+
- --runtime=python311
43+
- --entrypoint=python main.py
44+
- --appsource=/workspace/e2e-test-server/appsource.zip
45+
46+
logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs
47+
substitutions:
48+
_TEST_RUNNER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-e2e-testing:0.20.1

cloudbuild-e2e-gae.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
steps:
16+
# Wait for the image to exist
17+
- name: "docker"
18+
id: wait-for-image
19+
entrypoint: "sh"
20+
timeout: 10m
21+
env: ["_TEST_SERVER_IMAGE=${_TEST_SERVER_IMAGE}"]
22+
args:
23+
- e2e-test-server/wait-for-image.sh
24+
25+
# Run the test
26+
- name: $_TEST_RUNNER_IMAGE
27+
id: run-tests-gae
28+
dir: /
29+
env: ["PROJECT_ID=$PROJECT_ID"]
30+
args:
31+
- gae
32+
- --image=$_TEST_SERVER_IMAGE
33+
- --runtime=python
34+
35+
logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs
36+
timeout: 20m
37+
substitutions:
38+
_TEST_RUNNER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-e2e-testing:0.20.1
39+
_TEST_SERVER_IMAGE: us-central1-docker.pkg.dev/${PROJECT_ID}/e2e-testing/opentelemetry-operations-python-e2e-test-server:${SHORT_SHA}

0 commit comments

Comments
 (0)