Add a generative AI observability folder, with sample code for instrumenting the Gen AI SDK.
Description
Provides sample code to be referenced from documentation on the Cloud Observability pages concerning how to use Cloud Observability for monitoring generative AI workloads.
I had initially attempted to send this to the generative-ai repo:
- https://github.com/GoogleCloudPlatform/generative-ai/pull/1882
... however, I was directed here as the correct repo to use, given the intention of using doc tags and referencing this from the Google Cloud docs site.
Checklist
-
[ X] I have followed Sample Guidelines from AUTHORING_GUIDE.MD
-
[X] README is updated to include all relevant information
-
[ ?] Tests pass:
nox -s py-3.9(see Test Environment Setup)- I'm uncertain about the best way to test this. Can you provide some guidance?
-
[ ? ] Lint pass:
nox -s lint(see Test Environment Setup)- I get an error that there is no "noxfile" when attempting to use
nox -s lint
- I get an error that there is no "noxfile" when attempting to use
-
[ ] These samples need a new API enabled in testing projects to pass (let us know which ones)
- Maybe. The sample code makes use of the following APIs:
- Cloud Logging (
logging.googleapis.com) - Cloud Monitoring (
monitoring.googleapis.com) - Telemetry API (
telemetry.googleapis.com)
- Cloud Logging (
- Maybe. The sample code makes use of the following APIs:
-
[ ] These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
- Uncertain. Let's discuss testing expectations/practices here.
-
[ ?] This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
- This adds a new folder, but I'm unsure what I should update this to (I'm not sure if there is a good existing GitHub team that has the appropriate members).
-
[ ] This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
- No
-
[ ] Please merge this PR for me once it is approved
- Yes please
Here is the summary of possible violations 😱
-
generative_ai_observability/genaisdk/main.py:8, tag
main_logic_support_snippet -
generative_ai_observability/genaisdk/main.py:54, tag
main_logic_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_instrumentation.py:21, tag
setup_otel_instrumentation_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:166, tag
create_otlp_creds_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:224, tag
setup_cloud_trace_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:241, tag
setup_cloud_monitoring_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:265, tag
setup_cloud_logging_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:289, tag
setup_otel_to_gcp_wiring_snippet
The end of the violation section. All the stuff below is FYI purposes only.
Here is the summary of changes.
You are about to add 8 region tags.
-
generative_ai_observability/genaisdk/main.py:8, tag
main_logic_support_snippet -
generative_ai_observability/genaisdk/main.py:54, tag
main_logic_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_instrumentation.py:21, tag
setup_otel_instrumentation_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:166, tag
create_otlp_creds_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:224, tag
setup_cloud_trace_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:241, tag
setup_cloud_monitoring_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:265, tag
setup_cloud_logging_snippet -
generative_ai_observability/genaisdk/otel_setup/setup_otel_to_gcp_wiring.py:289, tag
setup_otel_to_gcp_wiring_snippet
This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:
- [ ] Refresh this comment
This PR is amazing but need to interms of standards. Please check this folder and template folder to understand the best practices for sample.
Messaging you in PVT.
https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/genai
Inactive pull request. Please re-open if required.