forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor metric provider implementation
* Remove metric provider config to avoid introducing new public interfaces. Since there is only one provider (prometheus) and it doesn't have any configurable settings, remove the configuration changes for now. We can always add these in the future. * Remove dummy metric provider implementation. This isn't needed now that we're using the metrics.Metrics interface instead of metrics.GlobalMetrics. * Remove metrics.GlobalMetrics in favour of metrics.Metrics. Move the HTTP handler instrumentation interfaces into the server package to avoid coupling the metrics package to the net/http package. * Refactor the prometheus provider to implement the metrics.Metrics interface. Since the prometheus registry can error on Gather() calls, the provider has been updated to accept a logger and use ti when the Gather() call fails. This doesn't affect any public interfaces so it can be revisited in future if needed. Alteratnively we could add a Gather() interface onto metrics.Metrics which could return the error. * Refactor status plugin to include metrics in status update by default. Users implementing the status API are likely to need performance metrics to gauge the OPA's health. Moreover if they are implementing the status API it's unlikely they will want to poll the /metrics endpoint on the OPA HTTP API (which may not even be exposed.) * Move the prometheus endpoint test case into the e2e package so the server package has no dependencies on prometheus anymore. Signed-off-by: Torin Sandall <torinsandall@gmail.com>
- Loading branch information
Showing
16 changed files
with
340 additions
and
305 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.