I think I found the issue. I have to add a `content-type` header to the response that has the value `application/openmetrics-text` On Wednesday, March 31, 2021 at 3:50:06 PM UTC-4 Sandes de Silva wrote:
> Hi Julien, > > Thanks for responding. I'm using the following library: > https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-prometheus > > I wanted to add support for exemplars for this library so for now I'm just > modifying this method ( > https://github.com/open-telemetry/opentelemetry-js/blob/853fcb94cd96cea0bd1af18cddb355345f76adad/packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts#L103) > > to return a plain string compatible with extended exposition format. > > Is changing the text format a configuration change? > > Sandes > > On Wednesday, March 31, 2021 at 3:41:47 PM UTC-4 Julien Pivotto wrote: > >> On 31 Mar 10:22, 'Sandes de Silva' via Prometheus Users wrote: >> > Hi, >> > >> > I'm trying to use this experimental feature and having no luck. Has >> anyone >> > here tried it? Is the usage documented anywhere? Here is my setup: >> > >> > Prom version: built locally off the main branch using docker >> > (rev: 763a0d805c8f7f6e2cbd49c4c2c5e250e9dc5cd2) >> > >> > CLI options: `--enable-feature=exemplar-storage` and >> > `--storage.exemplars.exemplars-limit=100000` along with the default >> options >> > provided by CMD directive on the Dockerfile >> > >> > Metrics: >> > # HELP request_total Counts total number of requests >> > # TYPE request_total counter >> > request_total{url="/collection/"} 3 1617208935086 # >> > {trace_id="234234234234234234234"} 1 >> > request_total{url="/insert/"} 3 1617208935091 # >> > {trace_id="234234234234234234234"} 1 >> > request_total{url="/get/"} 3 1617208935096 # >> > {trace_id="234234234234234234234"} 1 >> > >> > Seems like that's all that is required when I read the source code. >> However >> > I'm still getting the following error: >> > level=debug ts=2021-03-31T17:21:48.016Z caller=scrape.go:1149 >> > component="scrape manager" scrape_pool=node >> > target=http://192.168.1.198:9464/metrics msg="Append failed" >> err="expected >> > next entry after timestamp, got \"MNAME\"" >> >> Hello, >> >> >> It seems that you are using the Prometheus text format instead of >> Openmetrics. >> >> Which library are you using to produce this? We recommend to use the >> official Prometheus client libraries to produce openmetrics format. >> >> > >> > -- >> > 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/447dd8f6-e2a7-4533-a95e-089d6db798b0n%40googlegroups.com. >> >> >> >> >> -- >> Julien Pivotto >> @roidelapluie >> > -- 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/ca8d175c-1b5e-450f-9792-44217889ddd2n%40googlegroups.com.

