如何在我的 grails 应用程序中获得 prometheus 导出器 运行?

How can I get prometheus exporters running in my grails app?

我在使用我的 grails 应用程序设置 prometheus 时遇到问题。我已经完全设置好并与其他出口商合作,只是不知道实际应用程序的去向。

我正在尝试使用在此处找到的 jmx 导出器:https://github.com/prometheus/jmx_exporter

按照该页面上的说明,导出器似乎已附加到 .jar 文件。但据我所知,grails 永远不会转换为 .jar 文件?我还知道 grails 在开发和生产环境中 运行 被编译成 .war 文件的区别。是否需要前后端分离?任何信息将不胜感激。

But to my knowledge, grails never gets converted to a .jar file?

您可以决定是否要将 Grails 应用部署为 .jar 文件。如果您使用的是 Grails 3 或 4,如果在项目中应用了 war Gradle 插件,assemble Gradle 任务将创建一个 .war 文件,否则将创建可执行 .jar 文件。

And also there's a difference I know between when grails is running in dev and production where it gets compiled into a .war file.

默认情况下,当您生成 .war 文件(或 .jar 文件)时,应用程序将 运行 处于生产模式,但您可以生成开发模式 .war 或开发模式 .jar 文件,如果你出于任何原因想要。

Does there need to be separation in the front and back end?

没有。