Coder Social home page Coder Social logo

nikiforovall / tests-instrumentation-with-otel-and-aspire Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 548 KB

Integration Tests + Alba + Aspire Dashboard + Testcontainers + Otel

Home Page: https://nikiforovall.github.io/dotnet/opentelemtry/2024/06/07/test-instrumentation-with-otel-aspire.html

License: MIT License

C# 100.00%
aspire dotnet opentelemtry

tests-instrumentation-with-otel-and-aspire's Introduction

Automated Tests Monitoring With Aspire Dashboard

Integration Tests + Alba + Aspire Dashboard + Testcontainers + Otel

See also: https://github.com/NikiforovAll/xunit-instrumentation-otel-template - for Getting Started.

blog-cover

This repository demonstrates how to instrument integration tests via OpenTelemetry and see the results from Aspire Dashboard.

Integration tests dependencies (PostgresSQL Database, AspireDashboard) are automatically managed as Testcontainers.

Open: http://localhost:18888/ to see the results of Test Runs.

Test

dotnet test --filter TodosTests --verbosity normal
# Starting test execution, please wait...
# A total of 1 test files matched the specified pattern.
# [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.1+ce9211e970 (64-bit .NET 8.0.6)
# [xUnit.net 00:00:00.17]   Discovering: Api.IntegrationTests
# [xUnit.net 00:00:00.24]   Discovered:  Api.IntegrationTests
# [xUnit.net 00:00:00.24]   Starting:    Api.IntegrationTests
# [xUnit.net 00:00:07.51]   Finished:    Api.IntegrationTests
#   Passed IntegrationTests.TodosTests.PostTodos_InvalidTitle_BadRequest(todoItem: TodoItemViewModel { Id = 205, Title = Title4cc824aa-1ec5-4c99-b210-7e5251a86876, IsComplete = True }) [139 ms]
#   Passed IntegrationTests.TodosTests.DeleteTodo_ExistingTodo_NotFound [327 ms]
#   Passed IntegrationTests.TodosTests.PostTodos_ValidTodo_Ok [359 ms]
#   Passed IntegrationTests.TodosTests.DeleteTodo_ExistingTodo_Ok(item: TodoItem { Id = 234, IsComplete = True, Title = "Title652b0e41-0d24-427a-a829-33dfa22eab88" }) [378 ms]
#   Passed IntegrationTests.TodosTests.GetTodo_ExistingTodo_Ok(item: TodoItem { Id = 198, IsComplete = True, Title = "Titlef9f1ab3a-0c0e-49ea-a94f-c008183794aa" }) [437 ms]
#   Passed IntegrationTests.TodosTests.GetTodos_SomeTodosExist_Ok(todoItemTitle: "todoItemTitle43031b1e-8d34-49a1-82e9-fc844ff505ea") [508 ms]

# Test Run Successful.
# Total tests: 6
#      Passed: 6
#  Total time: 8.3519 Seconds

Demo

All traces:

overview

Result of warmup:

warmup

Note, events denoted when each dependency has started.

Sequential test run:

seq-test-run

Parallel test run:

par-test-run

💡Test Runs are separated based on service.instance.id which is equivalent to test.run_id custom attribute and assigned based on sequential Guids.

replica-set

Reference

tests-instrumentation-with-otel-and-aspire's People

Contributors

nikiforovall avatar

Stargazers

Rubén avatar Josh Sullivan avatar  avatar

Watchers

 avatar

Forkers

devbox10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.