Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Updated to use shared library from the domain project.
Browse files Browse the repository at this point in the history
  • Loading branch information
user1 committed Nov 7, 2020
1 parent e9dc86a commit cadf0b4
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 15 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,45 @@ The `dep-test` folder in this repo contains a sample test project configured to
#### Metrics
Elastic Java APM agent also captures JVM metrics, so all the Mule JVM metrics collected by the agent are there as well:
![metrics](images/metrics.png)

## Support for Mule domains
The mule4-agent APM dependency should be added to the domain `pom.xml` file and also be declared as `sharedLibrary` there for it to be visible to the domain projects deployed with the domain configuration.
pom.xml:
```xml
<build>
<plugins>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<sharedLibraries>

<!-- Added exported dependency at the domain level for the code to be visible for domain projects -->
<sharedLibrary>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
</sharedLibrary>

</sharedLibraries>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
...
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
<version>0.3.0</version>
</dependency>
...
</dependencies>
```

Then, every project that needs to be traced, should include the following in the flow definition once per project:
```xml
<import doc:name="Import" doc:id="b9240848-52ad-4dcc-8ed4-6f9e864bd1e4" file="tracer.xml" />
```
10 changes: 0 additions & 10 deletions examples/domain/proj1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@
</build>

<dependencies>
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions examples/domain/proj2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
<classifier>mule-domain</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
<version>0.2.0</version>
</dependency>
</dependencies>

<repositories>
Expand Down
16 changes: 16 additions & 0 deletions examples/domain/test-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<sharedLibraries>

<!-- Added exported dependency at the domain level for the code to be visible for domain projects -->
<sharedLibrary>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
</sharedLibrary>

</sharedLibraries>
</configuration>
</plugin>
</plugins>
</build>
Expand All @@ -43,6 +54,11 @@
<version>1.2.0</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>mule4-agent</artifactId>
<version>0.3.0</version>
</dependency>
</dependencies>

<repositories>
Expand Down

0 comments on commit cadf0b4

Please sign in to comment.