Switch to Observability Pipeline endpoints for querying metrics#1536
Switch to Observability Pipeline endpoints for querying metrics#1536pjcdawkins merged 2 commits intoplatformsh:5.xfrom
Conversation
167435c to
de96051
Compare
96dfa31 to
dadcded
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the metrics command system by switching from the legacy metrics API to the new Observability Pipeline endpoints. The changes involve significant refactoring of the metrics command architecture and data model.
- Replaces the legacy metrics API with observability pipeline endpoints for querying metrics
- Introduces new model classes with type-safe enums and structured data handling
- Deprecates the
intervaloption andmetrics:curlcommand as they are not supported by the new pipeline
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Model/ProjectRoles.php | Style improvement for consistent comparison operator placement |
| src/Model/Metrics/TimeSpec.php | Removes interval parameter from TimeSpec constructor and related methods |
| src/Model/Metrics/SourceFieldPercentage.php | Adds new model for percentage calculations with value and limit fields |
| src/Model/Metrics/SourceField.php | Adds new model for source field definitions with metric kind, aggregation, and mountpoint |
| src/Model/Metrics/Sketch.php | Removes deprecated Sketch class that handled old API response format |
| src/Model/Metrics/Query.php | Complete refactor to support new observability pipeline query format |
| src/Model/Metrics/MetricKind.php | Adds enum for metric types and API constants for type and aggregation mapping |
| src/Model/Metrics/Format.php | Adds new enum-based formatting system with color-coded warning thresholds |
| src/Model/Metrics/Field.php | Simplifies Field class to use new format and source field system |
| src/Model/Metrics/Aggregation.php | Adds enum for aggregation types (avg, max) |
| src/Command/Metrics/MetricsCommandBase.php | Removes legacy base class with old API integration |
| src/Command/Metrics/MemCommand.php | Updates to use new AbstractMetricsCommandBase and new model classes |
| src/Command/Metrics/DiskUsageCommand.php | Updates to use new AbstractMetricsCommandBase and new model classes |
| src/Command/Metrics/CurlCommand.php | Deprecates command with warning message as it's not supported by new pipeline |
| src/Command/Metrics/CpuCommand.php | Updates to use new AbstractMetricsCommandBase and new model classes |
| src/Command/Metrics/AllMetricsCommand.php | Updates to use new AbstractMetricsCommandBase and comprehensive field mapping |
| src/Command/Metrics/AbstractMetricsCommandBase.php | Adds new base class with observability pipeline integration |
| .php-cs-fixer.dist.php | Adds rule to remove unused imports for better code quality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7465c48 to
13a0f3c
Compare
900e327 to
04bfc0a
Compare
0b94788 to
59ffeda
Compare
|
Noting: There are some changes here that will need to be communicated clearly in the changelog. I believe these are minor enough changes that they would be unlikely to break a dependent script and so they are warranted, particularly when accounting for the performance and other gains the new API brings.
cc @akalipetis |
59ffeda to
74591c9
Compare
74591c9 to
80d7ef7
Compare
* Switch to new endpoint for querying metrics * Address lint reports
This PR uses observability pipeline for metrics commands
It fixes OBS-1224
This deprecates the
intervaloption that is not supported on observability pipelines, and themetrics:curlcommand that is not supported by observability pipelines