-
Notifications
You must be signed in to change notification settings - Fork 3
feat: added data seeder for observability to analytics #1147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @vsraccubits, 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 introduces a new data seeding utility to support observability analytics. It provides a Python script to populate a ClickHouse database with sample OpenTelemetry trace data, which is essential for testing the data pipeline that transforms raw traces into aggregated inference facts and metrics. This enhancement is crucial for validating the accuracy and reliability of the system's observability and analytics features. 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. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a data seeder for OpenTelemetry traces to facilitate testing of the observability to analytics pipeline. It adds a Python script for seeding data and a corresponding JSON file with sample traces. While the overall implementation is good, I've identified a couple of issues. The sample JSON data contains malformed JSON strings which could lead to parsing errors in downstream consumers. Additionally, the seeder script contains some unnecessary code that should be removed to improve clarity and maintainability.
| "model_inference.output": "[{\"type\":\"text\",\"text\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\"}]", | ||
| "model_inference.output_tokens": "31", | ||
| "model_inference.raw_request": "{\"messages\":[{\"role\":\"user\",\"content\":\"Summarize the given texts stream\"}],\"model\":\"gpt-4.1\",\"stream\":false,\"logprobs\":false}", | ||
| "model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSON string assigned to model_inference.raw_response is malformed. The completion_tokens key is missing a colon before its value (\"completion_tokens\"31). This will cause JSON parsing errors for any consumer of this data.
| "model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}", | |
| "model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}", |
| "model_inference.output": "[{\"type\":\"text\",\"text\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\"}]", | ||
| "model_inference.output_tokens": "31", | ||
| "model_inference.raw_request": "{\"messages\":[{\"role\":\"user\",\"content\":\"Summarize the given texts stream\"}],\"model\":\"gpt-4.1\",\"stream\":false,\"logprobs\":false}", | ||
| "model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to a previous entry, the JSON string for model_inference.raw_response is malformed. The completion_tokens key is missing a colon.
| "model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\"31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}", | |
| "model_inference.raw_response": "{\"id\":\"chatcmpl-CvH90MP6M9SoelWcZAX5Gr2ioA9o0\",\"object\":\"chat.completion\",\"created\":1767766634,\"model\":\"gpt-4.1-2025-04-14\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"Of course! Please provide the texts you would like summarized, and I'll create a concise summary for you.\",\"refusal\":null,\"annotations\":[]},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":31,\"total_tokens\":35,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"audio_tokens\":0,\"accepted_prediction_tokens\":0,\"rejected_prediction_tokens\":0}},\"service_tier\":\"default\",\"system_fingerprint\":\"fp_1a2c4a5ede\"}", |
| # Write SQL to temp file to avoid shell escaping issues | ||
| sql_file = Path("/tmp/otel_seed.sql") | ||
| sql_file.write_text(sql) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines write the generated SQL to a temporary file /tmp/otel_seed.sql, but this file is never used. The subprocess.run call on line 142 passes the sql string directly to the input parameter, which is then piped to the stdin of the clickhouse-client. The comment on line 132 is also misleading. This unnecessary file I/O and dead code should be removed to improve clarity and maintainability.
No description provided.