问题标签 [spring-boot-actuator]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
652 浏览

spring-boot - 如何在外部 tomcat 服务器中部署 Spring boot 启动应用程序

我试图只使用 spring 启动附带的基本端点,并希望在不使用 spring boot 的情况下部署在外部 tomcat 服务器中。如何实现这一点,任何人都可以帮助我。我需要做任何配置更改吗?这个网站给出了一个想法,但它使用的是旧版本的 spring-boot-actuate。EndpointHandlerMapping 和 EndpointHandlerAdapter 也没有随 Spring Boot 启动的较新版本一起提供。

无论如何,我在部署到服务器时找不到 404 资源。

0 投票
1 回答
9364 浏览

spring-boot - 使用 Spring Boot Actuator 的“未找到处理程序方法”日志消息

当我包含actuator并启用debug日志消息时,会有很多Did not find handler method for日志消息。

当我删除actuator然后这些日志消息消失。

我尝试过使用 Spring Boot 1.2.5 和 1.3.0.M3 版本,它的工作原理相同。spring initializr通过使用 usingwebactuator依赖项生成项目很容易尝试。

你知道可能是什么原因吗?

谢谢你。

0 投票
1 回答
11696 浏览

spring-boot - 添加执行器依赖项时 Spring Boot 启动错误

一旦我尝试按照文档将执行器添加到 Spring Boot 应用程序,我就会得到以下堆栈跟踪:

pom.xml:

org.springframework.boot spring-boot-starter-parent 1.2.5.RELEASE

UTF-8 1.7 1.0.0 3.1.0

Spring配置如下:

在 pom.xml 中我还缺少什么(或有冲突???)?执行器是否需要存在 DB?

谢谢。

0 投票
3 回答
13185 浏览

spring - 设置 server.context-path 的 Spring Boot Actuator 端点

在春季启动应用程序中,我设置了例如server.context-path=/mymodule. 这很方便,因为我不需要一遍又一遍地重复/mymodule前缀 in @RequestMapping。此外,我希望将执行器端点组合在具有公共前缀的 URL 上,因此我设置了management.context-path=/actuator. 现在执行器端点映射到/mymodule/actuator.

从安全角度来看,我希望将执行器端点映射到/actuator. 反向代理上的简单配置https://mydomain/api/mymodule -> http://oneofmyserver:port/mymodule可保护最终用户无法访问执行器。

是否可以将执行器端点映射到/actuator

0 投票
4 回答
16279 浏览

spring-boot - 将 Spring Boot 执行器指标(和 Dropwizard 指标)导出到 Statsd

我正在尝试将端点上可见的所有指标导出/metricsStatsdMetricWriter.

到目前为止,我有以下配置类:

它写入了我添加到 Statsd 的所有指标,但我还想发送/metrics端点上可见的系统/JVM 指标。

我错过了什么?

0 投票
3 回答
2500 浏览

git - 在 Spring Boot 中覆盖 git-commit-id-plugin 默认值

如何覆盖来自spring-boot-starter-parentgit-commit-id-plugin的默认值,将以下内容放入build/plugins似乎并不能解决问题:

在生成的git.properties中仍然看到默认的短版本:

更新:

根据下面@kan的建议,我尝试了以下方法:

它在git.properties中产生了以下内容:

但是,Spring Boot 应用程序的/info端点仍然显示缩短的版本,显然来自git.commit.id.abbrev

是否可以将 Spring Boot 插件重定向以选择另一个版本,或者我在此过程中是否遗漏了其他东西?

谢谢!

0 投票
1 回答
3780 浏览

spring-boot - Spring Boot Actuator 中的自定义端点

我正在尝试为 Spring Boot 应用程序编写自定义端点。我已经编写了如下的自定义端点实现。我没有包括额外的东西,比如 import 以减少代码的大小。

编写完上述代码后,我重新启动了应用程序并尝试从 /test 访问端点。但是,端点不可用。下面是 Spring Boot 启动应用。

除此之外,我拥有运行 Spring Boot Actuator 的一切。我可以访问默认端点,例如 /info、/metrics 等。

如果我在这里遗漏任何东西,你能分享你的知识吗?我假设自定义端点类将在没有开发人员进一步配置的情况下加载。

0 投票
1 回答
10063 浏览

spring-boot - 如何以编程方式从 spring-boot-actuator 获取指标?

我们在生产中有一个弹簧应用程序。它不是 Spring-boot。我发现这篇关于如何在非弹簧引导应用程序中使用弹簧引导执行器的帖子。

但是,我们的要求是聚合来自 /metrics 端点的数据并对其进行一些分析并报告状态指示器。

例如,我们可能会使用堆参数 {"heap.committed":480768,"heap.init":262144,"heap.used":294461,"heap":3728384,"threads.peak":37}来指示应用程序的状态 - FATAL、WARN 或 HEALTHY。

这只是一个例子。我们的要求更复杂。事实上,我们已经有了一个status endpoint想要添加更多信息的地方(基于来自 的数据/metrics/health端点spring-boot-actuator)。

我正在考虑实现这一点的一种方法是在应用程序中/metrics和内部进行 REST 调用/health,收集数据,聚合它们并返回响应。我不认为这是推荐的方式。

如果有一个 bean 可以直接提取这些参数,我会自动装配它并在需要时动态计算它们。(事实上​​,我会安排定期计算)。

我对从/metrics. 同时我也对以下内容感兴趣/health

我应该自动装配什么豆子并免费获得这些属性!

谢谢

编辑

这个帖子@Autowired MetricRepository。但由于某种原因,它只返回自定义计数器属性。它不返回堆、内存信息等例如: Reporting metric counter.calls.get_greeting=4 Reporting metric counter.calls.get_greeting.1=1 Reporting metric counter.calls.get_greeting.2=1 Reporting metric counter.calls.get_greeting.3=1 Reporting metric counter.calls.get_greeting.4=1 Reporting metric counter.status.200.greeting.number=4 Reporting metric counter.status.404.star-star=1

0 投票
1 回答
1303 浏览

spring-boot - 是否拥有 spring-boot-actuator 会改变 spring 应用程序的上下文根?

根据这篇文章,通过spring-boot-actuator依赖 in ,我可以从端点中pom.xml受益。actuator但是,我观察到它破坏了我现有的 spring 应用程序(它不是 spring-boot 应用程序)。

我在 pom.xml 中将以下内容添加到我的依赖项中

而已。我还没有对应用程序进行任何更改。我使用maven-t7-plugin. 现在我的应用程序端点http://localhost:8010/mycontext/foo返回 404。我dependencypom.xml. 现在我的应用程序返回200 OK上述请求。

请帮助我解决问题所在。我找不到任何明显的原因。

谢谢

0 投票
1 回答
2055 浏览

spring-mvc - spring-boot-actuator 1.2.5.RELEASE 在容器启动时抛出错误

一点背景知识:我正在尝试在我们生产的 Spring MVC 应用程序中使用 spring-boot-actuator。它不是一个弹簧启动应用程序。

我已经将一个简单的 spring MVC 应用程序与spring-boot-actuator. 示例代码可在此处获得。这是克隆和重现错误的简单应用程序。我有自述文件,里面有说明。

我使用spring-boot-actuator 1.1.1.RELEASE了依赖,它工作正常。但是,当我想使用时1.2.5.RELEASE,这就是容器启动期间出现错误的地方。