-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(GPX-696): Add support for labels endpoint (#56)
Improve query enforcement and error handling in proxy server 1. Added 'log_tokens' attribute in the config file, defaulting to false. This controls whether request tokens should be logged. 2. Improved the query enforcement in 'promqlEnforcer' function. Now, it also checks if the query is empty and sets it according to the 'allowedTenantLabels'. 3. Numerous changes were made in the 'reverseProxy' function to better handle requests and errors: - Removed the requirement for 'X-Plugin-Id' header, instead using URL path to differentiate between Thanos and Loki. + Added checks for '/api/v1/label' and '/api/v1/series' in the URL path. + Refactored error handling into two separate functions, one for standard error messages and another for custom messages. + Improved request logging to include method, URL, header, and body information. If 'log_tokens' is set to false, sensitive information is redacted. + Added support for handling POST requests and their bodies. The body query is also enforced using the 'enforceFunc' function. 4. Updated unit tests to reflect these changes.
- Loading branch information
Showing
5 changed files
with
128 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters