Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event.outcome to transactions and spans #4064

Merged
merged 6 commits into from
Aug 26, 2020
Merged

Conversation

axw
Copy link
Member

@axw axw commented Aug 11, 2020

Motivation/summary

This PR adds outcome as a field of transaction and span. For RUM v3, outcome is abbreviated to o.

The value will be recorded as the event.outcome in the event documents, and will be used for calculating error rates.

Checklist

I have considered changes for:

How to test these changes

Cannot be manually tested until we have a modified agent.

Related issues

elastic/apm#299

@apmmachine
Copy link
Contributor

apmmachine commented Aug 11, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #4064 updated]

  • Start Time: 2020-08-24T01:39:41.437+0000

  • Duration: 3 min 18 sec

Steps errors

Expand to view the steps failures

  • Name: Check out from version control

    • Description: [2020-08-24T01:41:54.183Z] using credential f6c7695a-671e-4f4f-a331-acdce44ff9ba
      [2020-08-24T01:41:

    • Duration: 0 min 8 sec

    • Start Time: 2020-08-24T01:41:51.447+0000

    • log

  • Name: Check out from version control

    • Description: [2020-08-24T01:42:19.377Z] using credential f6c7695a-671e-4f4f-a331-acdce44ff9ba
      [2020-08-24T01:42:

    • Duration: 0 min 4 sec

    • Start Time: 2020-08-24T01:42:19.359+0000

    • log

  • Name: Check out from version control

    • Description: [2020-08-24T01:42:53.793Z] using credential f6c7695a-671e-4f4f-a331-acdce44ff9ba
      [2020-08-24T01:42:

    • Duration: 0 min 4 sec

    • Start Time: 2020-08-24T01:42:53.771+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-08-24T01:42:19.433Z] Cloning repository git@github.com:elastic/apm-server.git
[2020-08-24T01:42:19.433Z]  > git init /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-4064 # timeout=10
[2020-08-24T01:42:19.440Z] Fetching upstream changes from git@github.com:elastic/apm-server.git
[2020-08-24T01:42:19.440Z]  > git --version # timeout=10
[2020-08-24T01:42:19.445Z]  > git --version # 'git version 2.17.1'
[2020-08-24T01:42:19.446Z] using GIT_SSH to set credentials GitHub user @elasticmachine SSH key
[2020-08-24T01:42:19.450Z]  > git fetch --no-tags --progress -- git@github.com:elastic/apm-server.git +refs/heads/*:refs/remotes/origin/* # timeout=15
[2020-08-24T01:42:22.930Z] Cleaning workspace
[2020-08-24T01:42:22.959Z] Using shallow fetch with depth 3
[2020-08-24T01:42:22.959Z] Pruning obsolete local branches
[2020-08-24T01:42:22.899Z]  > git config remote.origin.url git@github.com:elastic/apm-server.git # timeout=10
[2020-08-24T01:42:22.908Z]  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
[2020-08-24T01:42:22.924Z]  > git config remote.origin.url git@github.com:elastic/apm-server.git # timeout=10
[2020-08-24T01:42:22.935Z]  > git rev-parse --verify HEAD # timeout=10
[2020-08-24T01:42:22.948Z] No valid HEAD. Skipping the resetting
[2020-08-24T01:42:22.948Z]  > git clean -fdx # timeout=10
[2020-08-24T01:42:22.965Z] Fetching upstream changes from git@github.com:elastic/apm-server.git
[2020-08-24T01:42:22.966Z] using GIT_SSH to set credentials GitHub user @elasticmachine SSH key
[2020-08-24T01:42:22.970Z]  > git fetch --no-tags --progress --prune -- git@github.com:elastic/apm-server.git +refs/pull/4064/head:refs/remotes/origin/PR-4064 +refs/heads/master:refs/remotes/origin/master # timeout=15
[2020-08-24T01:42:23.703Z] Merging remotes/origin/master commit 40fb5c08d02c5e80b1e926e3d5a4542ae62c15b7 into PR head commit 3219c30ca05f38a04c07b25097ee3edf311eb938
[2020-08-24T01:42:23.719Z] ERROR: Execution failed
[2020-08-24T01:42:23.719Z] hudson.plugins.git.GitException: Command "git checkout -f 3219c30ca05f38a04c07b25097ee3edf311eb938" returned status code 128:
[2020-08-24T01:42:23.719Z] stdout: 
[2020-08-24T01:42:23.719Z] stderr: fatal: reference is not a tree: 3219c30ca05f38a04c07b25097ee3edf311eb938
[2020-08-24T01:42:23.719Z] 
[2020-08-24T01:42:23.719Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
[2020-08-24T01:42:23.719Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:84)
[2020-08-24T01:42:23.719Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2767)
[2020-08-24T01:42:23.719Z] Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from apm-ci-immutable-ubuntu-1804-1598233198285973207.c.elastic-ci-prod.internal/10.224.1.32:58104
[2020-08-24T01:42:23.719Z] 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
[2020-08-24T01:42:23.719Z] 		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
[2020-08-24T01:42:23.719Z] 		at hudson.remoting.Channel.call(Channel.java:1001)
[2020-08-24T01:42:23.719Z] 		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
[2020-08-24T01:42:23.719Z] 		at sun.reflect.GeneratedMethodAccessor782.invoke(Unknown Source)
[2020-08-24T01:42:23.719Z] 		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2020-08-24T01:42:23.719Z] 		at java.lang.reflect.Method.invoke(Method.java:498)
[2020-08-24T01:42:23.719Z] 		at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
[2020-08-24T01:42:23.719Z] 		at com.sun.proxy.$Proxy108.execute(Unknown Source)
[2020-08-24T01:42:23.719Z] 		at jenkins.plugins.git.MergeWithGitSCMExtension.checkout(MergeWithGitSCMExtension.java:145)
[2020-08-24T01:42:23.719Z] 		at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:111)
[2020-08-24T01:42:23.719Z] 		at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1073)
[2020-08-24T01:42:23.719Z] 		at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1178)
[2020-08-24T01:42:23.719Z] 		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
[2020-08-24T01:42:23.719Z] 		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
[2020-08-24T01:42:23.719Z] 		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
[2020-08-24T01:42:23.719Z] 		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[2020-08-24T01:42:23.719Z] 		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2020-08-24T01:42:23.719Z] 		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-08-24T01:42:23.719Z] 		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-08-24T01:42:23.719Z] 		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-08-24T01:42:23.719Z] Caused: hudson.plugins.git.GitException: Could not checkout 3219c30ca05f38a04c07b25097ee3edf311eb938
[2020-08-24T01:42:23.719Z] 	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2791)
[2020-08-24T01:42:23.719Z] 	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:161)
[2020-08-24T01:42:23.719Z] 	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:154)
[2020-08-24T01:42:23.719Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
[2020-08-24T01:42:23.719Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
[2020-08-24T01:42:23.719Z] 	at hudson.remoting.Request$2.run(Request.java:369)
[2020-08-24T01:42:23.719Z] 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
[2020-08-24T01:42:23.719Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-08-24T01:42:23.719Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-08-24T01:42:23.719Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-08-24T01:42:23.719Z] 	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
[2020-08-24T01:42:23.719Z] 	at java.lang.Thread.run(Thread.java:748)
[2020-08-24T01:42:23.719Z] Retrying
[2020-08-24T01:42:23.756Z] Sleeping for 30 sec
[2020-08-24T01:42:23.708Z]  > git config core.sparsecheckout # timeout=10
[2020-08-24T01:42:23.711Z]  > git checkout -f 3219c30ca05f38a04c07b25097ee3edf311eb938 # timeout=15
[2020-08-24T01:42:53.793Z] using credential f6c7695a-671e-4f4f-a331-acdce44ff9ba
[2020-08-24T01:42:53.814Z] Wiping out workspace first.
[2020-08-24T01:42:53.838Z] Cloning the remote Git repository
[2020-08-24T01:42:53.838Z] Using shallow clone with depth 3
[2020-08-24T01:42:53.838Z] Avoid fetching tags
[2020-08-24T01:42:53.844Z] Cloning repository git@github.com:elastic/apm-server.git
[2020-08-24T01:42:53.844Z]  > git init /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-4064 # timeout=10
[2020-08-24T01:42:53.851Z] Fetching upstream changes from git@github.com:elastic/apm-server.git
[2020-08-24T01:42:53.851Z]  > git --version # timeout=10
[2020-08-24T01:42:53.855Z]  > git --version # 'git version 2.17.1'
[2020-08-24T01:42:53.855Z] using GIT_SSH to set credentials GitHub user @elasticmachine SSH key
[2020-08-24T01:42:53.859Z]  > git fetch --no-tags --progress -- git@github.com:elastic/apm-server.git +refs/heads/*:refs/remotes/origin/* # timeout=15
[2020-08-24T01:42:57.417Z] Cleaning workspace
[2020-08-24T01:42:57.432Z] Using shallow fetch with depth 3
[2020-08-24T01:42:57.433Z] Pruning obsolete local branches
[2020-08-24T01:42:57.391Z]  > git config remote.origin.url git@github.com:elastic/apm-server.git # timeout=10
[2020-08-24T01:42:57.395Z]  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
[2020-08-24T01:42:57.407Z]  > git config remote.origin.url git@github.com:elastic/apm-server.git # timeout=10
[2020-08-24T01:42:57.419Z]  > git rev-parse --verify HEAD # timeout=10
[2020-08-24T01:42:57.424Z] No valid HEAD. Skipping the resetting
[2020-08-24T01:42:57.424Z]  > git clean -fdx # timeout=10
[2020-08-24T01:42:57.435Z] Fetching upstream changes from git@github.com:elastic/apm-server.git
[2020-08-24T01:42:57.435Z] using GIT_SSH to set credentials GitHub user @elasticmachine SSH key
[2020-08-24T01:42:57.439Z]  > git fetch --no-tags --progress --prune -- git@github.com:elastic/apm-server.git +refs/pull/4064/head:refs/remotes/origin/PR-4064 +refs/heads/master:refs/remotes/origin/master # timeout=15
[2020-08-24T01:42:58.172Z] Merging remotes/origin/master commit 40fb5c08d02c5e80b1e926e3d5a4542ae62c15b7 into PR head commit 3219c30ca05f38a04c07b25097ee3edf311eb938
[2020-08-24T01:42:58.520Z] Running on Jenkins in /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-4064
[2020-08-24T01:42:58.639Z] �[39;49m[INFO] getVaultSecret: Getting secrets�[0m
[2020-08-24T01:42:58.720Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-08-24T01:42:58.175Z]  > git config core.sparsecheckout # timeout=10
[2020-08-24T01:42:58.179Z]  > git checkout -f 3219c30ca05f38a04c07b25097ee3edf311eb938 # timeout=15
[2020-08-24T01:42:59.513Z] + chmod 755 generate-build-data.sh
[2020-08-24T01:42:59.513Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4064/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4064/runs/21 FAILURE 197815
[2020-08-24T01:43:00.063Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-4064/runs/21/steps/?limit=10000 -o steps-info.json

@axw axw force-pushed the event-outcome branch 3 times, most recently from 21be456 to 318f9cf Compare August 11, 2020 10:08
@axw axw force-pushed the event-outcome branch 3 times, most recently from e3fcb7b to a4abbb2 Compare August 12, 2020 04:25
@axw axw force-pushed the event-outcome branch 7 times, most recently from 3219c30 to 50aca18 Compare August 24, 2020 01:41
@apmmachine
Copy link
Contributor

apmmachine commented Aug 24, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #4064 updated]

  • Start Time: 2020-08-26T03:30:08.581+0000

  • Duration: 44 min 9 sec

Test stats 🧪

Test Results
Failed 0
Passed 3231
Skipped 142
Total 3373

Steps errors

Expand to view the steps failures

  • Name: Compress

    • Description: tar --exclude=coverage-files.tgz -czf coverage-files.tgz coverage

    • Duration: 0 min 0 sec

    • Start Time: 2020-08-26T03:45:04.057+0000

    • log

  • Name: Compress

    • Description: tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests

    • Duration: 0 min 0 sec

    • Start Time: 2020-08-26T04:00:00.966+0000

    • log

  • Name: Test Sync

    • Description: ./script/jenkins/sync.sh

    • Duration: 3 min 52 sec

    • Start Time: 2020-08-26T03:39:42.775+0000

    • log

@axw axw marked this pull request as ready for review August 24, 2020 10:24
@axw
Copy link
Member Author

axw commented Aug 24, 2020

Note to reviewer: you might want to filter out the .json files when reviewing initially. This change has caused a lot of .approved.json files to be updated on account of the server setting a default value for outcome if missing.

@beniwohli
Copy link
Contributor

An agent implementation can be found here: elastic/apm-agent-python#899

@axw
Copy link
Member Author

axw commented Aug 26, 2020

Thanks @beniwohli. I tested with apm-agent-python & aiohttp, and it appears to be working well:

image

@axw axw merged commit fa7ee8d into elastic:master Aug 26, 2020
@axw axw deleted the event-outcome branch August 26, 2020 04:14
jalvz pushed a commit to jalvz/apm-server that referenced this pull request Aug 31, 2020
* spec: add {transaction,span}.outcome

* model: add {Span,Transaction}.Outcome fields

* model/modeldecoder: {span,transaction}.outcome

* Update fields, tests, generated docs

* Add changelog entry
@jalvz jalvz self-assigned this Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants