-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into feature/windows-b…
…uild
- Loading branch information
Showing
36 changed files
with
546 additions
and
132 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
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
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,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
source /usr/local/bin/bash_standard_lib.sh | ||
|
||
grep "-" .ci/.jenkins_nodejs.yml | cut -d'-' -f2- | \ | ||
while read -r version; | ||
do | ||
transformedVersion=$(echo "${version}" | sed 's#"##g' | cut -d":" -f2) | ||
imageName="apm-agent-nodejs" | ||
registryImageName="docker.elastic.co/observability-ci/${imageName}:${transformedVersion}" | ||
(retry 2 docker pull "${registryImageName}") | ||
docker tag "${registryImageName}" "node:${transformedVersion}" | ||
done | ||
|
||
docker-compose \ | ||
--no-ansi \ | ||
--log-level ERROR \ | ||
-f .ci/docker/docker-compose-all.yml \ | ||
pull --quiet --ignore-pull-failures |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
[[distributed-tracing]] | ||
== Distributed tracing | ||
|
||
// Content from APM Overview documentation | ||
// https://www.elastic.co/guide/en/apm/get-started/current/distributed-tracing.html | ||
Distributed tracing enables you to analyze performance throughout your microservices architecture all in one view. | ||
This is accomplished by tracing all of the requests -- | ||
from the initial web request to your front-end service -- to queries made to your back-end services. | ||
This makes finding possible bottlenecks throughout your application much easier and faster. | ||
|
||
Elastic APM automatically supports distributed tracing, | ||
but there are some cases, outlined below, where additional setup is necessary. | ||
|
||
[float] | ||
[[tracing-rum-correlation]] | ||
=== Real User Monitoring (RUM) correlation | ||
|
||
// Content from RUM documentation | ||
// https://www.elastic.co/guide/en/apm/agent/rum-js/master/distributed-tracing-guide.html | ||
If your backend service generates an HTML page dynamically, | ||
the trace ID and parent span ID must be injected into the page when the RUM Agent is initialized. | ||
This ensures that the web browser’s page load appears as the root of the trace, | ||
and allows you to analyze the time spent in the browser vs in backend services. | ||
|
||
// Content from transaction-api.asciidoc | ||
include::./transaction-api.asciidoc[tag=ensure-parent-id-snippet] | ||
|
||
For more information, see <<transaction-ensure-parent-id>>. | ||
|
||
[float] | ||
[[tracing-custom-protocol]] | ||
=== Custom protocols | ||
|
||
Distributed tracing is automatically supported with HTTP/HTTPS. | ||
If you're using another protocol, like TCP, UDP, WebSocket, or Protocol Buffers, | ||
there are a few manual setup steps you must follow. | ||
|
||
In a distributed trace, multiple transactions are linked together with a `traceparent`. | ||
To create your own distributed trace, you must pass the current `traceparent` from an outgoing service, | ||
to a receiving service, and create a new transaction as a child of that `traceparent`: | ||
|
||
1. In one service, start a transaction with <<apm-start-transaction,`apm.startTransaction()`>>, | ||
or a span with <<apm-start-span,`apm.startSpan()`>>. | ||
|
||
2. Get the serialized `traceparent` string of the started transaction/span with <<apm-current-traceparent>>. | ||
|
||
3. Encode the `traceparent` and send it to the receiving service inside your regular request. | ||
|
||
4. Decode and store the `traceparent` in the receiving service. | ||
|
||
5. Manually start a new transaction as a child of the received `traceparent`, | ||
with <<apm-start-transaction,`apm.startTransaction()`>>. | ||
Pass in the `traceparent` as the `childOf` option. | ||
|
||
[float] | ||
[[tracing-custom-example]] | ||
==== Example | ||
|
||
Consider a scenario where you're using raw UDP to communicate between two services, A and B: | ||
|
||
**Service A** | ||
|
||
Service A starts a transaction, and gets the current `traceparent`. | ||
|
||
[source,js] | ||
---- | ||
agent.startTransaction('my-service-a-transaction') | ||
const traceparent = agent.currentTraceparent | ||
---- | ||
|
||
Service A then sends the `traceparent` as a "header" to service B. | ||
|
||
[source,js] | ||
---- | ||
// Pseudocode for sending data | ||
sendMetadata(`traceparent: ${traceparent}\n`) | ||
---- | ||
|
||
**Service B** | ||
|
||
Service B reads the `traceparent` from the incoming request. | ||
|
||
[source,js] | ||
---- | ||
// Pseudocode for reading incoming request | ||
const traceparent = readTraceparentFromUDPPacket() | ||
---- | ||
|
||
Service B uses the `traceparent` to initialize a new transaction that is a child of the original `traceparent`. | ||
|
||
[source,js] | ||
---- | ||
agent.startTransaction('my-service-b-transaction', { childOf: traceparent }) | ||
---- |
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
Oops, something went wrong.