Ah I see, there is a problem about this. when httpServer is enabled, it
doesn't registered `metrics` endpoint at the http router. so it fails with
"Resource not found".

I am filing an issue for that: -
https://github.com/apache/bookkeeper/issues/1538

for now, you can disable httpServer, so prometheus stats provider will
start its own http server to expose metrics. hope that works for you.

we will fix the issue and include it in the upcoming release.

- Sijie

On Mon, Jul 9, 2018 at 2:51 AM [email protected] <
[email protected]> wrote:

>
> But i got "Resource not found"。
>
> My config file is upload.
>
> ------------------------------
> [email protected]
>
>
> *From:* Sijie Guo <[email protected]>
> *Date:* 2018-07-09 15:30
> *To:* user <[email protected]>
> *Subject:* Re: Re: Problem of Prometheus Stats Providers
> Okay. So when httpServerEnabled is true, prometheus provider will not
> start a separated http endpoint. it will expose the metrics via the http
> servers under /metrics.
>
> so if you curl localhost:8080/metrics, you should be able to get all the
> metrics.
>
> - Sijie
>
> On Mon, Jul 9, 2018 at 12:06 AM [email protected] <
> [email protected]> wrote:
>
>> bookkeeper version is 4.7.1  , port of 8080 can reached. already have
>> restart bookeerper.
>>
>>
>> # The flag enables/disables starting the admin http server. Default value is 
>> 'false'.
>> httpServerEnabled=true
>>
>> # The http server port to listen on. Default value is 8080.
>> httpServerPort=8080
>>
>> # The http server class
>> httpServerClass=org.apache.bookkeeper.http.vertx.VertxHttpServer
>>
>>
>>
>> ------------------------------
>> [email protected]
>>
>>
>> *From:* Sijie Guo <[email protected]>
>> *Date:* 2018-07-09 14:04
>> *To:* user <[email protected]>
>> *Subject:* Re: Problem of Prometheus Stats Providers
>> Interesting, I have tried these settings at my laptop. I am able to curl
>> the metrics : "curl -s localhost:8000/metrics".
>>
>> Can you clarify a few things:
>>
>> - what version of bookkeeper are you using?
>> - did you happen to enable bookie http server? set httpServerEnabled to
>> be true
>>
>> - Sijie
>>
>> On Sun, Jul 8, 2018 at 8:53 PM [email protected] <
>> [email protected]> wrote:
>>
>>> set configs , but i can't reach 8000 port.
>>>
>>>
>>>
>>> #############################################################################
>>> ## Stats Providers
>>>
>>> #############################################################################
>>>
>>> # Whether statistics are enabled
>>> enableStatistics=true
>>>
>>> # The flag to enable recording task execution stats.
>>> enableTaskExecutionStats=true
>>>
>>> # Stats Provider Class (if `enableStatistics` are enabled)
>>> # Options:
>>>
>>> #   - Prometheus        : 
>>> org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
>>>
>>> #   - Codahale          : 
>>> org.apache.bookkeeper.stats.codahale.CodahaleMetricsProvider
>>>
>>> #   - Twitter Finagle   : 
>>> org.apache.bookkeeper.stats.twitter.finagle.FinagleStatsProvider
>>>
>>> #   - Twitter Ostrich   : 
>>> org.apache.bookkeeper.stats.twitter.ostrich.OstrichProvider
>>>
>>> #   - Twitter Science   : 
>>> org.apache.bookkeeper.stats.twitter.science.TwitterStatsProvider
>>> # Default value is:
>>> #   org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
>>> #
>>>
>>> # For configuring corresponding stats provider, see details at each section 
>>> below.
>>> #
>>>
>>> # 
>>> statsProviderClass=org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
>>>
>>>
>>> #############################################################################
>>> ## Prometheus Metrics Provider
>>>
>>> #############################################################################
>>>
>>> # These configs are used when using `PrometheusMetricsProvider`.
>>>
>>> statsProviderClass=org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
>>>
>>> # Default port for Prometheus metrics exporter
>>> prometheusStatsHttpPort=8000
>>>
>>> # latency stats rollover interval, in seconds
>>> prometheusStatsLatencyRolloverSeconds=60
>>>
>>>
>>>

Reply via email to