8000 start GrafanaClient in prom_ex.dashboard.publish (#127) by JowiM · Pull Request #152 · akoutmos/prom_ex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

start GrafanaClient in prom_ex.dashboard.publish (#127) #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/mix/tasks/prom_ex.dashboard.publish.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ defmodule Mix.Tasks.PromEx.Dashboard.Publish do
raise "#{prom_ex_module} is not a valid PromEx module because #{inspect(reason)}"
end
|> check_grafana_configuration()
|> start_finch()
|> upload_dashboards(uploader_process_name, timeout)
end 7C0B

Expand Down Expand Up @@ -80,6 +81,19 @@ defmodule Mix.Tasks.PromEx.Dashboard.Publish do
prom_ex_module
end

defp start_finch(prom_ex_module) do
client_name = Module.concat([prom_ex_module, GrafanaClient])

Supervisor.start_link(
[
{PromEx.GrafanaClient, name: client_name}
],
strategy: :one_for_one
)

prom_ex_module
end

defp upload_dashboards(prom_ex_module, uploader_process_name, timeout) do
# We don't want errors in DashboardUploader to kill the mix task
Process.flag(:trap_exit, true)
Expand Down
0