-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
9294: Add actor metrics r=Zelldon a=Zelldon ## Description As discussed here https://camunda.slack.com/archives/C037RS2JHB8/p1651668160788749 add new actor metrics but no new panels for now. Details: - Add counter for actorTask execution - Add histogram to observe actorTask execution Currently starting a benchmark to verify whether metrics are exported as expected. I will create a separate PR for the atomix executors. `@npepinpe` I'm not sure whether it fulfills all requirements for #9282 I will remove my assignment then. <!-- Please explain the changes you made here. --> ## Related issues <!-- Which issues are closed by this PR or are related --> related #9282 Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
util/src/main/java/io/camunda/zeebe/util/sched/ActorMetrics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.util.sched; | ||
|
||
import io.prometheus.client.Counter; | ||
import io.prometheus.client.Histogram; | ||
|
||
final class ActorMetrics { | ||
|
||
private static final Histogram EXECUTION_LATENCY = | ||
Histogram.build() | ||
.namespace("zeebe") | ||
.name("actor_task_execution_latency") | ||
.help("Execution time of a certain actor task") | ||
.labelNames("actorName") | ||
.register(); | ||
|
||
private static final Counter EXECUTION_COUNT = | ||
Counter.build() | ||
.namespace("zeebe") | ||
.name("actor_task_execution_count") | ||
.help("Number of times a certain actor task was executed successfully") | ||
.labelNames("actorName") | ||
.register(); | ||
|
||
Histogram.Timer startExecutionTimer(final String name) { | ||
return EXECUTION_LATENCY.labels(name).startTimer(); | ||
} | ||
|
||
void countExecution(final String name) { | ||
EXECUTION_COUNT.labels(name).inc(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters