Skip to content

Conversation

@kruskall
Copy link
Member

Motivation/summary

A couple of changes:

  • revert the delete hook in systemtests: TestNoMatchingSourcemaps was failing because the resulting document had a sourcemap applied. It looks like there was a sourcemap in ES despite the cleanupElasticsearch call. Reverting the delete hook seems to make things more deterministic.
  • remove hardcoded timeouts: both the 1s and the 500ms timeout are gone.
  • the sourcemap_fetcher is not blocking anymore as a side effect sourcemap remapping won't work before init has completed

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

Related issues

Related to #10338

@mergify
Copy link
Contributor

mergify bot commented Feb 28, 2023

This pull request does not have a backport label. Could you fix it @kruskall? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.x is the label to automatically backport to the 7.x branch.
  • backport-7./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Feb 28, 2023
@ghost
Copy link

ghost commented Feb 28, 2023

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2023-03-01T08:30:31.651+0000

  • Duration: 8 min 37 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate and publish the docker images.

  • /test windows : Build & tests on Windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@ghost
Copy link

ghost commented Feb 28, 2023

📚 Go benchmark report

Diff with the main branch

goos: linux
goarch: amd64
pkg: github.com/elastic/apm-server/internal/agentcfg
cpu: 12th Gen Intel(R) Core(TM) i5-12500
                                  │ build/main/bench.out │             bench.out              │
                                  │        sec/op        │    sec/op     vs base              │
geomean                                     68.90n         68.92n        +0.02%
¹ need >= 6 samples for confidence interval at level 0.95

                                  │ build/main/bench.out │              bench.out              │
                                  │         B/op         │    B/op      vs base                │
geomean                                                ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

                                  │ build/main/bench.out │              bench.out              │
                                  │      allocs/op       │  allocs/op   vs base                │
geomean                                                ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

pkg: github.com/elastic/apm-server/internal/beater/request
                                             │ build/main/bench.out │              bench.out              │
                                             │        sec/op        │    sec/op     vs base               │
ContextReset/X-Real-IP_ipv4-12                         802.2n ± ∞ ¹   579.7n ± ∞ ¹  -27.74% (p=0.032 n=5)
geomean                                                949.1n         900.5n         -5.12%
¹ need >= 6 samples for confidence interval at level 0.95

                                             │ build/main/bench.out │               bench.out               │
                                             │         B/op         │     B/op       vs base                │
geomean                                                           ³                  +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

                                             │ build/main/bench.out │              bench.out              │
                                             │      allocs/op       │  allocs/op   vs base                │
geomean                                                           ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

pkg: github.com/elastic/apm-server/internal/publish
             │ build/main/bench.out │          bench.out           │
             │        sec/op        │   sec/op     vs base         │
¹ need >= 6 samples for confidence interval at level 0.95

             │ build/main/bench.out │           bench.out            │
             │         B/op         │     B/op       vs base         │
¹ need >= 6 samples for confidence interval at level 0.95

             │ build/main/bench.out │           bench.out           │
             │      allocs/op       │  allocs/op    vs base         │
¹ need >= 6 samples for confidence interval at level 0.95

pkg: github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics
                 │ build/main/bench.out │           bench.out           │
                 │        sec/op        │    sec/op     vs base         │
¹ need >= 6 samples for confidence interval at level 0.95

                 │ build/main/bench.out │            bench.out             │
                 │         B/op         │     B/op       vs base           │
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

                 │ build/main/bench.out │           bench.out            │
                 │      allocs/op       │  allocs/op   vs base           │
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

pkg: github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics
                        │ build/main/bench.out │           bench.out           │
                        │        sec/op        │    sec/op     vs base         │
¹ need >= 6 samples for confidence interval at level 0.95

                        │ build/main/bench.out │           bench.out            │
                        │         B/op         │    B/op      vs base           │
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

                        │ build/main/bench.out │           bench.out            │
                        │      allocs/op       │  allocs/op   vs base           │
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

pkg: github.com/elastic/apm-server/x-pack/apm-server/sampling
               │ build/main/bench.out │             bench.out              │
               │        sec/op        │    sec/op     vs base              │
geomean                  611.1n         641.4n        +4.96%
¹ need >= 6 samples for confidence interval at level 0.95

               │ build/main/bench.out │               bench.out               │
               │         B/op         │     B/op       vs base                │
geomean                             ³                  +0.35%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

               │ build/main/bench.out │              bench.out              │
               │      allocs/op       │  allocs/op   vs base                │
geomean                             ³                +0.00%               ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean

pkg: github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage
                                            │ build/main/bench.out │               bench.out               │
                                            │        sec/op        │    sec/op      vs base                │
WriteTransaction/nop_codec_big_tx-12                  300.1n ± ∞ ¹    702.6n ± ∞ ¹  +134.12% (p=0.016 n=5)
geomean                                               30.49µ          30.95µ          +1.51%
¹ need >= 6 samples for confidence interval at level 0.95

                                            │ build/main/bench.out │               bench.out                │
                                            │         B/op         │      B/op       vs base                │
ReadEvents/nop_codec_big_tx/100_events-12            244.6Ki ± ∞ ¹    244.5Ki ± ∞ ¹  -0.02% (p=0.048 n=5)
geomean                                              31.42Ki          31.38Ki        -0.12%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

                                            │ build/main/bench.out │              bench.out               │
                                            │      allocs/op       │  allocs/op    vs base                │
geomean                                                144.7          144.7        +0.00%
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

report generated with https://pkg.go.dev/golang.org/x/perf/cmd/benchstat

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Thanks, this is looking better.

We should pretty much never have a time.Sleep(...) in a test -- that will lead to flakiness. So if that wasn't just for debugging, let's find a deterministic alternative please.

@kruskall kruskall requested a review from axw March 1, 2023 00:10
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Thanks, almost there. Just needs a change in the tests, otherwise looks good.

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@kruskall kruskall enabled auto-merge (squash) March 1, 2023 03:20
@kruskall kruskall added the backport-8.7 Automated backport with mergify label Mar 1, 2023
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Mar 1, 2023
@kruskall kruskall merged commit 34d3395 into elastic:main Mar 1, 2023
mergify bot pushed a commit that referenced this pull request Mar 1, 2023
#10367)

* test: disable kibana fallback to avoid false positives

* fix: fall back immediately if the metadata fetcher is not ready

* test: add back delete hook for sourcemaps using the kibana api

* refactor: remove arbitrary 500ms timeout in chained fetcher

* test: disable kibana in nomatching sourcemap test

* test: update approvals results

* test: add time sleep to wait for init

* refactor: avoid time sleep in tests

* refactor: remove es ping and rely on initial sync request

* refactor: remove arbitrary 10s timeout and rely on es client timeout

* lint: fix linter issues

* test: refactor es config test and remove wait method from interface

* lint: remove unused methods

(cherry picked from commit 34d3395)

# Conflicts:
#	systemtest/kibana.go
kruskall added a commit that referenced this pull request Mar 1, 2023
…rcemaps (backport #10367) (#10399)

* fix: remove hardcoded timeout and don't block when fetching sourcemaps (#10367)

* test: disable kibana fallback to avoid false positives

* fix: fall back immediately if the metadata fetcher is not ready

* test: add back delete hook for sourcemaps using the kibana api

* refactor: remove arbitrary 500ms timeout in chained fetcher

* test: disable kibana in nomatching sourcemap test

* test: update approvals results

* test: add time sleep to wait for init

* refactor: avoid time sleep in tests

* refactor: remove es ping and rely on initial sync request

* refactor: remove arbitrary 10s timeout and rely on es client timeout

* lint: fix linter issues

* test: refactor es config test and remove wait method from interface

* lint: remove unused methods

(cherry picked from commit 34d3395)

# Conflicts:
#	systemtest/kibana.go

* fix: resolve conflicts

---------

Co-authored-by: kruskall <[email protected]>
@kruskall kruskall deleted the fix/sourcemap-fetcher-noblock branch March 1, 2023 13:19
@axw axw self-assigned this Mar 10, 2023
@axw
Copy link
Member

axw commented Mar 10, 2023

Repeated the tests in #9722 with BC5, all good now. Thanks @kruskall!

@axw axw mentioned this pull request Mar 20, 2023
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants