Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

feat(engine): Micrometer metrics #5337

Closed
punitdarira wants to merge 9 commits intocamunda:masterfrom
punitdarira:master
Closed

feat(engine): Micrometer metrics #5337
punitdarira wants to merge 9 commits intocamunda:masterfrom
punitdarira:master

Conversation

@punitdarira
Copy link
Contributor

related to #2771

@HeleneW-dot HeleneW-dot self-assigned this Aug 7, 2025
@HeleneW-dot
Copy link
Contributor

Hi @punitdarira ,
Thank you for your submission. I have taken over the ticket from Petros and assigned myself to the PR for review. I will update here once I have done the code review or questions

@HeleneW-dot
Copy link
Contributor

Hi @punitdarira
I would like to test your changes locally. I am following the steps you described in the ticket:

  1. Add a basic main class in starter-rest and adjust the h2Database scope to compile
  2. Add application.yml properties in starter-rest described in the PR:
camunda.bpm.metrics.actuator.interval=1
management.endpoints.web.exposure.include=metrics
  1. Build from spring-boot-starter with mvn clean install -Dmaven.test.skip=true
  2. Run from starter-rest with mvn clean spring-boot:run

I also started some small example processes to create data.
When I then request from http://localhost:8080/actuator/metrics I get this response:

actuator/metrics response
{
    "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",
        "http.server.requests.active",
        "jvm.buffer.count",
        "jvm.buffer.memory.used",
        "jvm.buffer.total.capacity",
        "jvm.classes.loaded",
        "jvm.classes.unloaded",
        "jvm.compilation.time",
        "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.info",
        "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.started",
        "jvm.threads.states",
        "logback.events",
        "process.cpu.time",
        "process.cpu.usage",
        "process.files.max",
        "process.files.open",
        "process.start.time",
        "process.uptime",
        "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"
    ]
}

To me this looks like default actuator response. I was expecting to see some camunda specific metrics here as well, is that a correct expectation? Can you provide testing steps specifically to see the micrometer changes you've implemented?
Thank you,
Helene

@punitdarira
Copy link
Contributor Author

Hi @HeleneW-dot,
The default time interval for reporting metrics to the db is 15 minutes. Unless we reduce the db reporting time, you would be able to see the metrics in actuator in 15 minutes .

@HeleneW-dot
Copy link
Contributor

Hi @punitdarira , I assumed camunda.bpm.metrics.actuator.interval=1 would set this interval to 1 minute, is that not correct?

@punitdarira
Copy link
Contributor Author

Hi @HeleneW-dot,
Yes this property doesn't set the interval of db reporting, just the actuator interval.
Maybe we should update the db reporting interval as well with this property. What are your views on it?

@HeleneW-dot
Copy link
Contributor

Hi @punitdarira

The default time interval for reporting metrics to the db is 15 minutes. Unless we reduce the db reporting time, you would be able to see the metrics in actuator in 15 minutes .

I tried with the same steps, this time waiting 40 minutes just to be sure but got the same result. Are there any other changes I would need to make? Can you please provide a guide on how to use this feature that I can follow for local testing? Thank you.

Yes this property doesn't set the interval of db reporting, just the actuator interval. Maybe we should update the db reporting interval as well with this property. What are your views on it?

I would say lets not divert from the technical proposal discussed in the ticket for now because it looks like that has already been reviewed by the team. Once I can test and review the code and gained some more insight we can revisit

Thank you,
Helene

@punitdarira
Copy link
Contributor Author

Hi @HeleneW-dot,
The last commit on this branch has all the local changes which I use to run this feature
https://github.com/punitdarira/camunda-bpm-platform/tree/micrometer-local-testing
The steps I did-
ran mvn clean install -DskipTests on camunda-bpm-spring-boot-starter and camunda-bpm-spring-boot-starter-rest
then ran mvn spring-boot:run on camunda-bpm-spring-boot-starter-rest
I've added some debug sysouts "Inside init" and "inside run"
We should be getting these debug messages when we run the project.

@HeleneW-dot HeleneW-dot self-requested a review September 17, 2025 08:39
@HeleneW-dot
Copy link
Contributor

Hi @punitdarira ,
Thanks, this worked for me I can now see the camunda metrics on the endpoint. I see in your repo you added these dependencies:

<dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js</artifactId>
      <version>22.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.graalvm.js</groupId>
      <artifactId>js-scriptengine</artifactId>
      <version>22.0.0</version>
   </dependency>

Are these required to make the micrometer metrics work?

@punitdarira
Copy link
Contributor Author

Hi @HeleneW-dot
No they are not required for micrometer metrics to work. They were used to run JavaScript code in the .bpmn files.

@HeleneW-dot
Copy link
Contributor

PR to run CI: #5428

@HeleneW-dot
Copy link
Contributor

Hi @punitdarira ,
thanks, I am running CI on the changes now and will do a proper review. Would you also be able to submit a PR to document this feature, especially the configuration options?

Copy link
Contributor

@HeleneW-dot HeleneW-dot left a comment

Choose a reason for hiding this comment

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

Hi @punitdarira ,
thanks again for your contribution. I've reviewed the changes and the code looks good to me. Please add the missing license header. The branch should also be rebased on up to date master since its been a while.
I think it would make sense to add some documentation for this as well, see my previous comment.

I am running CI on these changes now and will update here once the tests have run.

Comment on lines +11 to +12


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

public void run() {
List<MetricIntervalValue> metricsList = processEngine.getManagementService()
.createMetricsQuery().interval(1);
if(metricsList.isEmpty()){
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(metricsList.isEmpty()){
if(metricsList.isEmpty()) {

if(metricsList.isEmpty()){
return;
}
metricsList.forEach(metric ->{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
metricsList.forEach(metric ->{
metricsList.forEach(metric -> {

@@ -0,0 +1,42 @@
package org.camunda.bpm.spring.boot.starter.actuator;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@@ -0,0 +1,41 @@
package org.camunda.bpm.spring.boot.starter.actuator;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@@ -0,0 +1,25 @@
package org.camunda.bpm.spring.boot.starter.property;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@@ -0,0 +1,27 @@
package org.camunda.bpm.spring.boot.starter.actuator.micrometer.metrics;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@@ -0,0 +1,28 @@
package org.camunda.bpm.spring.boot.starter.actuator.micrometer.metrics;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@@ -0,0 +1,37 @@
package org.camunda.bpm.spring.boot.starter.actuator.micrometer.metrics;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@@ -0,0 +1,63 @@
package org.camunda.bpm.spring.boot.starter.actuator.micrometer.metrics;
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing license header

@HeleneW-dot
Copy link
Contributor

Hi @punitdarira ,
After rebasing on master and adding the missing license headers, CI has passed on the changes. Please implement the suggestions I left above, then I can approve the PR 🚀
Also it would be great if you could open a documentation PR for review as well.

Thank you,
Helene

@tasso94
Copy link
Member

tasso94 commented Oct 29, 2025

Hi @punitdarira,

Camunda 7 CE is end-of-life.

Have you checked out our next-generation automation platform, C8, already?
https://github.com/camunda/camunda

Feel free to contribute to this repository in the future.

We will soon archive this repository.

Best,
Tassilo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants