happysalada / phoenix-the-unoffcial-guide

MIT License
60 stars 3 forks source link

`PrometheusExporter` in instrumentation guide is undefined #12

Open ndarilek opened 4 years ago

ndarilek commented 4 years ago

Hey, thanks for this. I attempted to use your guide for Prometheus instrumentation, but I don't see PrometheusExporter defined anywhere. I.e.:

alias MyApp.{
  PhoenixInstrumenter,
  PipelineInstrumenter,
  PrometheusExporter,
  RepoInstrumenter,
  VersionInstrumenter
}

And yes, I did replace MyApp. :)

Thanks.

happysalada commented 4 years ago

I need to update this guide, it's quite old. Since telemetry appeared, there are different ways of doing things. In the meanwhile you have to check out the individual repos for prometheus integration and follow the installation there https://github.com/deadtrickster/prometheus-ecto (for Ecto. then there is a phoenix one)

I'm in the process of updating docs, but I'm afraid it will take a little bit of time

happysalada commented 4 years ago

actually I forgot to include the installation steps here https://github.com/deadtrickster/prometheus.ex If you replace ExampleInstrumenter by PrometheusInstrumenter on their instruction, you should be good to go

ndarilek commented 4 years ago

Cool, thanks for the quick reply! This compiles, but I can't call /metrics on my local app via curl. Is this only enabled in production, or is there another missing step to set up the /metrics route?

ndarilek commented 4 years ago

Never mind, found this post and that pointed me in the right direction.

Thanks for your help!