Skip to content

Give precedence to w3c traceparent header#1821

Merged
eyalkoren merged 4 commits intoelastic:masterfrom
felixbarny:w3c-header-precedence
May 26, 2021
Merged

Give precedence to w3c traceparent header#1821
eyalkoren merged 4 commits intoelastic:masterfrom
felixbarny:w3c-header-precedence

Conversation

@felixbarny
Copy link
Member

@felixbarny felixbarny commented May 19, 2021

What does this PR do?

Implements elastic/apm#442

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
@ghost
Copy link

ghost commented May 19, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1821 updated

  • Start Time: 2021-05-25T15:54:33.779+0000

  • Duration: 50 min 25 sec

  • Commit: 97df5b2

Test stats 🧪

Test Results
Failed 0
Passed 2131
Skipped 19
Total 2150

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 2131
Skipped 19
Total 2150

Copy link
Member

@SylvainJuge SylvainJuge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, do we have a few examples when this would be problematic to be a bit more clear why this change was required ? (probably @AlexanderWert might have an idea on this one also).

@SylvainJuge SylvainJuge self-requested a review May 20, 2021 12:50
@AlexanderWert
Copy link
Member

Whenever there is something in the middle (let's say a reverse proxy) of two services being monitored by our agent. And the proxy uses the W3C headers to create own spans (--> thus sends modified traceparent header to the downstream service), but passes our proprietary header as is. In this case the downstream service has a conflict, especially if it prefers the proprietary header over the W3C header, resulting in wrong parent child relationship.

@eyalkoren eyalkoren merged commit ea2b539 into elastic:master May 26, 2021
@ghost
Copy link

ghost commented May 26, 2021

❕ Build Aborted

There is a new build on-going so the previous on-going builds have been aborted.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: Pull request #1821 updated

  • Reason: Aborted from #6

  • Start Time: 2021-05-26T07:30:41.253+0000

  • Duration: 10 min 15 sec

  • Commit: 28fd061

Trends 🧪

Image of Build Times

Log output

Expand to view the last 100 lines of log output

[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-java) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- jacoco-maven-plugin:0.8.5:prepare-agent (default) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] argLine set to -javaagent:/var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/.m2/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=/var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/target/jacoco.exec
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- license-maven-plugin:1.19:update-file-header (first) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [WARNING] The failOnMissingHeader has no effect if the property dryRun is not set.
[2021-05-26T07:40:42.209Z] [WARNING] The failOnNotUptodateHeader has no effect if the property dryRun is not set.
[2021-05-26T07:40:42.209Z] [INFO] adding extra resolver file:////var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/../../../licenses
[2021-05-26T07:40:42.209Z] [INFO] Will search files to update from root /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/src/test/java
[2021-05-26T07:40:42.209Z] [INFO] Scan 1 file header done in 1.57ms.
[2021-05-26T07:40:42.209Z] [INFO] All files are up-to-date.
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[2021-05-26T07:40:42.209Z] [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/src/main/resources
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] No sources to compile
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[2021-05-26T07:40:42.209Z] [INFO] Copying 2 resources
[2021-05-26T07:40:42.209Z] [INFO] 
[2021-05-26T07:40:42.209Z] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ spring-boot-2-base ---
[2021-05-26T07:40:42.209Z] [INFO] Changes detected - recompiling the module!
[2021-05-26T07:40:42.209Z] [INFO] Compiling 1 source file to /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/target/test-classes
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [INFO] Tests are skipped.
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- jacoco-maven-plugin:0.8.5:report (report) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [INFO] Skipping JaCoCo execution due to missing execution data file.
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [WARNING] JAR will be empty - no content was marked for inclusion!
[2021-05-26T07:40:42.470Z] [INFO] Building jar: /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/target/spring-boot-2-base-1.23.1-SNAPSHOT.jar
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- maven-javadoc-plugin:3.2.0:jar (default) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [INFO] Skipping javadoc generation
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- maven-jar-plugin:3.2.0:test-jar (default) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [INFO] Building jar: /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/target/spring-boot-2-base-1.23.1-SNAPSHOT-tests.jar
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- maven-failsafe-plugin:2.22.2:integration-test (default) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [INFO] Tests are skipped.
[2021-05-26T07:40:42.470Z] [INFO] 
[2021-05-26T07:40:42.470Z] [INFO] --- animal-sniffer-maven-plugin:1.17:check (signature-check) @ spring-boot-2-base ---
[2021-05-26T07:40:42.470Z] [INFO] Checking unresolved references to org.codehaus.mojo.signature:java17:1.0
[2021-05-26T07:40:43.413Z] [INFO] 
[2021-05-26T07:40:43.413Z] [INFO] --- maven-failsafe-plugin:2.22.2:verify (default) @ spring-boot-2-base ---
[2021-05-26T07:40:43.413Z] [INFO] Tests are skipped.
[2021-05-26T07:40:43.413Z] [INFO] 
[2021-05-26T07:40:43.413Z] [INFO] --- license-maven-plugin:1.19:check-file-header (license-header-check) @ spring-boot-2-base ---
[2021-05-26T07:40:43.413Z] [INFO] adding extra resolver file:////var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/../../../licenses
[2021-05-26T07:40:43.413Z] [INFO] Will search files to update from root /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/src/test/java
[2021-05-26T07:40:43.413Z] [INFO] Scan 1 file header done in 1.261ms.
[2021-05-26T07:40:43.413Z] [INFO] All files are up-to-date.
[2021-05-26T07:40:43.413Z] [INFO] 
[2021-05-26T07:40:43.413Z] [INFO] --- maven-install-plugin:3.0.0-M1:install (default-install) @ spring-boot-2-base ---
[2021-05-26T07:40:43.413Z] [INFO] Installing /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/target/spring-boot-2-base-1.23.1-SNAPSHOT.jar to /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/.m2/co/elastic/apm/spring-boot-2-base/1.23.1-SNAPSHOT/spring-boot-2-base-1.23.1-SNAPSHOT.jar
[2021-05-26T07:40:43.413Z] [INFO] Installing /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/pom.xml to /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/.m2/co/elastic/apm/spring-boot-2-base/1.23.1-SNAPSHOT/spring-boot-2-base-1.23.1-SNAPSHOT.pom
[2021-05-26T07:40:43.413Z] [INFO] Installing /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/integration-tests/spring-boot-2/spring-boot-2-base/target/spring-boot-2-base-1.23.1-SNAPSHOT-tests.jar to /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821/src/github.com/elastic/apm-agent-java/.m2/co/elastic/apm/spring-boot-2-base/1.23.1-SNAPSHOT/spring-boot-2-base-1.23.1-SNAPSHOT-tests.jar
[2021-05-26T07:40:43.413Z] [INFO] 
[2021-05-26T07:40:43.413Z] [INFO] -----------------< co.elastic.apm:spring-boot-2-jetty >-----------------
[2021-05-26T07:40:43.413Z] [INFO] Building co.elastic.apm:spring-boot-2-jetty 1.23.1-SNAPSHOT    [112/114]
[2021-05-26T07:40:43.413Z] [INFO] --------------------------------[ jar ]---------------------------------
[2021-05-26T07:40:43.613Z] Sending interrupt signal to process
[2021-05-26T07:40:43.995Z] script returned exit code 143
[2021-05-26T07:40:44.075Z] Sleeping for 10 sec
[2021-05-26T07:40:55.351Z] Stage "Tests" skipped due to earlier failure(s)
[2021-05-26T07:40:55.409Z] Stage "Unit Tests" skipped due to earlier failure(s)
[2021-05-26T07:40:55.410Z] Stage "Smoke Tests 01" skipped due to earlier failure(s)
[2021-05-26T07:40:55.411Z] Stage "Smoke Tests 02" skipped due to earlier failure(s)
[2021-05-26T07:40:55.412Z] Stage "Benchmarks" skipped due to earlier failure(s)
[2021-05-26T07:40:55.413Z] Stage "Javadoc" skipped due to earlier failure(s)
[2021-05-26T07:40:55.470Z] Failed in branch Unit Tests
[2021-05-26T07:40:55.471Z] Failed in branch Smoke Tests 01
[2021-05-26T07:40:55.472Z] Failed in branch Smoke Tests 02
[2021-05-26T07:40:55.472Z] Failed in branch Benchmarks
[2021-05-26T07:40:55.473Z] Failed in branch Javadoc
[2021-05-26T07:40:55.524Z] Stage "Integration Tests" skipped due to earlier failure(s)
[2021-05-26T07:40:55.556Z] Stage "Stable" skipped due to earlier failure(s)
[2021-05-26T07:40:55.589Z] Stage "AfterRelease" skipped due to earlier failure(s)
[2021-05-26T07:40:55.604Z] Stage "AfterRelease" skipped due to earlier failure(s)
[2021-05-26T07:40:55.876Z] Running on worker-854309 in /var/lib/jenkins/workspace/_java_apm-agent-java-mbp_PR-1821
[2021-05-26T07:40:55.975Z] [INFO] getVaultSecret: Getting secrets
[2021-05-26T07:40:56.020Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-05-26T07:40:58.369Z] + chmod 755 generate-build-data.sh
[2021-05-26T07:40:58.370Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-java/apm-agent-java-mbp/PR-1821/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-java/apm-agent-java-mbp/PR-1821/runs/5 ABORTED 615382
[2021-05-26T07:40:58.370Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-java/apm-agent-java-mbp/PR-1821/runs/5/steps/?limit=10000 -o steps-info.json
[2021-05-26T07:40:58.610Z] Click here to forcibly terminate running steps
[2021-05-26T07:40:59.106Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-java/apm-agent-java-mbp/PR-1821/runs/5/tests/?status=FAILED -o tests-errors.json
[2021-05-26T07:40:59.106Z] Retry 1/3 exited 22, retrying in 1 seconds...
[2021-05-26T07:41:01.479Z] Retry 2/3 exited 22, retrying in 2 seconds...
[2021-05-26T07:41:03.851Z] Retry 3/3 exited 22, no more retries left.
[2021-05-26T07:41:03.851Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-agent-java/apm-agent-java-mbp/PR-1821/runs/5/log/ -o pipeline-log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants