-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ba9995
commit 81c3cf1
Showing
14 changed files
with
179 additions
and
101 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,13 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
### Java template | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
*.iml | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
Thumbs.db | ||
.DS_Store | ||
.gradle | ||
build/ | ||
target/ | ||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
pom.xml.next | ||
release.properties | ||
dependency-reduced-pom.xml | ||
buildNumber.properties | ||
.mvn/timing.properties | ||
|
||
.settings | ||
bin/ | ||
build-reports/ | ||
|
||
# Eclipse | ||
.classpath | ||
.project | ||
.settings/ | ||
|
||
# Intellij | ||
.idea/ | ||
out/ | ||
.idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# Mac | ||
.DS_Store | ||
|
||
# Maven | ||
log/ | ||
|
||
#docker/**/*.jar | ||
.project | ||
.settings | ||
.classpath |
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
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 @@ | ||
*.jar |
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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:lang="http://www.springframework.org/schema/lang" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://www.springframework.org/schema/lang https://www.springframework.org/schema/lang/spring-lang.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"> | ||
|
||
<!-- https://docs.spring.io/spring-framework/docs/current/reference/html/languages.html#groovy--> | ||
|
||
<lang:defaults proxy-target-class="true"/> | ||
|
||
|
||
<!-- <lang:groovy id="camundaMonitoringMetrics" script-source="/metrics/CamundaMonitoringMetrics.groovy"/>--> | ||
|
||
<lang:groovy id="camundaMonitoringMetrics" script-source="file:/metrics/CamundaMonitoringMetrics.groovy"/> | ||
|
||
|
||
<!-- <lang:groovy id="processInstanceMetrics" script-source="/metrics/ProcessInstanceMetrics.groovy"/>--> | ||
<!-- <lang:groovy id="incidentMetrics" script-source="/metrics/IncidentMetrics.groovy"/>--> | ||
|
||
</beans> |
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,28 @@ | ||
-#spring: | ||
# datasource: | ||
# url: jdbc:h2:./build/DB/dbdevDb1;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=TRUE # jdbc:h2:~/devDb1;MODE=PostgreSQL;AUTO_SERVER=TRUE | ||
# username: sa | ||
# password: '' | ||
|
||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: prometheus | ||
metrics: | ||
enable: | ||
jvm: false | ||
hikaricp: false | ||
process: false | ||
logback: false | ||
tomcat: false | ||
system: false | ||
jdbc: false | ||
http: false | ||
|
||
camunda: | ||
bpm: | ||
# metrics: | ||
# monitoringBeansXml: file:/camunda/configuration/camunda-monitoring-beans.xml | ||
job-execution: | ||
enabled: false |
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,10 @@ | ||
services: | ||
camunda-monitoring: | ||
image: camunda/camunda-bpm-platform:run-latest | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./Camunda-Monitoring.jar:/camunda/configuration/userlib/Camunda-Monitoring.jar | ||
- ./metrics:/metrics | ||
- ./camunda-monitoring-beans.xml:/camunda/configuration/camunda-monitoring-beans.xml | ||
- ./default.yml:/camunda/configuration/default.yml |
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,39 @@ | ||
import io.micrometer.core.instrument.MeterRegistry | ||
import io.micrometer.core.instrument.Tag | ||
import org.camunda.bpm.engine.ProcessEngine | ||
import org.springframework.beans.factory.annotation.Autowired | ||
import org.springframework.scheduling.annotation.Scheduled | ||
|
||
import javax.annotation.PostConstruct | ||
import java.util.concurrent.atomic.AtomicLong | ||
|
||
/** | ||
* The generic Camunda Monitoring metrics groovy file. | ||
* | ||
* This can be used as a quick start catch all file to add any metrics you want to monitor. | ||
* | ||
* Advanced use cases may wish to separate metrics into multiple groovy files. | ||
*/ | ||
class CamundaMonitoringMetrics { | ||
|
||
@Autowired MeterRegistry registry | ||
@Autowired ProcessEngine processEngine | ||
|
||
String namespace = "camunda" | ||
String activeIncidentsMetricName = "${namespace}_active_incidents" | ||
|
||
List<Tag> commonTags | ||
|
||
AtomicLong activeIncidents | ||
|
||
@PostConstruct | ||
void setup(){ | ||
commonTags = [Tag.of("engineName", processEngine.getName())] | ||
activeIncidents = registry.gauge(activeIncidentsMetricName, commonTags, new AtomicLong(0)) | ||
} | ||
|
||
@Scheduled(fixedRate = 60000L) | ||
void getActiveIncidents(){ | ||
activeIncidents.set(processEngine.getRuntimeService().createIncidentQuery().count()) | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...rometheus/CamundaMonitoringBeansConfig.kt → ...onitoring/CamundaMonitoringBeansConfig.kt
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
2 changes: 1 addition & 1 deletion
2
...s/CamundaMonitoringProcessEnginePlugin.kt → ...g/CamundaMonitoringProcessEnginePlugin.kt
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
rootProject.name = "CamundaPrometheusMetricsPlugin" | ||
include("prometheusmetricsplugin", "springboot") | ||
rootProject.name = "CamundaMonitoring" | ||
include("monitoringplugin", "springboot") |
Oops, something went wrong.