Skip to content

Commit

Permalink
Updating package versions, Elixir version, fixing tests and bumping G…
Browse files Browse the repository at this point in the history
…rafana Agent version
  • Loading branch information
akoutmos committed Aug 7, 2024
1 parent efddbfe commit 5da8f1b
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 269 deletions.
40 changes: 10 additions & 30 deletions lib/prom_ex/grafana_agent/downloader.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,23 @@ defmodule PromEx.GrafanaAgent.Downloader do
"""

use OctoFetch,
latest_version: "0.23.0",
latest_version: "0.42.0",
github_repo: "grafana/agent",
download_versions: %{
"0.29.0" => [
{:darwin, :amd64, "2b51aab7cfa4daf9b18c857c85dddb9ee9086e7470c3585be661fd6577e15afe"},
{:darwin, :arm64, "4bf44f44a1e9f4e9c257bea8bcf63549bf4f8f575f8afca94ff0cac371f55ed9"},
{:linux, :amd64, "aa07cc24de9d607e6388ce85eec76b250f6a4f304ba86ec7e38fc351d9a2739a"},
{:linux, :arm64, "7d402893564e4054d7e1401d10031b9c2841832a2dab5212184f2b606cd08b0d"},
{:freebsd, :amd64, "28becd3451ae8d56f4976e87a622da7cd11ce8a02d9bd9f1ee6517785c7fd594"}
],
"0.23.0" => [
{:darwin, :amd64, "643044b35ed4bdfd9866a43b70e39d64f16709f9685b89a03b299da8834661b0"},
{:darwin, :arm64, "e94f7fd0e1ef9fb497cff4f1260cc22967d6a5b003dd2c99f494f9e457482dda"},
{:linux, :amd64, "9c846f8a1f7829f257759d63db6725831d7bfaba36f1689cdb1a12e92bb91b75"},
{:linux, :arm64, "3b85ce425026302028f7f07d41fa4fc14e9f028ffe7c9067194753cfa719e0d3"},
{:freebsd, :amd64, "ec067782cc0fcd9c4e951fd6dd0d8013df7f5ed2cd0acb495ab3acfeb6e72b92"}
],
"0.22.0" => [
{:darwin, :amd64, "1641b70c63fd077a7218b4f7edfca2ef96d103753f6e202611a694306c58ce58"},
{:darwin, :arm64, "671244ef0f262c71d9194a1db6765a16261d782ebb608df74558219d0a6ef561"},
{:linux, :amd64, "7d0611f51fa3da042a9d67cabc5fd3b6529dad75368f8858d234719db1b94c55"},
{:linux, :arm64, "152027ce40072db581fed8c6d58aad5df58b6e8ed2b85858a5df955391db4a8b"},
{:freebsd, :amd64, "a70d8d268e695906b484d2bd1302d744786571e211ba019e5cef907d4589f82f"}
],
"0.21.2" => [
{:darwin, :amd64, "cbd8744f0b280a392dc51441818917fdfb7738187a6281c8ab07a0aca0bb6bcb"},
{:darwin, :arm64, "3148ddfb0fac53d256a0e30cc9ce20e13cf2db02476fe08fd9b4f44521e38bc0"},
{:linux, :amd64, "2fb5b2017de181ed4cf1b6fbe6813ee490f0e316bb1b3770c566330658f4586d"},
{:linux, :arm64, "daba91ec861dbc9db22b08f4ef8c70721d5725804a59d5a62040a5decbea79fa"},
{:freebsd, :amd64, "f5bed6ee6113f6940d9b1a29e3067b6f2e54843e1e292dfc54651374823605f0"}
"0.42.0" => [
{:darwin, :amd64, "0b86ffb8cf1f25897880b71f6028f0666fc3227cb56e7e7b1597452930f4f9b3"},
{:darwin, :arm64, "b510b1dc46c0f82a3543f56f3ba198e387a69273fd2cba8801832f58985e12a2"},
{:linux, :amd64, "32acd8d2f1997205c9a87c88503bc40cdf2cb4874291f7f643bcf5741a1c761e"},
{:linux, :arm64, "eb62450f0e8293e77088034e6e25c3fd2b251cabd2f503600e770530cc7fc08c"},
{:freebsd, :amd64, "b66eb08b3769748321d1abca80fa85600bdeffd1cd28c5bdf3f0372ca4523ad5"}
]
}

require Logger

@impl true
def download_name(_version, os, arch) do
"agent-#{os}-#{arch}.zip"
"grafana-agent-#{os}-#{arch}.zip"
end

@impl true
Expand All @@ -57,11 +36,12 @@ defmodule PromEx.GrafanaAgent.Downloader do
output_dir
|> File.ls!()
|> Enum.any?(fn file ->
Regex.match?(~r/agent-(?:linux|darwin|freebsd|windows)-(?:amd64|arm64)/, file)
Regex.match?(~r/grafana-agent-(?:linux|darwin|freebsd|windows)-(?:amd64|arm64)/, file)
end)

if already_downloaded do
Logger.info("GrafanaAgent binary already present")

:skip
else
:cont
Expand Down
30 changes: 15 additions & 15 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule PromEx.MixProject do
[
app: :prom_ex,
version: "1.9.0",
elixir: "~> 1.11",
elixir: "~> 1.14",
name: "PromEx",
source_url: "https://github.com/akoutmos/prom_ex",
homepage_url: "https://hex.pm/packages/prom_ex",
Expand Down Expand Up @@ -54,23 +54,23 @@ defmodule PromEx.MixProject do
defp deps do
[
# Required dependencies
{:jason, "~> 1.2"},
{:finch, "~> 0.15"},
{:jason, "~> 1.4"},
{:finch, "~> 0.18"},
{:telemetry, ">= 1.0.0"},
{:telemetry_poller, "~> 1.0"},
{:telemetry_metrics, "~> 0.6 or ~> 1.0"},
{:telemetry_metrics_prometheus_core, "~> 1.0"},
{:plug_cowboy, "~> 2.5 or ~> 2.6"},
{:octo_fetch, "~> 0.3"},
{:telemetry_poller, "~> 1.1"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_metrics_prometheus_core, "~> 1.2"},
{:plug_cowboy, ">= 2.6.0"},
{:octo_fetch, "~> 0.4"},

# Optional dependencies depending on what telemetry events the user is interested in capturing
{:phoenix, ">= 1.5.0", optional: true},
{:phoenix_live_view, ">= 0.14.0", optional: true},
{:plug, ">= 1.12.1", optional: true},
{:ecto, ">= 3.5.0", optional: true},
{:oban, ">= 2.4.0", optional: true},
{:absinthe, ">= 1.6.0", optional: true},
{:broadway, ">= 1.0.2", optional: true},
{:phoenix, ">= 1.7.0", optional: true},
{:phoenix_live_view, ">= 0.20.0", optional: true},
{:plug, ">= 1.16.0", optional: true},
{:ecto, ">= 3.11.0", optional: true},
{:oban, ">= 2.10.0", optional: true},
{:absinthe, ">= 1.7.0", optional: true},
{:broadway, ">= 1.1.0", optional: true},

# PromEx development related dependencies
{:bypass, "~> 2.1", only: :test},
Expand Down
Loading

0 comments on commit 5da8f1b

Please sign in to comment.