-
Notifications
You must be signed in to change notification settings - Fork 55
LCORE-302: User Data Collection #237
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
Changes from all commits
bfec4f3
c717127
dba0c08
da036c0
95ab581
acdaa3b
751d103
98fed29
4887e2a
0c7c878
cdf7907
773374c
e33a51b
51ef7f4
b866386
2e8d59a
636b6c9
f8becbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,5 +20,13 @@ user_data_collection: | |
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_disabled: false | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
| data_collector: | ||
| enabled: false | ||
| ingress_server_url: null | ||
| ingress_server_auth_token: null | ||
| ingress_content_service_name: null | ||
| collection_interval: 7200 # 2 hours in seconds | ||
| cleanup_after_send: true | ||
| connection_timeout_seconds: 30 | ||
|
Comment on lines
+23
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainConfiguration section is well-structured with appropriate defaults. The new However, there's a potential field name inconsistency that should be verified. Verify the field name consistency between the YAML configuration and the model definition: The YAML uses 🏁 Script executed: #!/bin/bash
# Check if the field name in YAML matches the model definition
echo "Checking field name in YAML configuration:"
grep -n "connection_timeout" lightspeed-stack.yaml
echo -e "\nChecking field name in model definition:"
ast-grep --pattern 'connection_timeout$_: $_' src/models/config.pyLength of output: 349 🏁 Script executed: #!/bin/bash
# Search for 'connection_timeout_seconds' in model definitions
echo "Searching for 'connection_timeout_seconds' in model definitions:"
grep -R "connection_timeout_seconds" -n src/models
echo -e "\nSearching for DataCollector class definition and its fields:"
grep -R "class DataCollector" -n src/modelsLength of output: 447 #!/bin/bash
# Locate the DataCollectorConfiguration class and list its fields
grep -n "class DataCollectorConfiguration" src/models/config.py
grep -A20 "class DataCollectorConfiguration" src/models/config.py
# Search specifically for timeout-related fields
grep -n "timeout" src/models/config.py🏁 Script executed: #!/bin/bash
# Locate the DataCollectorConfiguration class and list its fields
grep -n "class DataCollectorConfiguration" src/models/config.py
grep -A20 "class DataCollectorConfiguration" src/models/config.py
# Search specifically for timeout-related fields within the class
sed -n '88,120p' src/models/config.py | grep -n "timeout"Length of output: 1387 Rename The Pydantic model Please update cleanup_after_send: true
- connection_timeout_seconds: 30
+ connection_timeout: 30This ensures the configuration maps correctly to 🤖 Prompt for AI Agents |
||
| authentication: | ||
| module: "noop" | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,26 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Data collector runner.""" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import logging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from models.config import DataCollectorConfiguration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from services.data_collector import DataCollectorService | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger: logging.Logger = logging.getLogger(__name__) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def start_data_collector(configuration: DataCollectorConfiguration) -> None: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """Start the data collector service as a standalone process.""" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.info("Starting data collector runner") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if not configuration.enabled: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.info("Data collection is disabled") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| service = DataCollectorService() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| service.run() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| except Exception as e: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.error( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Data collector service encountered an exception: %s", e, exc_info=True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| raise | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+19
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify configuration consistency between runner and service The runner receives a Consider either:
🏁 Script executed: #!/bin/bash
# Check how DataCollectorService accesses configuration
ast-grep --pattern 'class DataCollectorService {
$$$
}'
# Check for configuration access patterns in the service
rg -A 10 "configuration\." src/services/data_collector.pyLength of output: 3498 I’d like to confirm how the runner receives and passes the configuration. Let’s pull the full runner code: 🏁 Script executed: #!/bin/bash
sed -n '1,200p' src/runners/data_collector.pyLength of output: 783 Continuing verification of how configuration is passed into the service: 🏁 Script executed: #!/bin/bash
# Show imports and top of DataCollectorService
sed -n '1,50p' src/services/data_collector.py
# Locate DataCollectorConfiguration definition
rg -n "class DataCollectorConfiguration" -A5 src/models/config.pyLength of output: 2088 Synchronize runner and service configuration sources The Please update the implementation so both use the same config:
Example diff: # src/runners/data_collector.py
- service = DataCollectorService()
+ service = DataCollectorService(configuration)
# src/services/data_collector.py
-class DataCollectorService: # pylint: disable=too-few-public-methods
+class DataCollectorService: # pylint: disable=too-few-public-methods
+ def __init__(self, config: DataCollectorConfiguration):
+ self._collector_config = config
def run(self) -> None:
- collector_config = configuration.user_data_collection_configuration.data_collector
+ collector_config = self._collector_config
logger.info("Starting data collection service")
…📝 Committable suggestion
Suggested change
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Services package.""" |
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.
Shouldn't it be a separate root-level configuration? Like
As those are two independent pieces.