This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from michaelhyatt/distributed-http-tracing-3.0
Distributed http tracing 3.0
- Loading branch information
Showing
14 changed files
with
347 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# ------------------------------------------------------------------------------ # | ||
# Java defaults (https://github.com/github/gitignore/blob/master/Java.gitignore) # | ||
# ------------------------------------------------------------------------------ # | ||
*.class | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# ------------------------------------------------------------------------------------------- # | ||
# Eclipse-specific (https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore) # | ||
# ------------------------------------------------------------------------------------------- # | ||
*.pydevproject | ||
.metadata | ||
bin/** | ||
tmp/** | ||
tmp/**/* | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.settings/ | ||
.loadpath | ||
.project | ||
.classpath | ||
|
||
# External tool builders | ||
.externalToolBuilders/ | ||
|
||
# Locally stored "Eclipse launch configurations" | ||
*.launch | ||
|
||
# CDT-specific | ||
.cproject | ||
|
||
# PDT-specific | ||
.buildpath | ||
|
||
# --------------- # | ||
# Studio-specific # | ||
# --------------- # | ||
target/ | ||
.mule/** | ||
.mule/**/* | ||
.DS_Store | ||
velocity.log |
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,13 @@ | ||
# Tracing test | ||
|
||
## Intro | ||
This Mule project runs as a Mule engine instrumented with the Mule APM agent and it serves a HTML page with Elastic RUM agent that both participate in a distributed trace. The RUM agent in the browser starts a transaction and sends a `traceparent` header containing the `trace.id` back to the Mule runtime that records its own transaction using the sent `trace.id` which results in a complete trace populated in Kibana APM UI: | ||
![kibana-apm](images/kibana.png) | ||
|
||
## How to run | ||
Start the Mule project with the following additional parameters to initialise the APM agent: | ||
``` | ||
-M-Delastic.apm.server_urls=https://XXXXX.elastic-cloud.com -M-Delastic.apm.secret_token=YYYYYY -M-Delastic.apm.service_name=component1 -M-Delastic.apm.service_version=v1.0.0 -M-Delastic.apm.log_level=INFO | ||
``` | ||
|
||
Open the browser at http://localhost:8081 and press the `Press me` button a couple of times. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 @@ | ||
{ | ||
"minMuleVersion": "4.3.0" | ||
} |
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,92 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.mycompany</groupId> | ||
<artifactId>tracing-test</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>mule-application</packaging> | ||
|
||
<name>tracing-test</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
|
||
<app.runtime>4.3.0-20201013</app.runtime> | ||
<mule.maven.plugin.version>3.3.5</mule.maven.plugin.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>3.0.0</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.mule.tools.maven</groupId> | ||
<artifactId>mule-maven-plugin</artifactId> | ||
<version>${mule.maven.plugin.version}</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.mule.connectors</groupId> | ||
<artifactId>mule-http-connector</artifactId> | ||
<version>1.5.22</version> | ||
<classifier>mule-plugin</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.connectors</groupId> | ||
<artifactId>mule-sockets-connector</artifactId> | ||
<version>1.2.0</version> | ||
<classifier>mule-plugin</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mule.modules</groupId> | ||
<artifactId>mule-scripting-module</artifactId> | ||
<version>1.1.7</version> | ||
<classifier>mule-plugin</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>co.elastic.apm</groupId> | ||
<artifactId>mule4-agent</artifactId> | ||
<version>0.4.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<repositories> | ||
<repository> | ||
<id>anypoint-exchange-v2</id> | ||
<name>Anypoint Exchange</name> | ||
<url>https://maven.anypoint.mulesoft.com/api/v2/maven</url> | ||
<layout>default</layout> | ||
</repository> | ||
<repository> | ||
<id>mulesoft-releases</id> | ||
<name>MuleSoft Releases Repository</name> | ||
<url>https://repository.mulesoft.org/releases/</url> | ||
<layout>default</layout> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>mulesoft-releases</id> | ||
<name>mulesoft release repository</name> | ||
<layout>default</layout> | ||
<url>https://repository.mulesoft.org/releases/</url> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
</project> |
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
examples/tracing-test/src/main/resources/elastic-apm-rum.umd.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
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,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Configuration> | ||
|
||
<!--These are some of the loggers you can enable. | ||
There are several more you can find in the documentation. | ||
Besides this log4j configuration, you can also use Java VM environment variables | ||
to enable other logs like network (-Djavax.net.debug=ssl or all) and | ||
Garbage Collector (-XX:+PrintGC). These will be append to the console, so you will | ||
see them in the mule_ee.log file. --> | ||
|
||
<Appenders> | ||
<RollingFile name="file" fileName="${sys:mule.home}${sys:file.separator}logs${sys:file.separator}tracing-test.log" | ||
filePattern="${sys:mule.home}${sys:file.separator}logs${sys:file.separator}tracing-test-%i.log"> | ||
<PatternLayout pattern="%-5p %d [%t] [processor: %X{processorPath}; event: %X{correlationId}] %c: %m%n" /> | ||
<SizeBasedTriggeringPolicy size="10 MB" /> | ||
<DefaultRolloverStrategy max="10"/> | ||
</RollingFile> | ||
</Appenders> | ||
<Loggers> | ||
|
||
<!-- Http Logger shows wire traffic on DEBUG. --> | ||
<!--AsyncLogger name="org.mule.service.http.impl.service.HttpMessageLogger" level="DEBUG" /--> | ||
<AsyncLogger name="org.mule.service.http" level="WARN"/> | ||
<AsyncLogger name="org.mule.extension.http" level="WARN"/> | ||
|
||
<!-- Mule logger --> | ||
<AsyncLogger name="org.mule.runtime.core.internal.processor.LoggerMessageProcessor" level="INFO"/> | ||
|
||
<AsyncRoot level="INFO"> | ||
<AppenderRef ref="file" /> | ||
</AsyncRoot> | ||
</Loggers> | ||
</Configuration> |
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,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Configuration> | ||
<Appenders> | ||
<Console name="Console" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="%-5p %d [%t] %c: %m%n"/> | ||
</Console> | ||
</Appenders> | ||
|
||
<Loggers> | ||
|
||
<!-- Http Logger shows wire traffic on DEBUG. --> | ||
<!--AsyncLogger name="org.mule.service.http.impl.service.HttpMessageLogger" level="DEBUG" /--> | ||
<AsyncLogger name="org.mule.service.http" level="WARN"/> | ||
<AsyncLogger name="org.mule.extension.http" level="WARN"/> | ||
|
||
<!-- Reduce startup noise --> | ||
<AsyncLogger name="com.mulesoft.mule.runtime.plugin" level="WARN"/> | ||
<AsyncLogger name="org.mule.maven.client" level="WARN"/> | ||
<AsyncLogger name="org.mule.runtime.core.internal.util" level="WARN"/> | ||
<AsyncLogger name="org.quartz" level="WARN"/> | ||
<AsyncLogger name="org.mule.munit.plugins.coverage.server" level="WARN"/> | ||
|
||
<!-- Mule logger --> | ||
<AsyncLogger name="org.mule.runtime.core.internal.processor.LoggerMessageProcessor" level="INFO"/> | ||
|
||
<AsyncRoot level="INFO"> | ||
<AppenderRef ref="Console"/> | ||
</AsyncRoot> | ||
</Loggers> | ||
|
||
</Configuration> |
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
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