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

Drop observer.id and observer.ephemeral_id #9412

Merged
merged 4 commits into from
Oct 28, 2022

Conversation

axw
Copy link
Member

@axw axw commented Oct 20, 2022

Motivation/summary

We don't use these fields in the UI anywhere, and for debugging we can rely on the hostname to distinguish one APM Server instance from another. The observer.id and observer.ephemeral_id fields suggest that we should care about specific instances (and think of them as long-lived), and their continued presence contradicts our intentions for a more modern, cloud native, approach, where APM Server instances may come and go.

For now we need to continue persisting a UUID to disk for stack monitoring, as this is used to identify instances of APM Server. In the future we expect to revisit how stack monitoring works, and at that point we should redesign the documents to not enshrine a "pets" mentality. We may still want to identify individual instances (e.g. for calculating time-series IDs), but statefulness should not be required.

For tail-based sampling we now generate a UUID (for identifying its documents) at process start. The field has been renamed from observer.id to agent.ephemeral_id, the latter of which is an ECS field (observer.id is not).

We no longer pass beat.Info from beatcmd into package beater. Instead, beater hard-codes observer.type: apm-server, uses package version for observer.version, and calls os.Hostname() for observer.hostname. We need to recreate beat.Info for the libbeat outputs. If at some point we drop support for libbeat outputs, then we would have no more dependencies on beat.Info outside of package beatcmd.

Checklist

How to test these changes

  1. Ensure tail-based sampling still works (with multiple servers)
  2. Ensure stack monitoring still works (with multiple servers)

Related issues

Closes #3874

@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2022

This pull request does not have a backport label. Could you fix it @axw? 🙏
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 Oct 20, 2022
@axw axw force-pushed the beater-no-beatinfo-part2 branch 3 times, most recently from 5c68b7c to 5968c29 Compare October 20, 2022 10:53
@apmmachine
Copy link
Contributor

apmmachine commented Oct 20, 2022

💚 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: 2022-10-28T06:52:50.167+0000

  • Duration: 27 min 6 sec

Test stats 🧪

Test Results
Failed 0
Passed 153
Skipped 0
Total 153

🤖 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!)

@apmmachine
Copy link
Contributor

apmmachine commented Oct 20, 2022

📚 Go benchmark report

Diff with the main branch

name                                                                                              old time/op    new time/op    delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
FetchAndAdd/FetchFromCache-12                                                                       46.1ns ± 0%    41.1ns ± 0%  -10.68%  (p=0.000 n=5+4)
FetchAndAdd/FetchAndAddToCache-12                                                                    103ns ± 2%      96ns ± 5%   -6.81%  (p=0.008 n=5+5)
pkg:github.com/elastic/apm-server/internal/beater/request goos:linux goarch:amd64
ContextResetContentEncoding/empty-12                                                                 133ns ± 1%     117ns ± 1%  -11.83%  (p=0.008 n=5+5)
ContextResetContentEncoding/uncompressed-12                                                          165ns ± 3%     151ns ± 1%   -7.99%  (p=0.008 n=5+5)
ContextResetContentEncoding/deflate_sniff-12                                                        3.81µs ±10%    4.07µs ± 2%   +6.73%  (p=0.016 n=5+4)
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/invalid-json-metadata.ndjson-12                                                    17.5µs ±25%    22.0µs ±16%  +25.26%  (p=0.032 n=5+5)
BackendProcessor/otel-bridge.ndjson-12                                                              28.6µs ±50%    46.1µs ±20%  +61.42%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/logs.ndjson-12                          20.8µs ±10%    18.9µs ±10%   -8.82%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/metricsets.ndjson-12                    17.0µs ±16%    14.6µs ± 4%  -14.15%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel4/logs.ndjson-12                          13.5µs ± 8%    11.8µs ± 1%  -12.71%  (p=0.016 n=5+4)
BackendProcessorParallel/BenchmarkBackendProcessorParallel4/transactions_spans_rum.ndjson-12        3.26µs ± 5%    3.78µs ±15%  +16.02%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-event-type.ndjson-12            1.19µs ± 1%    1.18µs ± 2%   -1.36%  (p=0.024 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-json-event.ndjson-12            1.45µs ± 1%    1.43µs ± 1%   -1.45%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-metadata-2.ndjson-12             840ns ± 1%     827ns ± 1%   -1.55%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/metadata-null-values.ndjson-12          1.16µs ± 1%    1.14µs ± 1%   -1.50%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/minimal-service.ndjson-12               1.36µs ± 3%    1.33µs ± 0%   -2.18%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/span-links.ndjson-12                    1.56µs ± 2%    1.54µs ± 1%   -1.54%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions-huge_traces.ndjson-12      5.58µs ± 0%    5.47µs ± 0%   -2.07%  (p=0.016 n=4+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions.ndjson-12                  11.2µs ± 2%    10.9µs ± 1%   -2.45%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans.ndjson-12            11.1µs ± 0%    10.6µs ± 1%   -4.24%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum.ndjson-12        2.04µs ± 1%    1.98µs ± 1%   -3.36%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum_2.ndjson-12      1.96µs ± 1%    1.91µs ± 1%   -2.58%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors.ndjson-12                      7.36µs ± 1%    6.89µs ± 2%   -6.44%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/events.ndjson-12                      13.2µs ± 1%    12.9µs ± 0%   -2.28%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-event-type.ndjson-12           800ns ± 1%     792ns ± 1%   -0.98%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-json-event.ndjson-12          1.09µs ± 1%    1.07µs ± 1%   -1.32%  (p=0.024 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-metadata-2.ndjson-12           498ns ± 1%     489ns ± 2%   -1.78%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata.ndjson-12                    1.29µs ± 3%    1.25µs ± 1%   -2.96%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/minimal-service.ndjson-12              979ns ± 1%     956ns ± 1%   -2.41%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/optional-timestamps.ndjson-12         1.47µs ± 1%    1.43µs ± 1%   -2.38%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions.ndjson-12                9.36µs ± 1%    9.19µs ± 1%   -1.82%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions_spans.ndjson-12          9.42µs ± 1%    9.23µs ± 2%   -1.97%  (p=0.008 n=5+5)
ReadBatch/errors_rum.ndjson-12                                                                      31.2µs ±13%    25.7µs ±28%  -17.57%  (p=0.032 n=5+5)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
WriteTransaction/json_codec-12                                                                      11.4µs ±59%     4.5µs ± 9%  -60.67%  (p=0.032 n=5+5)
WriteTransaction/json_codec_big_tx-12                                                               11.3µs ±58%     5.1µs ±22%  -55.07%  (p=0.016 n=5+5)
WriteTransaction/nop_codec-12                                                                        673ns ±39%     385ns ±19%  -42.87%  (p=0.008 n=5+5)
ReadEvents/json_codec/0_events-12                                                                    360ns ± 9%     303ns ± 5%  -16.01%  (p=0.008 n=5+5)
ReadEvents/json_codec/1_events-12                                                                   10.5µs ± 5%     9.6µs ± 6%   -8.53%  (p=0.016 n=5+5)
ReadEvents/json_codec_big_tx/0_events-12                                                             342ns ± 5%     307ns ± 4%  -10.24%  (p=0.008 n=5+5)
ReadEvents/json_codec_big_tx/1_events-12                                                            12.7µs ± 5%    11.4µs ± 3%   -9.69%  (p=0.008 n=5+5)
ReadEvents/nop_codec/0_events-12                                                                     338ns ± 5%     303ns ± 5%  -10.37%  (p=0.008 n=5+5)
ReadEvents/nop_codec/1_events-12                                                                    1.98µs ± 5%    1.90µs ± 4%   -3.82%  (p=0.032 n=5+5)
ReadEvents/nop_codec_big_tx/0_events-12                                                              336ns ± 3%     306ns ± 4%   -8.88%  (p=0.008 n=5+5)
ReadEvents/nop_codec_big_tx/1_events-12                                                             2.00µs ± 3%    1.89µs ± 1%   -5.07%  (p=0.016 n=5+4)
IsTraceSampled/sampled-12                                                                           74.5ns ± 4%    67.4ns ± 3%   -9.50%  (p=0.008 n=5+5)
IsTraceSampled/unsampled-12                                                                         77.6ns ± 1%    70.3ns ± 1%   -9.41%  (p=0.008 n=5+5)
IsTraceSampled/unknown-12                                                                            417ns ± 5%     370ns ± 1%  -11.40%  (p=0.008 n=5+5)

name                                                                                              old alloc/op   new alloc/op   delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/beater/request goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
ModelIndexer/NoCompressionScaling-12                                                                2.96kB ± 0%    2.95kB ± 0%   -0.26%  (p=0.024 n=5+5)
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/invalid-json-metadata.ndjson-12                                                    5.19kB ± 1%    5.31kB ± 2%   +2.28%  (p=0.016 n=5+5)
BackendProcessor/metricsets.ndjson-12                                                               13.0kB ± 1%    13.4kB ± 2%   +2.81%  (p=0.008 n=5+5)
BackendProcessor/minimal.ndjson-12                                                                  5.64kB ± 1%    5.72kB ± 2%   +1.48%  (p=0.048 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/invalid-event-type.ndjson-12            4.00kB ± 1%    3.94kB ± 1%   -1.32%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-event.ndjson-12                 8.34kB ± 1%    8.24kB ± 1%   -1.19%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors.ndjson-12                      22.4kB ± 0%    22.5kB ± 0%   +0.57%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata.ndjson-12                    5.20kB ± 1%    5.27kB ± 1%   +1.27%  (p=0.008 n=5+5)
ReadBatch/heavy.ndjson-12                                                                            839kB ± 0%     838kB ± 0%   -0.15%  (p=0.008 n=5+5)
ReadBatch/metadata-null-values.ndjson-12                                                            2.42kB ± 0%    2.42kB ± 0%   -0.07%  (p=0.032 n=5+5)
ReadBatch/unknown-span-type.ndjson-12                                                               16.8kB ± 0%    16.8kB ± 0%   +0.07%  (p=0.016 n=5+5)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
Publisher-12                                                                                         307kB ± 2%     357kB ±20%  +16.26%  (p=0.016 n=4+5)
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64
WriteTransaction/json_codec-12                                                                      3.00kB ± 0%    3.00kB ± 0%   -0.04%  (p=0.048 n=5+5)
WriteTransaction/json_codec_big_tx-12                                                               3.90kB ± 0%    3.90kB ± 0%   -0.05%  (p=0.000 n=5+4)
ReadEvents/json_codec_big_tx/199_events-12                                                          1.42MB ± 0%    1.42MB ± 0%   +0.05%  (p=0.048 n=4+5)
ReadEvents/nop_codec/100_events-12                                                                   250kB ± 0%     250kB ± 0%   +0.07%  (p=0.008 n=5+5)
ReadEvents/nop_codec/199_events-12                                                                   470kB ± 0%     471kB ± 0%   +0.23%  (p=0.008 n=5+5)
ReadEvents/nop_codec_big_tx/100_events-12                                                            250kB ± 0%     250kB ± 0%   +0.05%  (p=0.032 n=5+5)

name                                                                                              old allocs/op  new allocs/op  delta
pkg:github.com/elastic/apm-server/internal/agentcfg goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/beater/request goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
ReadBatch/heavy.ndjson-12                                                                            22.1k ± 0%     22.1k ± 0%   -0.01%  (p=0.032 n=5+5)
pkg:github.com/elastic/apm-server/internal/publish goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/spanmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/aggregation/txmetrics goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/x-pack/apm-server/sampling/eventstorage goos:linux goarch:amd64

name                                                                                              old speed      new speed      delta
pkg:github.com/elastic/apm-server/internal/model/modelindexer goos:linux goarch:amd64
pkg:github.com/elastic/apm-server/internal/processor/stream goos:linux goarch:amd64
BackendProcessor/errors_transaction_id.ndjson-12                                                  71.0MB/s ±36%  48.0MB/s ±13%  -32.29%  (p=0.048 n=5+5)
BackendProcessor/invalid-json-metadata.ndjson-12                                                  26.0MB/s ±22%  20.6MB/s ±14%  -20.91%  (p=0.032 n=5+5)
BackendProcessor/otel-bridge.ndjson-12                                                            81.6MB/s ±60%  41.3MB/s ±23%  -49.39%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/logs.ndjson-12                         169MB/s ±11%   185MB/s ±10%   +9.90%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel2/metricsets.ndjson-12                   151MB/s ±14%   175MB/s ± 4%  +15.52%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel4/logs.ndjson-12                         259MB/s ± 8%   295MB/s ± 1%  +14.13%  (p=0.016 n=5+4)
BackendProcessorParallel/BenchmarkBackendProcessorParallel4/transactions_spans_rum.ndjson-12       354MB/s ± 5%   308MB/s ±14%  -13.19%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-event-type.ndjson-12           328MB/s ± 1%   333MB/s ± 2%   +1.38%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-json-event.ndjson-12           404MB/s ± 1%   410MB/s ± 1%   +1.47%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/invalid-metadata-2.ndjson-12           519MB/s ± 1%   527MB/s ± 1%   +1.57%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/metadata-null-values.ndjson-12         454MB/s ± 1%   460MB/s ± 1%   +1.53%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/minimal-service.ndjson-12              313MB/s ± 3%   320MB/s ± 0%   +2.21%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/span-links.ndjson-12                   436MB/s ± 2%   443MB/s ± 1%   +1.56%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions-huge_traces.ndjson-12     568MB/s ± 0%   580MB/s ± 0%   +2.12%  (p=0.016 n=4+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions.ndjson-12                 505MB/s ± 2%   517MB/s ± 1%   +2.49%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans.ndjson-12           524MB/s ± 0%   547MB/s ± 1%   +4.43%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum.ndjson-12       565MB/s ± 1%   584MB/s ± 1%   +3.48%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel8/transactions_spans_rum_2.ndjson-12     569MB/s ± 1%   584MB/s ± 1%   +2.65%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/errors.ndjson-12                     862MB/s ± 1%   921MB/s ± 2%   +6.89%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/events.ndjson-12                     563MB/s ± 1%   576MB/s ± 0%   +2.33%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-event-type.ndjson-12         489MB/s ± 1%   494MB/s ± 1%   +0.98%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-json-event.ndjson-12         539MB/s ± 1%   546MB/s ± 1%   +1.31%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/invalid-metadata-2.ndjson-12         876MB/s ± 1%   892MB/s ± 1%   +1.82%  (p=0.016 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/metadata.ndjson-12                   967MB/s ± 3%   997MB/s ± 1%   +3.02%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/minimal-service.ndjson-12            434MB/s ± 1%   445MB/s ± 1%   +2.47%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/optional-timestamps.ndjson-12        699MB/s ± 1%   716MB/s ± 1%   +2.45%  (p=0.008 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions.ndjson-12               603MB/s ± 1%   614MB/s ± 1%   +1.85%  (p=0.032 n=5+5)
BackendProcessorParallel/BenchmarkBackendProcessorParallel200/transactions_spans.ndjson-12         618MB/s ± 1%   630MB/s ± 2%   +2.01%  (p=0.008 n=5+5)
ReadBatch/errors_rum.ndjson-12                                                                    61.1MB/s ±14%  75.7MB/s ±35%  +23.88%  (p=0.032 n=5+5)
ReadBatch/logs.ndjson-12                                                                          37.7MB/s ± 4%  47.1MB/s ±18%  +24.93%  (p=0.032 n=4+5)

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

Package beater now takes just the UUIDs for
`observer.id` and `observer.ephemeral_id`.

The `observer.type` field is hard-coded,
`observer.version` comes from package version,
and `observer.hostname` comes from a call
to `os.Hostname()`.

We need to recreate `beat.Info` for the
libbeat outputs. If at some point we can
get rid of those, then we can remove this.
@axw axw force-pushed the beater-no-beatinfo-part2 branch 2 times, most recently from 6f98025 to 44f3bef Compare October 24, 2022 02:04
We don't use these fields in the UI anywhere, and
for debugging we can rely on the hostname to
distinguish one APM Server instance from another.

The observer.id and observer.ephemeral_id fields
suggest that we should care about specific instances,
and their continued presence contradicts our
intentions for a more modern "cloud native" approach,
where APM Server instances may come and go.

For now we need to continue persisting a UUID
to disk for stack monitoring, as this is used to
identify instances of APM Server. In the future
we expect to revisit how stack monitoring works,
and at that point we should redesign the documents
to not enshrine a "pets" mentality.

For tail-based sampling we now generate a UUID
(for identifying its documents) at process start.
The field has been renamed from observer.id to
agent.ephemeral_id, the latter of which is an
ECS field (observer.id is not).
@axw axw force-pushed the beater-no-beatinfo-part2 branch from 44f3bef to f01864e Compare October 24, 2022 02:22
@axw axw requested a review from a team October 24, 2022 06:35
@axw axw marked this pull request as ready for review October 24, 2022 06:35
@mergify
Copy link
Contributor

mergify bot commented Oct 25, 2022

This pull request is now in conflicts. Could you fix it @axw? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b beater-no-beatinfo-part2 upstream/beater-no-beatinfo-part2
git merge upstream/main
git push upstream beater-no-beatinfo-part2

processors:
- rename:
field: observer.id
target_field: agent.ephemeral_id
Copy link
Contributor

Choose a reason for hiding this comment

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

ECS says:

This id normally changes across restarts, but agent.id does not.

I believe semantically observer.id -> agent.id would be more correct.

Copy link
Member Author

Choose a reason for hiding this comment

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

The ID changes on restart now - it's generated at process init.

@axw axw enabled auto-merge (squash) October 28, 2022 06:52
@axw axw merged commit bd3f058 into elastic:main Oct 28, 2022
@axw axw added the v8.6.0 label Oct 28, 2022
@axw axw deleted the beater-no-beatinfo-part2 branch October 28, 2022 07:24
@simitt simitt self-assigned this Dec 5, 2022
@simitt
Copy link
Contributor

simitt commented Dec 5, 2022

Tested on with BC5 on ESS that ingestion still works, including having TBS enabled across multiple APM Servers and also ensured Stack Monitoring is still working.

@elasticmachine
Copy link
Contributor

Package apm - 8.6.0-preview-1670294014 containing this change is available at https://epr.elastic.co/search?package=apm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify test-plan test-plan-ok v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ECS] align with ECS observer fieldset
5 participants