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

Consolidate model.HTTP and model.Http #5764

Merged
merged 1 commit into from
Jul 21, 2021
Merged

Consolidate model.HTTP and model.Http #5764

merged 1 commit into from
Jul 21, 2021

Conversation

axw
Copy link
Member

@axw axw commented Jul 20, 2021

Motivation/summary

For a long time we have had two distinct types, model.HTTP and model.Http, for span (outgoing) and transaction (incoming) HTTP fields. Many of the fields in these types are common. Consolidate into one type to simplify the model and transformation to documents.

There is a minor change in precedence for handling context.http.status_code and context.http.response.status_code. This should not matter; the values should be the same, and if they're not then that's on the agent.

Checklist

- [ ] Update CHANGELOG.asciidoc
- [ ] Documentation has been updated

How to test these changes

Non-functional change.

Related issues

#4120
#3565

@apmmachine
Copy link
Contributor

apmmachine commented Jul 20, 2021

💔 Tests Failed

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

Expand to view the summary

Build stats

  • Start Time: 2021-07-20T07:26:01.956+0000

  • Duration: 37 min 24 sec

  • Commit: 359a050

Test stats 🧪

Test Results
Failed 1
Passed 5964
Skipped 14
Total 5979

Trends 🧪

Image of Build Times

Image of Tests

Test errors 1

Expand to view the tests failures

Build and Test / APM Integration Tests / test_rum – tests.agent.test_rum
    Expand to view the error details

     AssertionError: Expected done, got Timeout exceeded while waiting for event 
    

    Expand to view the stacktrace

     rum = <tests.fixtures.agents.Agent object at 0x7f48c151b710>
    
        def test_rum(rum):
            elasticsearch = rum.apm_server.elasticsearch
            elasticsearch.clean()
            endpoint = Endpoint(rum.url, "run_integration_test", qu_str="echo=done", text="done")
        
            r = requests.get(endpoint.url)
    >       utils.check_request_response(r, endpoint)
    
    tests/agent/test_rum.py:12: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    req = <Response [500]>
    endpoint = <tests.endpoint.Endpoint object at 0x7f48c048b7d0>
    
        def check_request_response(req, endpoint):
            msg = "Expected {}, got {}".format(endpoint.text, req.text)
    >       assert req.text.strip() == endpoint.text, msg
    E       AssertionError: Expected done, got Timeout exceeded while waiting for event
    
    tests/utils.py:38: AssertionError 
    

Steps errors 1

Expand to view the steps failures

Test Sync
  • Took 3 min 29 sec . View more details on here
  • Description: ./.ci/scripts/sync.sh

Log output

Expand to view the last 100 lines of log output

[2021-07-20T08:01:06.129Z] --- PASS: TestAPMServerMonitoring (0.51s)
[2021-07-20T08:01:06.129Z] === RUN   TestAPMServerMonitoringBuiltinUser
[2021-07-20T08:01:06.129Z] --- PASS: TestAPMServerMonitoringBuiltinUser (2.02s)
[2021-07-20T08:01:06.129Z] === RUN   TestAPMServerOnboarding
[2021-07-20T08:01:06.129Z] --- PASS: TestAPMServerOnboarding (4.76s)
[2021-07-20T08:01:06.129Z] === RUN   TestOTLPGRPCTraces
[2021-07-20T08:01:06.129Z] --- PASS: TestOTLPGRPCTraces (4.14s)
[2021-07-20T08:01:06.129Z] === RUN   TestOTLPGRPCMetrics
[2021-07-20T08:01:06.129Z] --- PASS: TestOTLPGRPCMetrics (4.56s)
[2021-07-20T08:01:06.129Z] === RUN   TestOTLPGRPCAuth
[2021-07-20T08:01:06.129Z] --- PASS: TestOTLPGRPCAuth (4.10s)
[2021-07-20T08:01:06.129Z] === RUN   TestOTLPClientIP
[2021-07-20T08:01:06.129Z] --- PASS: TestOTLPClientIP (5.31s)
[2021-07-20T08:01:06.129Z] === RUN   TestOTLPAnonymous
[2021-07-20T08:01:06.129Z] --- PASS: TestOTLPAnonymous (0.20s)
[2021-07-20T08:01:06.129Z] === RUN   TestOTLPRateLimit
[2021-07-20T08:01:06.129Z] --- PASS: TestOTLPRateLimit (0.24s)
[2021-07-20T08:01:06.129Z] === RUN   TestRUMXForwardedFor
[2021-07-20T08:01:06.129Z] --- PASS: TestRUMXForwardedFor (3.96s)
[2021-07-20T08:01:06.129Z] === RUN   TestRUMAllowServiceNames
[2021-07-20T08:01:06.129Z] --- PASS: TestRUMAllowServiceNames (0.20s)
[2021-07-20T08:01:06.129Z] === RUN   TestRUMRateLimit
[2021-07-20T08:01:06.129Z] --- PASS: TestRUMRateLimit (0.91s)
[2021-07-20T08:01:06.129Z] === RUN   TestRUMCORS
[2021-07-20T08:01:06.129Z] --- PASS: TestRUMCORS (0.27s)
[2021-07-20T08:01:06.129Z] === RUN   TestKeepUnsampled
[2021-07-20T08:01:06.129Z] === RUN   TestKeepUnsampled/false
[2021-07-20T08:01:06.129Z] === RUN   TestKeepUnsampled/true
[2021-07-20T08:01:06.129Z] --- PASS: TestKeepUnsampled (9.30s)
[2021-07-20T08:01:06.129Z]     --- PASS: TestKeepUnsampled/false (5.23s)
[2021-07-20T08:01:06.129Z]     --- PASS: TestKeepUnsampled/true (4.07s)
[2021-07-20T08:01:06.129Z] === RUN   TestKeepUnsampledWarning
[2021-07-20T08:01:06.129Z] --- PASS: TestKeepUnsampledWarning (4.84s)
[2021-07-20T08:01:06.129Z] === RUN   TestTailSampling
[2021-07-20T08:01:06.129Z]     sampling_test.go:135: waiting for 100 "parent" transactions
[2021-07-20T08:01:06.129Z]     sampling_test.go:135: waiting for 100 "child" transactions
[2021-07-20T08:01:06.129Z] --- PASS: TestTailSampling (6.43s)
[2021-07-20T08:01:06.129Z] === RUN   TestTailSamplingUnlicensed
[2021-07-20T08:01:06.129Z] 2021/07/20 07:59:52 Starting container id: edf82e994f84 image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-52a5431f-SNAPSHOT
[2021-07-20T08:01:06.130Z] 2021/07/20 07:59:52 Waiting for container id edf82e994f84 image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-52a5431f-SNAPSHOT
[2021-07-20T08:01:06.130Z] 2021/07/20 08:00:11 Container is ready id: edf82e994f84 image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-52a5431f-SNAPSHOT
[2021-07-20T08:01:06.130Z] --- PASS: TestTailSamplingUnlicensed (28.99s)
[2021-07-20T08:01:06.130Z] === RUN   TestRUMErrorSourcemapping
[2021-07-20T08:01:06.130Z] --- PASS: TestRUMErrorSourcemapping (5.39s)
[2021-07-20T08:01:06.130Z] === RUN   TestRUMSpanSourcemapping
[2021-07-20T08:01:06.130Z] --- PASS: TestRUMSpanSourcemapping (4.30s)
[2021-07-20T08:01:06.130Z] === RUN   TestDuplicateSourcemapWarning
[2021-07-20T08:01:06.130Z] --- PASS: TestDuplicateSourcemapWarning (4.20s)
[2021-07-20T08:01:06.130Z] === RUN   TestNoMatchingSourcemap
[2021-07-20T08:01:06.130Z] --- PASS: TestNoMatchingSourcemap (4.21s)
[2021-07-20T08:01:06.130Z] === RUN   TestFetchLatestSourcemap
[2021-07-20T08:01:06.130Z] --- PASS: TestFetchLatestSourcemap (5.58s)
[2021-07-20T08:01:06.130Z] === RUN   TestSourcemapCaching
[2021-07-20T08:01:06.130Z] --- PASS: TestSourcemapCaching (5.33s)
[2021-07-20T08:01:06.130Z] === RUN   TestIndexTemplateCoverage
[2021-07-20T08:01:06.130Z] --- PASS: TestIndexTemplateCoverage (4.77s)
[2021-07-20T08:01:06.130Z] PASS
[2021-07-20T08:01:06.130Z] ok  	github.com/elastic/apm-server/systemtest	407.554s
[2021-07-20T08:01:06.130Z] === RUN   TestAPMServer
[2021-07-20T08:01:06.130Z] 2021/07/20 07:54:05 Building apm-server...
[2021-07-20T08:01:06.130Z] 2021/07/20 07:54:07 Built /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-5764/src/github.com/elastic/apm-server/apm-server
[2021-07-20T08:01:06.130Z] --- PASS: TestAPMServer (2.43s)
[2021-07-20T08:01:06.130Z] === RUN   TestUnstartedAPMServer
[2021-07-20T08:01:06.130Z] --- PASS: TestUnstartedAPMServer (0.00s)
[2021-07-20T08:01:06.130Z] === RUN   TestAPMServerStartTLS
[2021-07-20T08:01:06.130Z] --- PASS: TestAPMServerStartTLS (0.09s)
[2021-07-20T08:01:06.130Z] === RUN   TestExpvar
[2021-07-20T08:01:06.130Z] --- PASS: TestExpvar (0.10s)
[2021-07-20T08:01:06.130Z] PASS
[2021-07-20T08:01:06.130Z] ok  	github.com/elastic/apm-server/systemtest/apmservertest	2.654s
[2021-07-20T08:01:06.130Z] ?   	github.com/elastic/apm-server/systemtest/benchtest	[no test files]
[2021-07-20T08:01:06.130Z] ?   	github.com/elastic/apm-server/systemtest/cmd/apmbench	[no test files]
[2021-07-20T08:01:06.130Z] ?   	github.com/elastic/apm-server/systemtest/estest	[no test files]
[2021-07-20T08:01:06.130Z] ?   	github.com/elastic/apm-server/systemtest/fleettest	[no test files]
[2021-07-20T08:01:06.130Z] + cleanup
[2021-07-20T08:01:06.130Z] + rm -rf /tmp/tmp.23PAVP37Un
[2021-07-20T08:01:06.130Z] + .ci/scripts/docker-get-logs.sh
[2021-07-20T08:01:07.529Z] Post stage
[2021-07-20T08:01:07.544Z] Running in /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-5764/src/github.com/elastic/apm-server/build
[2021-07-20T08:01:07.580Z] Archiving artifacts
[2021-07-20T08:01:07.904Z] Recording test results
[2021-07-20T08:01:08.597Z] [Checks API] No suitable checks publisher found.
[2021-07-20T08:01:08.976Z] + tar --version
[2021-07-20T08:01:09.339Z] + tar --exclude=system-tests-linux-files.tgz -czf system-tests-linux-files.tgz system-tests
[2021-07-20T08:01:09.695Z] Archiving artifacts
[2021-07-20T08:01:10.130Z] Terminated
[2021-07-20T08:01:10.154Z] Terminated
[2021-07-20T08:03:20.634Z] [INFO] For detailed information see: https://apm-ci.elastic.co/job/apm-integration-tests-selector-mbp/job/master/18885/display/redirect
[2021-07-20T08:03:22.843Z] Copied 27 artifacts from "APM Integration Test MBP Selector » master" build number 18885
[2021-07-20T08:03:24.264Z] Post stage
[2021-07-20T08:03:24.280Z] Recording test results
[2021-07-20T08:03:25.122Z] [Checks API] No suitable checks publisher found.
[2021-07-20T08:03:25.510Z] Running on Jenkins in /var/lib/jenkins/workspace/pm-server_apm-server-mbp_PR-5764
[2021-07-20T08:03:25.574Z] [INFO] getVaultSecret: Getting secrets
[2021-07-20T08:03:25.623Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-07-20T08:03:26.391Z] + chmod 755 generate-build-data.sh
[2021-07-20T08:03:26.391Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5764/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5764/runs/7 UNSTABLE 2244169
[2021-07-20T08:03:26.391Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5764/runs/7/steps/?limit=10000 -o steps-info.json
[2021-07-20T08:03:26.641Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5764/runs/7/tests/?status=FAILED -o tests-errors.json
[2021-07-20T08:03:26.641Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/apm-server/apm-server-mbp/PR-5764/runs/7/log/ -o pipeline-log.txt

@axw axw force-pushed the model-http branch 4 times, most recently from 7fc9f47 to fca45f9 Compare July 20, 2021 06:38
For a long time we have had two distinct types,
model.HTTP and model.Http, for span (outgoing)
and transaction (incoming) HTTP fields.

Consolidate these two into one type, to simplify
the model and transformation to documents.

There is a minor change in precedence for handling
context.http.status_code and context.http.response.status_code.
This should not matter; the values should be the same,
and if they're not then that's on the agent.
@axw axw marked this pull request as ready for review July 20, 2021 08:07
@axw axw requested a review from a team July 20, 2021 08:08
@axw axw merged commit 46f214e into elastic:master Jul 21, 2021
@axw axw deleted the model-http branch July 21, 2021 06:09
mergify bot pushed a commit that referenced this pull request Jul 21, 2021
For a long time we have had two distinct types,
model.HTTP and model.Http, for span (outgoing)
and transaction (incoming) HTTP fields.

Consolidate these two into one type, to simplify
the model and transformation to documents.

There is a minor change in precedence for handling
context.http.status_code and context.http.response.status_code.
This should not matter; the values should be the same,
and if they're not then that's on the agent.

(cherry picked from commit 46f214e)
axw added a commit that referenced this pull request Jul 21, 2021
For a long time we have had two distinct types,
model.HTTP and model.Http, for span (outgoing)
and transaction (incoming) HTTP fields.

Consolidate these two into one type, to simplify
the model and transformation to documents.

There is a minor change in precedence for handling
context.http.status_code and context.http.response.status_code.
This should not matter; the values should be the same,
and if they're not then that's on the agent.

(cherry picked from commit 46f214e)

Co-authored-by: Andrew Wilkins <[email protected]>
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.

4 participants