apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
28.94k stars 10.19k forks source link

Prometheus Metrics接入问题 #5077

Closed stancycowen closed 5 months ago

stancycowen commented 5 months ago

描述bug 官方文档里写了,暴露了Prometheus 格式的Metrics,实际怎么是个json? image

复现 请求 /metrics,是个JSON,Prometheus无法接入 {"names":["application.ready.time","application.started.time","disk.free","disk.total","executor.active","executor.completed","executor.pool.core","executor.pool.max","executor.pool.size","executor.queue.remaining","executor.queued","hikaricp.connections","hikaricp.connections.acquire","hikaricp.connections.active","hikaricp.connections.creation","hikaricp.connections.idle","hikaricp.connections.max","hikaricp.connections.min","hikaricp.connections.pending","hikaricp.connections.timeout","hikaricp.connections.usage","http.server.requests","jdbc.connections.active","jdbc.connections.idle","jdbc.connections.max","jdbc.connections.min","jvm.buffer.count","jvm.buffer.memory.used","jvm.buffer.total.capacity","jvm.classes.loaded","jvm.classes.unloaded","jvm.gc.concurrent.phase.time","jvm.gc.live.data.size","jvm.gc.max.data.size","jvm.gc.memory.allocated","jvm.gc.memory.promoted","jvm.gc.overhead","jvm.gc.pause","jvm.memory.committed","jvm.memory.max","jvm.memory.usage.after.gc","jvm.memory.used","jvm.threads.daemon","jvm.threads.live","jvm.threads.peak","jvm.threads.states","logback.events","process.cpu.usage","process.files.max","process.files.open","process.start.time","process.uptime","spring.data.repository.invocations","system.cpu.count","system.cpu.usage","system.load.average.1m","tomcat.sessions.active.current","tomcat.sessions.active.max","tomcat.sessions.alive.max","tomcat.sessions.created","tomcat.sessions.expired","tomcat.sessions.rejected"]}

请求 /metrics/disk.free {"name":"disk.free","description":"Usable space for path","baseUnit":"bytes","measurements":[{"statistic":"VALUE","value":3.29164107776E11}],"availableTags":[{"tag":"path","values":["/apollo-portal/."]}]}

期望

暴露标准的Prometheus格式 如:

HELP go_gc_duration_seconds A summary of the GC invocation durations.

TYPE go_gc_duration_seconds summary

go_gc_duration_seconds{quantile="0"} 1.0087e-05 go_gc_duration_seconds{quantile="0.25"} 2.2333e-05 go_gc_duration_seconds{quantile="0.5"} 4.3757e-05 go_gc_duration_seconds{quantile="0.75"} 9.1701e-05 go_gc_duration_seconds{quantile="1"} 0.000750728 go_gc_duration_seconds_sum 14.936457049

截图

image

额外的细节和日志

dosubot[bot] commented 5 months ago

🤖

您好,stancycowen。我看到您在尝试将Prometheus Metrics接入Apollo时遇到了问题。从您的描述来看,您期望的是Prometheus标准格式,但实际上得到的是JSON格式。

为了更好地帮助您解决这个问题,我需要一些额外的信息。您能否提供一下您当前的Prometheus配置以及您是如何尝试接入Prometheus的?这些信息将有助于我更准确地定位问题。

此外,如果您在尝试接入过程中遇到了任何错误信息,也请提供一下,这将有助于我们更快地找到问题的根源。

感谢您的配合!


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

nobodyiam commented 5 months ago

文档中写得是/prometheus,不是/metrics

stancycowen commented 5 months ago

文档中写得是/prometheus,不是/metrics

实在抱歉,跟我自己的东西搞混了。