-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sampling: use a data stream for sampled trace docs (#4707)
* beater: add Managed and Namespace to ServerParams This enables x-pack/apm-server code to alter behaviour based on whether APM Server is managed or not, and to create data streams with the configured namespace. * sampling: use a data stream for sampled trace docs Update tail-based sampling to index into and search a data stream. The data stream will be associated with an ILM policy that takes care of rollover and deletion. When running in Fleet-managed mode, apm-server will expect the data stream and ILM policy to exist for the data stream called `traces-sampled-<namespace>`. Servers participating in tail-based sampling are required to be configured with the same namespace. When running in standalone mode, apm-server will attempt to create an index template and ILM policy for a data stream called `apm-sampled-traces`. This is added for minimal support while we transition things to Fleet, and is intended to be removed in a future release. The data stream is not intended to adhere to the standard indexing strategy. * apmpackage: add traces-sampled-* data stream Add a data stream for sampled trace documents, along with an ILM policy which rolls over after 1h, and then deletes after 1h. * systemtest: fetch most recent beats monitoring doc When searching for beats monitoring docs, make sure we get the most recent one by sorting on 'timestamp'. * systemtest: update tail-based sampling test Update test to rely on apm-server to create its own data stream index template. * Cross-reference sampling/pubsub and apmpackage
- Loading branch information
Showing
26 changed files
with
490 additions
and
97 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
apmpackage/apm/0.1.0/data_stream/sampled_traces/elasticsearch/ilm/default_policy.json
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,19 @@ | ||
{ | ||
"policy": { | ||
"phases": { | ||
"hot": { | ||
"actions": { | ||
"rollover": { | ||
"max_age": "1h" | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"min_age": "1h", | ||
"actions": { | ||
"delete": {} | ||
} | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
apmpackage/apm/0.1.0/data_stream/sampled_traces/elasticsearch/ingest_pipeline/default.json
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 @@ | ||
{ | ||
"description": "Ingest pipeline for sampled trace documents", | ||
"processors": [ | ||
{ | ||
"set": { | ||
"field": "event.ingested", | ||
"value": "{{_ingest.timestamp}}" | ||
} | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
apmpackage/apm/0.1.0/data_stream/sampled_traces/fields/base-fields.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,12 @@ | ||
- name: '@timestamp' | ||
type: date | ||
description: Event timestamp. | ||
- name: data_stream.type | ||
type: constant_keyword | ||
description: Data stream type. | ||
- name: data_stream.dataset | ||
type: constant_keyword | ||
description: Data stream dataset. | ||
- name: data_stream.namespace | ||
type: constant_keyword | ||
description: Data stream namespace. |
8 changes: 8 additions & 0 deletions
8
apmpackage/apm/0.1.0/data_stream/sampled_traces/fields/ecs.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,8 @@ | ||
- name: event.ingested | ||
type: date | ||
description: | | ||
Timestamp when an event arrived in the central data store. | ||
- name: trace.id | ||
type: keyword | ||
description: | | ||
The ID of the sampled trace. |
6 changes: 6 additions & 0 deletions
6
apmpackage/apm/0.1.0/data_stream/sampled_traces/fields/fields.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,6 @@ | ||
# When changing fields or ILM policy, make sure to update | ||
# x-pack/apm-server/sampling/pubsub/datastream.go. | ||
- name: observer.id | ||
type: keyword | ||
description: | | ||
The ID of the APM Server that indexed the sampled trace ID. |
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,4 @@ | ||
title: APM tail-sampled traces | ||
type: traces | ||
dataset: sampled | ||
ilm_policy: traces-apm.sampled-default_policy |
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
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
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
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
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
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
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
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
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
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.