Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sampling: fix pubsub implementation (#5126)
* sampling: fix pubsub implementation The initial implementation was written as a ~quick hack, with the expectation that it would be replaced by the Changes API. It was broken due to its ignorance of data streams, and multi-shard indices. Sequence numbers are only comparable within a single shard. Given that there is no known delivery date for the Changes API, we propose to instead revise the pubsub implementation to address the problems by: - enforcing single-shard indices for sampled trace data streams - searching (now single-shard) backing indices individually In addition, we now use global checkpoints to bound searches, and use PIT (point in time) for paging through results. Querying underlying indices and global checkpoints requires an additional "monitor" index privilege. * sampling/pubsub: remove PIT again Simplify by just using direct searches with a rnage on _seq_no, using the most recently observed _seq_no value as the lower bound. We can do this within the loop as well (i.e. until there are no more results, or we've observed the global checkpoint.) * sampling/pubsub: only query get metric from _stats * pubsub: force-refresh indices Refresh indices after observing an updated global checkpoint to ensure document visibility is correct up to the observed global checkpoint. * Update changelog * systemtest: fix spurious test failure (cherry picked from commit 94e3201) # Conflicts: # apmpackage/apm/0.2.0/data_stream/sampled_traces/manifest.yml # changelogs/head.asciidoc # x-pack/apm-server/sampling/pubsub/pubsub.go # x-pack/apm-server/sampling/pubsub/pubsub_test.go # x-pack/apm-server/sampling/pubsub/pubsubtest/client.go
- Loading branch information
Showing
5 changed files
with
304 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
apmpackage/apm/0.2.0/data_stream/sampled_traces/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
title: APM tail-sampled traces | ||
type: traces | ||
dataset: sampled | ||
ilm_policy: traces-apm.sampled-default_policy | ||
elasticsearch: | ||
index_template: | ||
settings: | ||
# Create a single shard per index, so we can use | ||
# global checkpoints as a way of limiting search | ||
# results. | ||
number_of_shards: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[[release-notes-head]] | ||
== APM Server version HEAD | ||
|
||
https://github.com/elastic/apm-server/compare/7.13\...master[View commits] | ||
|
||
[float] | ||
==== Breaking Changes | ||
|
||
[float] | ||
==== Bug fixes | ||
* Don't auto-disable ILM due to a failure to communicate with Elasticsearch {pull}5264[5264] | ||
* Fix panic due to misaligned 64-bit access on 32-bit architectures {pull}5277[5277] | ||
* Fixed tail-based sampling pubsub to use _seq_no correctly {pull}5126[5126] | ||
* Fix document grouping of translated OpenTelemetry Java metrics {pull}5309[5309] | ||
* OpenTelemetry: record array attributes as labels {pull}5286[5286] | ||
* model/modeldecoder: fix 32-bit timestamp decoding {pull}5308[5308] | ||
|
||
[float] | ||
==== Intake API Changes | ||
|
||
[float] | ||
==== Added | ||
* Support setting agent configuration from apm-server.yml {pull}5177[5177] | ||
* Add metric_type and unit to field metadata of system metrics {pull}5230[5230] | ||
* Upgrade Go to 1.15.12 {pull}[] | ||
|
||
[float] | ||
==== Deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.