Read the detailed recipe for setting up OpenTelemetry Collector with Tracetest in our documentation.
This is a simple example from the article "Testing Event-driven Systems with OpenTelemetry" showing how to test an event-driven system using Apache Kafka as a event backbone.
If you want to run this example, just execute docker compose up
on this folder.
Feel free to check out the docs, and join our Slack Community for more info!
We can test four different scenarios with this example:
Here, we send a message as a regular user and check if all components are called as intended:
tracetest run test -f test-payment-order-submit-with-rest-api.yaml
On this scenario, we want to validate only the event consumers and check if they are properly working:
tracetest run test -f test-payment-order-submit-with-message.yaml
This scenario checks if the Risk Analysis consumer flags a order sent into Kafka as risky and check if it was persisted correctly:
tracetest run test -f test-risk-analysis-using-order-with-high-value.yaml
This scenario checks if the Risk Analysis consumer flags a order sent into Kafka as normal and check if it was persisted correctly:
tracetest run test -f test-risk-analysis-using-order-with-low-value.yaml