Sure, thanks Julius, This is very helpful and I will try json_exporter too.
Thank you! Ketan On Friday, 1 May 2020 14:59:50 UTC+5:30, Julius Volz wrote: > > Oh, apparently we also have a JSON exporter in prometheus-community: > https://github.com/prometheus-community/json_exporter > > On Fri, May 1, 2020 at 11:28 AM Julius Volz <[email protected] > <javascript:>> wrote: > >> Or for a custom JSON exporter, see >> https://www.robustperception.io/writing-json-exporters-in-python >> >> On Fri, May 1, 2020 at 11:27 AM Julius Volz <[email protected] >> <javascript:>> wrote: >> >>> Btw., googling turned up >>> https://github.com/project-sunbird/prometheus-jsonpath-exporter - I >>> don't know this one at all, but if your REST endpoint serves JSON, it looks >>> like you could use this existing exporter to convert the JSON format to >>> Prometheus metrics via some configuration rules. >>> >>> On Fri, May 1, 2020 at 11:25 AM Julius Volz <[email protected] >>> <javascript:>> wrote: >>> >>>> Yes, it sounds like you probably will need to build a custom exporter >>>> for that to transform your custom REST format into the Prometheus metrics >>>> format. >>>> >>>> You can see a huge list of example exporters at >>>> https://prometheus.io/docs/instrumenting/exporters/, and general >>>> guidelines for writing exporters at >>>> https://prometheus.io/docs/instrumenting/writing_exporters/. >>>> >>>> On Thu, Apr 30, 2020 at 5:04 PM Ketan Talreja <[email protected] >>>> <javascript:>> wrote: >>>> >>>>> Hi All, >>>>> >>>>> I have a use-case where I need to collect rest endpoint output metric >>>>> i.e. let's say the output/response of rest endpoint is some value which I >>>>> need to export to prometheus for calculating how many times the endpoint >>>>> returned the 'x' value >>>>> >>>>> For example - >>>>> GET /<endpoint>/users - return list of users which need to be exported >>>>> to prometheus for metric calculation >>>>> >>>>> Question - >>>>> >>>>> Does anyone know how would I capture the endpoint results values and >>>>> export to prometheus? Do I need to consider implementing custom exporter >>>>> to >>>>> do this job? If yes, could you help in providing some samples. >>>>> >>>>> Thank you, >>>>> >>>>> Ketan >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Prometheus Users" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected] <javascript:>. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/prometheus-users/fa5a3aa6-5ec4-49d3-9058-5a8583fd183b%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/prometheus-users/fa5a3aa6-5ec4-49d3-9058-5a8583fd183b%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/ccd50f38-090d-43aa-ba04-b69361f9e084%40googlegroups.com.

