Skip to content
Merged
5 changes: 5 additions & 0 deletions docs/changelog/131395.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 131395
summary: Enable failure store for newly created OTel data streams
area: Data streams
type: enhancement
issues: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: ${xpack.oteldata.template.version}
_meta:
description: Default settings for all OpenTelemetry data streams
managed: true
template:
data_stream_options:
failure_store:
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ composed_of:
- logs@mappings
- logs@settings
- otel@mappings
- otel@settings
- logs-otel@mappings
- semconv-resource-to-ecs@mappings
- logs@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ _meta:
composed_of:
- metrics@tsdb-settings
- otel@mappings
- otel@settings
- metrics-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics@custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ composed_of:
- traces@mappings
- traces@settings
- otel@mappings
- otel@settings
- traces-otel@mappings
- semconv-resource-to-ecs@mappings
- traces@custom
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugin/otel-data/src/main/resources/resources.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# "version" holds the version of the templates and ingest pipelines installed
# by xpack-plugin otel-data. This must be increased whenever an existing template is
# changed, in order for it to be updated on Elasticsearch upgrade.
version: 9
version: 10

component-templates:
- otel@mappings
- otel@settings
- logs-otel@mappings
- semconv-resource-to-ecs@mappings
- metrics-otel@mappings
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
setup:
- do:
cluster.health:
wait_for_events: languid
---
teardown:
- do:
indices.delete_data_stream:
name: logs-generic.otel-default
ignore: 404
---
"Test logs-*.otel-* data streams have failure store enabled by default":
# Index a valid document (string message).
- do:
index:
index: logs-generic.otel-default
refresh: true
body:
'@timestamp': '2023-01-01T12:00:00Z'
severity_text: "INFO"
text: "Application started successfully"
- match: { result: created }

# Assert empty failure store.
- do:
indices.get_data_stream:
name: logs-generic.otel-default
- match: { data_streams.0.name: logs-generic.otel-default }
- length: { data_streams.0.indices: 1 }
- match: { data_streams.0.failure_store.enabled: true }
- length: { data_streams.0.failure_store.indices: 0 }

# Index a document with naming alias, causing an error.
- do:
index:
index: logs-generic.otel-default
refresh: true
body:
'@timestamp': '2023-01-01T12:01:00Z'
severity_text: "ERROR"
message: "Application started successfully"
- match: { result: 'created' }
- match: { failure_store: used}

# Assert failure store containing 1 item.
- do:
indices.get_data_stream:
name: logs-generic.otel-default
- length: { data_streams.0.failure_store.indices: 1 }

# Assert valid document.
- do:
search:
index: logs-generic.otel-default::data
body:
query:
match_all: {}
- length: { hits.hits: 1 }
- match: { hits.hits.0._source.severity_text: "INFO" }
- match: { hits.hits.0._source.text: "Application started successfully" }

# Assert invalid document.
- do:
search:
index: logs-generic.otel-default::failures
body:
query:
match_all: {}
- length: { hits.hits: 1 }
- match: { hits.hits.0._source.document.source.severity_text: "ERROR" }
- match: { hits.hits.0._source.document.source.message: "Application started successfully" }
- match: { hits.hits.0._source.error.type: "document_parsing_exception" }
Loading