GoogleCloudPlatform / opentelemetry-operations-python

OpenTelemetry Python exporters for Google Cloud Monitoring and Trace
https://google-cloud-opentelemetry.readthedocs.io/en/stable/
Apache License 2.0
63 stars 45 forks source link

Add OTLP trace sample with GCP auth #307

Closed damemi closed 6 months ago

damemi commented 7 months ago

Following some examples from https://opentelemetry.io/docs/languages/python/instrumentation/, https://opentelemetry.io/docs/languages/python/exporters/#otlp-dependencies, https://github.com/googleapis/google-auth-library-python/blob/main/samples/cloud-client/snippets/authenticate_explicit_with_adc.py, and https://googleapis.dev/python/google-auth/latest/user-guide.html#requests to try to get a Google auth client and pass the headers in exporter requests

damemi commented 6 months ago

This is working now, not sure what the docs error is about though:

docs-ci: commands[0]> make -C docs/ clean html
make: Entering directory '/home/runner/work/opentelemetry-operations-python/opentelemetry-operations-python/docs'
Running Sphinx v4.3.1

Sphinx version error:
The sphinxcontrib.applehelp extension used by this project needs at least Sphinx v5.0; it therefore cannot be built with this version.
make: *** [Makefile:20: html] Error 2
make: Leaving directory '/home/runner/work/opentelemetry-operations-python/opentelemetry-operations-python/docs'
docs-ci: exit 2 (1.85 seconds) /home/runner/work/opentelemetry-operations-python/opentelemetry-operations-python> make -C docs/ clean html pid=[18](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/actions/runs/8070804469/job/22048998146?pr=307#step:6:19)88
  docs-ci: FAIL code 2 (27.12=setup[[25](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/actions/runs/8070804469/job/22048998146?pr=307#step:6:26).27]+cmd[1.85] seconds)
  evaluation failed :( (31.08 seconds)
Error: Process completed with exit code 2.
aabmass commented 6 months ago

This is working now, not sure what the docs error is about though:

Seems unrelated, probably broken at HEAD. I'll see if I can fix it

aabmass commented 6 months ago

Fix for the broken docs build https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/308