Skip to content

Commit 4ae8662

Browse files
authored
Add new credential provider package / GCP credential provider for OTLP Exporter (#3766)
* start moving cred provider to contrib repo * Add GCP Auth Provider to Contrib, initial commit * Put package inside the exporter package * Respond to comments * Run generate_workflows * Fix broken test * Delete package specific CHANGELOG, update global CHANGELOG. * Respond to comments * Fix references now that package location has changed.. * Fix broken test and formatting * Fix formatting, broke ntest * Reemove package from releasing.md
1 parent b0679f1 commit 4ae8662

File tree

17 files changed

+683
-97
lines changed

17 files changed

+683
-97
lines changed

.github/workflows/core_contrib_test_0.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,36 @@ jobs:
24532453
- name: Run tests
24542454
run: tox -e py39-test-util-http -- -ra
24552455

2456+
py39-test-exporter-credential-provider-gcp:
2457+
name: exporter-credential-provider-gcp
2458+
runs-on: ubuntu-latest
2459+
timeout-minutes: 30
2460+
steps:
2461+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
2462+
uses: actions/checkout@v4
2463+
with:
2464+
repository: open-telemetry/opentelemetry-python-contrib
2465+
ref: ${{ env.CONTRIB_REPO_SHA }}
2466+
2467+
- name: Checkout core repo @ SHA - ${{ env.CORE_REPO_SHA }}
2468+
uses: actions/checkout@v4
2469+
with:
2470+
repository: open-telemetry/opentelemetry-python
2471+
ref: ${{ env.CORE_REPO_SHA }}
2472+
path: opentelemetry-python
2473+
2474+
- name: Set up Python 3.9
2475+
uses: actions/setup-python@v5
2476+
with:
2477+
python-version: "3.9"
2478+
architecture: "x64"
2479+
2480+
- name: Install tox
2481+
run: pip install tox-uv
2482+
2483+
- name: Run tests
2484+
run: tox -e py39-test-exporter-credential-provider-gcp -- -ra
2485+
24562486
py39-test-util-genai:
24572487
name: util-genai
24582488
runs-on: ubuntu-latest

.github/workflows/lint_0.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,25 @@ jobs:
10771077
- name: Run tests
10781078
run: tox -e lint-util-http
10791079

1080+
lint-exporter-credential-provider-gcp:
1081+
name: exporter-credential-provider-gcp
1082+
runs-on: ubuntu-latest
1083+
timeout-minutes: 30
1084+
steps:
1085+
- name: Checkout repo @ SHA - ${{ github.sha }}
1086+
uses: actions/checkout@v4
1087+
1088+
- name: Set up Python 3.13
1089+
uses: actions/setup-python@v5
1090+
with:
1091+
python-version: "3.13"
1092+
1093+
- name: Install tox
1094+
run: pip install tox-uv
1095+
1096+
- name: Run tests
1097+
run: tox -e lint-exporter-credential-provider-gcp
1098+
10801099
lint-util-genai:
10811100
name: util-genai
10821101
runs-on: ubuntu-latest

.github/workflows/test_1.yml

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,6 +3965,101 @@ jobs:
39653965
- name: Run tests
39663966
run: tox -e pypy3-test-util-http -- -ra
39673967

3968+
py39-test-exporter-credential-provider-gcp_ubuntu-latest:
3969+
name: exporter-credential-provider-gcp 3.9 Ubuntu
3970+
runs-on: ubuntu-latest
3971+
timeout-minutes: 30
3972+
steps:
3973+
- name: Checkout repo @ SHA - ${{ github.sha }}
3974+
uses: actions/checkout@v4
3975+
3976+
- name: Set up Python 3.9
3977+
uses: actions/setup-python@v5
3978+
with:
3979+
python-version: "3.9"
3980+
3981+
- name: Install tox
3982+
run: pip install tox-uv
3983+
3984+
- name: Run tests
3985+
run: tox -e py39-test-exporter-credential-provider-gcp -- -ra
3986+
3987+
py310-test-exporter-credential-provider-gcp_ubuntu-latest:
3988+
name: exporter-credential-provider-gcp 3.10 Ubuntu
3989+
runs-on: ubuntu-latest
3990+
timeout-minutes: 30
3991+
steps:
3992+
- name: Checkout repo @ SHA - ${{ github.sha }}
3993+
uses: actions/checkout@v4
3994+
3995+
- name: Set up Python 3.10
3996+
uses: actions/setup-python@v5
3997+
with:
3998+
python-version: "3.10"
3999+
4000+
- name: Install tox
4001+
run: pip install tox-uv
4002+
4003+
- name: Run tests
4004+
run: tox -e py310-test-exporter-credential-provider-gcp -- -ra
4005+
4006+
py311-test-exporter-credential-provider-gcp_ubuntu-latest:
4007+
name: exporter-credential-provider-gcp 3.11 Ubuntu
4008+
runs-on: ubuntu-latest
4009+
timeout-minutes: 30
4010+
steps:
4011+
- name: Checkout repo @ SHA - ${{ github.sha }}
4012+
uses: actions/checkout@v4
4013+
4014+
- name: Set up Python 3.11
4015+
uses: actions/setup-python@v5
4016+
with:
4017+
python-version: "3.11"
4018+
4019+
- name: Install tox
4020+
run: pip install tox-uv
4021+
4022+
- name: Run tests
4023+
run: tox -e py311-test-exporter-credential-provider-gcp -- -ra
4024+
4025+
py312-test-exporter-credential-provider-gcp_ubuntu-latest:
4026+
name: exporter-credential-provider-gcp 3.12 Ubuntu
4027+
runs-on: ubuntu-latest
4028+
timeout-minutes: 30
4029+
steps:
4030+
- name: Checkout repo @ SHA - ${{ github.sha }}
4031+
uses: actions/checkout@v4
4032+
4033+
- name: Set up Python 3.12
4034+
uses: actions/setup-python@v5
4035+
with:
4036+
python-version: "3.12"
4037+
4038+
- name: Install tox
4039+
run: pip install tox-uv
4040+
4041+
- name: Run tests
4042+
run: tox -e py312-test-exporter-credential-provider-gcp -- -ra
4043+
4044+
py313-test-exporter-credential-provider-gcp_ubuntu-latest:
4045+
name: exporter-credential-provider-gcp 3.13 Ubuntu
4046+
runs-on: ubuntu-latest
4047+
timeout-minutes: 30
4048+
steps:
4049+
- name: Checkout repo @ SHA - ${{ github.sha }}
4050+
uses: actions/checkout@v4
4051+
4052+
- name: Set up Python 3.13
4053+
uses: actions/setup-python@v5
4054+
with:
4055+
python-version: "3.13"
4056+
4057+
- name: Install tox
4058+
run: pip install tox-uv
4059+
4060+
- name: Run tests
4061+
run: tox -e py313-test-exporter-credential-provider-gcp -- -ra
4062+
39684063
py39-test-util-genai_ubuntu-latest:
39694064
name: util-genai 3.9 Ubuntu
39704065
runs-on: ubuntu-latest
@@ -4686,98 +4781,3 @@ jobs:
46864781

46874782
- name: Run tests
46884783
run: tox -e py39-test-instrumentation-aio-pika-1 -- -ra
4689-
4690-
py39-test-instrumentation-aio-pika-2_ubuntu-latest:
4691-
name: instrumentation-aio-pika-2 3.9 Ubuntu
4692-
runs-on: ubuntu-latest
4693-
timeout-minutes: 30
4694-
steps:
4695-
- name: Checkout repo @ SHA - ${{ github.sha }}
4696-
uses: actions/checkout@v4
4697-
4698-
- name: Set up Python 3.9
4699-
uses: actions/setup-python@v5
4700-
with:
4701-
python-version: "3.9"
4702-
4703-
- name: Install tox
4704-
run: pip install tox-uv
4705-
4706-
- name: Run tests
4707-
run: tox -e py39-test-instrumentation-aio-pika-2 -- -ra
4708-
4709-
py39-test-instrumentation-aio-pika-3_ubuntu-latest:
4710-
name: instrumentation-aio-pika-3 3.9 Ubuntu
4711-
runs-on: ubuntu-latest
4712-
timeout-minutes: 30
4713-
steps:
4714-
- name: Checkout repo @ SHA - ${{ github.sha }}
4715-
uses: actions/checkout@v4
4716-
4717-
- name: Set up Python 3.9
4718-
uses: actions/setup-python@v5
4719-
with:
4720-
python-version: "3.9"
4721-
4722-
- name: Install tox
4723-
run: pip install tox-uv
4724-
4725-
- name: Run tests
4726-
run: tox -e py39-test-instrumentation-aio-pika-3 -- -ra
4727-
4728-
py310-test-instrumentation-aio-pika-0_ubuntu-latest:
4729-
name: instrumentation-aio-pika-0 3.10 Ubuntu
4730-
runs-on: ubuntu-latest
4731-
timeout-minutes: 30
4732-
steps:
4733-
- name: Checkout repo @ SHA - ${{ github.sha }}
4734-
uses: actions/checkout@v4
4735-
4736-
- name: Set up Python 3.10
4737-
uses: actions/setup-python@v5
4738-
with:
4739-
python-version: "3.10"
4740-
4741-
- name: Install tox
4742-
run: pip install tox-uv
4743-
4744-
- name: Run tests
4745-
run: tox -e py310-test-instrumentation-aio-pika-0 -- -ra
4746-
4747-
py310-test-instrumentation-aio-pika-1_ubuntu-latest:
4748-
name: instrumentation-aio-pika-1 3.10 Ubuntu
4749-
runs-on: ubuntu-latest
4750-
timeout-minutes: 30
4751-
steps:
4752-
- name: Checkout repo @ SHA - ${{ github.sha }}
4753-
uses: actions/checkout@v4
4754-
4755-
- name: Set up Python 3.10
4756-
uses: actions/setup-python@v5
4757-
with:
4758-
python-version: "3.10"
4759-
4760-
- name: Install tox
4761-
run: pip install tox-uv
4762-
4763-
- name: Run tests
4764-
run: tox -e py310-test-instrumentation-aio-pika-1 -- -ra
4765-
4766-
py310-test-instrumentation-aio-pika-2_ubuntu-latest:
4767-
name: instrumentation-aio-pika-2 3.10 Ubuntu
4768-
runs-on: ubuntu-latest
4769-
timeout-minutes: 30
4770-
steps:
4771-
- name: Checkout repo @ SHA - ${{ github.sha }}
4772-
uses: actions/checkout@v4
4773-
4774-
- name: Set up Python 3.10
4775-
uses: actions/setup-python@v5
4776-
with:
4777-
python-version: "3.10"
4778-
4779-
- name: Install tox
4780-
run: pip install tox-uv
4781-
4782-
- name: Run tests
4783-
run: tox -e py310-test-instrumentation-aio-pika-2 -- -ra

.github/workflows/test_2.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,101 @@ env:
3232

3333
jobs:
3434

35+
py39-test-instrumentation-aio-pika-2_ubuntu-latest:
36+
name: instrumentation-aio-pika-2 3.9 Ubuntu
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 30
39+
steps:
40+
- name: Checkout repo @ SHA - ${{ github.sha }}
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Python 3.9
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.9"
47+
48+
- name: Install tox
49+
run: pip install tox-uv
50+
51+
- name: Run tests
52+
run: tox -e py39-test-instrumentation-aio-pika-2 -- -ra
53+
54+
py39-test-instrumentation-aio-pika-3_ubuntu-latest:
55+
name: instrumentation-aio-pika-3 3.9 Ubuntu
56+
runs-on: ubuntu-latest
57+
timeout-minutes: 30
58+
steps:
59+
- name: Checkout repo @ SHA - ${{ github.sha }}
60+
uses: actions/checkout@v4
61+
62+
- name: Set up Python 3.9
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: "3.9"
66+
67+
- name: Install tox
68+
run: pip install tox-uv
69+
70+
- name: Run tests
71+
run: tox -e py39-test-instrumentation-aio-pika-3 -- -ra
72+
73+
py310-test-instrumentation-aio-pika-0_ubuntu-latest:
74+
name: instrumentation-aio-pika-0 3.10 Ubuntu
75+
runs-on: ubuntu-latest
76+
timeout-minutes: 30
77+
steps:
78+
- name: Checkout repo @ SHA - ${{ github.sha }}
79+
uses: actions/checkout@v4
80+
81+
- name: Set up Python 3.10
82+
uses: actions/setup-python@v5
83+
with:
84+
python-version: "3.10"
85+
86+
- name: Install tox
87+
run: pip install tox-uv
88+
89+
- name: Run tests
90+
run: tox -e py310-test-instrumentation-aio-pika-0 -- -ra
91+
92+
py310-test-instrumentation-aio-pika-1_ubuntu-latest:
93+
name: instrumentation-aio-pika-1 3.10 Ubuntu
94+
runs-on: ubuntu-latest
95+
timeout-minutes: 30
96+
steps:
97+
- name: Checkout repo @ SHA - ${{ github.sha }}
98+
uses: actions/checkout@v4
99+
100+
- name: Set up Python 3.10
101+
uses: actions/setup-python@v5
102+
with:
103+
python-version: "3.10"
104+
105+
- name: Install tox
106+
run: pip install tox-uv
107+
108+
- name: Run tests
109+
run: tox -e py310-test-instrumentation-aio-pika-1 -- -ra
110+
111+
py310-test-instrumentation-aio-pika-2_ubuntu-latest:
112+
name: instrumentation-aio-pika-2 3.10 Ubuntu
113+
runs-on: ubuntu-latest
114+
timeout-minutes: 30
115+
steps:
116+
- name: Checkout repo @ SHA - ${{ github.sha }}
117+
uses: actions/checkout@v4
118+
119+
- name: Set up Python 3.10
120+
uses: actions/setup-python@v5
121+
with:
122+
python-version: "3.10"
123+
124+
- name: Install tox
125+
run: pip install tox-uv
126+
127+
- name: Run tests
128+
run: tox -e py310-test-instrumentation-aio-pika-2 -- -ra
129+
35130
py310-test-instrumentation-aio-pika-3_ubuntu-latest:
36131
name: instrumentation-aio-pika-3 3.10 Ubuntu
37132
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Add `rstcheck` to pre-commit to stop introducing invalid RST
2020
([#3777](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3777))
2121

22+
- `opentelemetry-exporter-credential-provider-gcp`: create this package which provides support for supplying your machine's Application Default Credentials (https://cloud.google.com/docs/authentication/application-default-credentials) to the OTLP Exporters created automatically by OpenTelemetry Python's auto instrumentation. These credentials authorize OTLP traces to be sent to `telemetry.googleapis.com`.
23+
[#3766](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3766).
2224

2325
## Version 1.37.0/0.58b0 (2025-09-11)
2426

RELEASING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ The workflow will create a pull request that should be merged in order to procee
9292
> - opentelemetry-instrumentation-langchain
9393
> - opentelemetry-instrumentation-weaviate
9494
> - opentelemetry-util-genai
95+
> - opentelemetry-exporter-credential-provider-gcp
9596
>
9697
> These libraries are also excluded from the general patch release.
9798

eachdist.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ packages=
3232
opentelemetry-exporter-jaeger-proto-grpc
3333
opentelemetry-exporter-jaeger
3434
opentelemetry-api
35+
opentelemetry-exporter-credential-provider-gcp
3536

3637
[prerelease]
3738
version=0.59b0.dev

0 commit comments

Comments
 (0)