I couldn't make PromEx library work

I am tired after, fighting for 2 hours, trying to make Prom_Ex library work with Phoenix 1.6.

I was learning Realtime Phoenix book, and coming across the chapter about how important observability & metrics, I decided to go for the pull based approach that Prometheus offers.

I came across a great talk by Alex Koutmos:


But, after bashing my head, trying to make it work with latest stable release of Phoenix, I gave up.

It’s just not yielding, it’s versioning requirement is too stringent.


Resolving Hex dependencies...
#Incompatibility<#Term<your app>, cause: {:conflict, #Incompatibility<#Term<prom_ex >= 1.5.0>, cause: {:conflict, #Incompatibility<#Term<the lock>, #Term<prom_ex >= 1.5.0>, cause: {:conflict, #Incompatibility<#Term<the lock>, #Term<not telemetry 1.1.0 (optional)>, cause: :dependency>, #Incompatibility<#Term<prom_ex >= 1.5.0>, #Term<not telemetry ~> 1.0.0>, cause: :dependency>}>, #Incompatibility<#Term<your app>, #Term<not the lock>, cause: :dependency>}>, #Incompatibility<#Term<your app>, #Term<not prom_ex ~> 1.7.1>, cause: :dependency>}>
Resolution completed in 0.391s
Because "the lock" specifies telemetry 1.1.0 and prom_ex >= 1.5.0 depends on telemetry ~> 1.0.0, the lock is incompatible with prom_ex >= 1.5.0.
And because your app depends on the lock, prom_ex >= 1.5.0 is forbidden.
So, because your app depends on prom_ex ~> 1.7.1, version solving failed.
** (Mix) Hex dependency resolution failed

There is an open issue about this.

1 Like

Until a new prom_ex version with the updated dependencies is released, you might have to explicitly override the telemetry dependency in your mix.exs:

[
 ...
 {:telemetry, "~> 1.0", override: true},
]
1 Like

Thank you @trisolaran.

I had to make even more version changes, but eventually it worked.

{:finch, "~> 0.10.2"}, # Changed from 0.13
{:plug_cowboy, "~> 2.5.1"}
{:telemetry, "~> 1.0", override: true},
{:prom_ex, "~> 1.7.1"}

@adamu, yup seeing an open issue on GitHub, I decided to rant here.


I have no energy left now to explore it further. :sweat_smile:

It’s beautiful!!!


2 Likes