-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ft: implement pluggable storage Preliminary work for supporting different storages beyond `telemetry_metrics_prometheus_core`. * ft: add Peep storage --------- Co-authored-by: Alexander Koutmos <akoutmos@gmail.com>
- Loading branch information
Showing
5 changed files
with
108 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if Code.ensure_loaded?(Peep) do | ||
defmodule PromEx.Storage.Peep do | ||
@behaviour PromEx.Storage | ||
|
||
@impl true | ||
def scrape(name) do | ||
Peep.get_all_metrics(name) | ||
|> Peep.Prometheus.export() | ||
|> IO.iodata_to_binary() | ||
end | ||
|
||
@impl true | ||
def child_spec(name, metrics) do | ||
opts = [ | ||
name: name, | ||
metrics: metrics | ||
] | ||
|
||
Peep.child_spec(opts) | ||
end | ||
end | ||
end |
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
Oops, something went wrong.