Background
With the support of detecting multiple datastreams for a system test in #3373 (comment), multiple data streams can now be detected for when an input supports dynamic_signal_types , or is of type traces. This means assertions fields_present, hit_count or min_count get applied equally to all discovered streams, which may not be desirable, especially in the case of fields_present.
Currently this can be controlled in part by using the signal_types config to declare which signal types you want to scope the test to, but can be complicated by APM enrichment also adding other streams.
This can also help reduce the amount of separate system tests that need to be defined. For example, a system test asserting on a logs stream, and separately another a metrics stream may use the same policy configuration and result in having to spin up the same test environment multiple times.
Criteria
This issue is to design and implement how to describe assertions scoped to particular data streams in system tests.
An example design from #3373 (comment)
assert:
datastream_count: 2
assert:
fields_present_per_datastream:
metrics-sqlserverreceiver.otel-*:
- field1
- field2
logs-sqlserverreceiver.otel-*:
- field3
- field4
Background
With the support of detecting multiple datastreams for a system test in #3373 (comment), multiple data streams can now be detected for when an input supports
dynamic_signal_types, or is of typetraces. This means assertionsfields_present,hit_countormin_countget applied equally to all discovered streams, which may not be desirable, especially in the case offields_present.Currently this can be controlled in part by using the
signal_typesconfig to declare which signal types you want to scope the test to, but can be complicated by APM enrichment also adding other streams.This can also help reduce the amount of separate system tests that need to be defined. For example, a system test asserting on a logs stream, and separately another a metrics stream may use the same policy configuration and result in having to spin up the same test environment multiple times.
Criteria
This issue is to design and implement how to describe assertions scoped to particular data streams in system tests.
An example design from #3373 (comment)