Skip to content

Conversation

@ademidoff
Copy link
Member

PMM-14554

Link to the Feature Build: SUBMODULES-0

If this PR adds, removes or alters one or more API endpoints, please review and add or update the relevant API documentation as well:

  • API Docs updated

If this PR is related to some other PRs in this or other repositories, please provide links to those PRs:

  • Links to related pull requests (optional).

BupycHuk and others added 30 commits December 4, 2025 17:14
Implement database schema for feature configuration using Option 3:
- Create new agent record type for real-time analytics
- Add MongoDBRealtimeAgentType constant to agent types
- Use existing agents table infrastructure
- Associate agent with service
- Agent status (running/stopped) represents enabled/disabled
- Retrieve credentials from existing MongoDB agents during creation

Changes:
- Add MongoDBRealtimeAgentType constant to models
- Update DSN helpers to handle MongoDB realtime agent
- Add CreateMongoDBRealtimeAgent helper function
- Update proto file with new agent type and messages
- Add agent to Files() method for certificate handling

No database migration needed as existing agents table supports new type.
- Introduced RTAOptions type for future Real-Time Analytics configuration.
- Implemented database/sql/driver.Valuer and Scanner interfaces for RTAOptions.
- Updated Agent and CreateAgentParams to include RTAOptions.
- Modified database schema to add rta_options column to agents table.
- Deleted MongoDBRealtimeAgent message and its associated parameters from the proto file.
- Removed AGENT_TYPE_MONGODB_REALTIME_AGENT from AgentType enum.
- Cleaned up related comments and documentation for clarity.
- Integrated RTAOptions into the Agent model, including updates to the Columns, String, Values, and Pointers methods to accommodate the new field.
- Adjusted the database schema to include the rta_options column for proper data handling.
…eation logic. Upgraded actions/checkout to a specific commit and actions/setup-node to a specific version. Added logic to prevent duplicate MongoDB Realtime Agents by checking for existing agents before creation.
…-14567

# Conflicts:
#	managed/models/agent_helpers.go
#	managed/models/agent_model_reform.go
#	managed/models/database.go
- Introduced the RealtimeAnalyticsService with methods to list currently running RTA agents.
- Added necessary proto files for gRPC and RESTful API integration.
- Implemented validation logic for request and response messages.
- Created service logic to handle agent data retrieval and filtering by cluster.
- Added unit tests to ensure functionality and correctness of the service methods.
- Updated PMM Server and MongoDB images in GitHub Actions workflows to specific versions.
- Enhanced the Realtime Analytics service by modifying the ListRunningRealtimeAgents method signature for clarity.
- Changed test assertions to use require.Empty for better readability.
- Changed the initialization of the Agents slice in the ListRunningRealtimeAgents method from using make to a shorthand slice literal for improved readability.
- Introduced ChangeRealtimeAnalyticsRequest and ChangeRealtimeAnalyticsResponse messages for enabling or disabling Real-Time Analytics (RTA) for specific services or clusters.
- Implemented ChangeRealtimeAnalytics method in RealtimeAnalyticsService to handle RTA state changes.
- Added validation logic to ensure either service_id or cluster is specified in the request.
- Updated gRPC and HTTP handlers to support the new functionality.
- Enhanced unit tests to cover various scenarios for enabling and disabling RTA.
- Updated assertions in TestChangeRealtimeAnalytics to use require.Empty for improved readability and clarity in test outcomes.
…AgentType in service and test files for consistency.
Co-authored-by: Alex Demidoff <alexander.demidoff@percona.com>
…DBAgentType in service and test files for consistency.
- Introduced a new in-memory store for real-time analytics queries to enhance performance and reduce lock contention.
- Updated the RTA service to utilize the new store, allowing for concurrent operations.
- Modified tests to accommodate the new store structure and ensure functionality.
- Added new entries to .gitignore for generated files.
… and simplify ChangeRealtimeAnalytics request. Update documentation to reflect that RTA can only be enabled/disabled for a service. Remove unused code and validation for cluster in related requests and tests.
BupycHuk and others added 9 commits December 22, 2025 11:16
…-14574-enable-disable-realtime-agent

# Conflicts:
#	api/realtimeanalytics/v1/realtimeanalytics.pb.go
#	api/realtimeanalytics/v1/realtimeanalytics.pb.gw.go
#	api/realtimeanalytics/v1/realtimeanalytics.pb.validate.go
#	api/realtimeanalytics/v1/realtimeanalytics.proto
#	api/realtimeanalytics/v1/realtimeanalytics_grpc.pb.go
#	managed/models/agent_helpers.go
#	managed/services/realtimeanalytics/service.go
#	managed/services/realtimeanalytics/service_test.go
…data management. Updated methods to handle query buckets with TTL, ensuring expired buckets are cleaned up correctly. Enhanced tests to validate bucket expiration and cleanup functionality.
…luster parameter. Updated related tests to reflect the change, ensuring consistency and clarity in query retrieval.
…ealtime Analytics Store tests, enhancing accuracy in shard usage verification.
@ademidoff ademidoff requested a review from a team as a code owner January 6, 2026 21:04
@ademidoff ademidoff requested review from JiriCtvrtka and idoqo and removed request for a team January 6, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants