[Otel] fix otel spans and attributes - #201
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request primarily focuses on enhancing OpenTelemetry observability by configuring specific limits for span, event, and link attributes within Kubernetes development and local environments. This ensures that detailed telemetry data is not truncated, improving debugging and monitoring capabilities. Additionally, it includes an update to the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix OpenTelemetry (Otel) spans and attributes. The changes involve increasing Otel limits in Kubernetes configurations, updating a submodule, and adjusting a log level in the Python code. My review identifies opportunities to improve maintainability by centralizing duplicated Kubernetes configurations into a base layer, removing commented-out code from the Dockerfile, and enhancing a logging statement to retain important debugging information.
|
|
||
| # export CORNSERVE_MOCK_SIDECAR=1 | ||
| # OTEL_SDK_DISABLED=true |
There was a problem hiding this comment.
These commented-out lines and the preceding blank line should be removed. OTEL_SDK_DISABLED=true is already configured via ENV on line 52. Leaving commented-out code, especially for configuration, can cause confusion and clutters the Dockerfile. If these are for developer convenience, they should be documented elsewhere, like in a developer guide.
| - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT=16384 | ||
| - OTEL_SPAN_EVENT_COUNT_LIMIT=16384 | ||
| - OTEL_SPAN_LINK_COUNT_LIMIT=16384 | ||
| - OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT=16384 | ||
| - OTEL_LINK_ATTRIBUTE_COUNT_LIMIT=16384 |
There was a problem hiding this comment.
These OpenTelemetry settings are also duplicated in kubernetes/kustomize/cornserve/overlays/local/kustomization.yaml. To improve maintainability and avoid duplication, these common settings should be moved to the base kustomization (../../base). Both dev and local overlays include the base, so they would inherit these settings automatically. This will make future changes to these values easier to manage.
| - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT=16384 | ||
| - OTEL_SPAN_EVENT_COUNT_LIMIT=16384 | ||
| - OTEL_SPAN_LINK_COUNT_LIMIT=16384 | ||
| - OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT=16384 | ||
| - OTEL_LINK_ATTRIBUTE_COUNT_LIMIT=16384 |
There was a problem hiding this comment.
| logger.info("Found pipeline class: %s", class_name) | ||
| except Exception: | ||
| logger.exception("Failed to load model_index.json from %s", model_id) | ||
| logger.warning("Failed to load model_index.json from %s", model_id) |
There was a problem hiding this comment.
Changing from logger.exception to logger.warning is reasonable since failing to load model_index.json is a recoverable condition. However, this change loses the exception traceback, which can be crucial for debugging if the failure is due to an unexpected reason (e.g., file corruption, permission issues) rather than the file simply not existing. To retain this valuable debugging information while still logging at the WARNING level, you should add exc_info=True.
| logger.warning("Failed to load model_index.json from %s", model_id) | |
| logger.warning("Failed to load model_index.json from %s", model_id, exc_info=True) |
No description provided.