Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add details of the purpose of the metrics endpoint #44767

Open
wants to merge 2 commits into
base: 3.3.x
Choose a base branch
from

Conversation

jonatan-ivanov
Copy link
Member

As far as I know, the purpose of the /metrics actuator endpoint is mainly for troubleshooting the metrics the app recorded just like the /env endpoint is for troubleshooting the config of the app. It should not be used in production like Prometheus (you scrape it and try to create dashboards from the data) but it should be able to answer questions like:

  • What metrics and what dimensions are available?
  • What is the current value of a certain time-series on a certain instance?
  • Do certain operations cause a change in certain time-series?

This PR tries to call out this detail (the endpoint is for diagnosing the metrics).

@jonatan-ivanov jonatan-ivanov added the status: waiting-for-triage An issue we've not yet triaged label Mar 19, 2025
@@ -1,7 +1,7 @@
[[metrics]]
= Metrics (`metrics`)

The `metrics` endpoint provides access to application metrics.
The `metrics` endpoint provides access to application metrics to diagnose the metrics the application has recorded. This endpoint should not be "scraped" or used as a metrics backend in production. It's purpose is to show the currently registered metrics so users can see what metrics are available, what their current values are, and if triggering certain operations cause any change in certain values. If you want to diagnose your applications through the metrics they collect, you should use an external metrics backend. In this case, the `metrics` endpoint can still be useful.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to link "external metrics backend" to https://docs.spring.io/spring-boot/reference/actuator/metrics.html but Antora did not like xref:reference:actuator/metrics.adoc[external metrics backend], could somebody help me with the right xref?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What failure did you get? That xref seems to work for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just pushed a change to your branch. Let's see what CI makes of it.

Copy link
Member

@wilkinsona wilkinsona Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It failed. :spring-boot-project:spring-boot-docs:antora which pulls in the Actuator API docs worked for me locally. It's spring-boot-project:spring-boot-actuator-autoconfigure:antora that's failing on CI though.

Any ideas, @philwebb? The reference works fine when built as part of spring-boot-docs but not when just building the Actuator API docs on their own.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran ./gradlew antora and got the same error as CI:

ERROR (asciidoctor): target of xref not found: reference:actuator/metrics.adoc

Not sure if it helps but here's my build-scan (pulling down the changes you made and running the "root" antora task): https://ge.spring.io/s/g7ozmgj4eabn2

@jonatan-ivanov jonatan-ivanov changed the base branch from main to 3.3.x March 19, 2025 00:46
@wilkinsona wilkinsona force-pushed the metrics-endpoint-docs branch from dc7a464 to 7730937 Compare March 19, 2025 19:46
@jonatan-ivanov
Copy link
Member Author

jonatan-ivanov commented Apr 4, 2025

Can we merge this without the link and I can open a PR with adding the link back and try to figure out what's wrong with xref?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants