Skip to content

ThrottlingTroll/ThrottlingTroll-AspDotNetCore-Samples

Repository files navigation

ThrottlingTroll-AspDotNetCore-Samples

Sample code demonstrating how to use ThrottlingTroll with ASP.NET Core.

How to run locally

As a prerequisite, you will need minimum .NET 6.0 installed.

  1. Either open ThrottlingTroll-AspDotNetCore-Samples.sln in your Visual Studio and press F5, or go to ThrottlingTrollSampleWeb folder and type dotnet run in your terminal window.
  2. Open http://localhost:5085/swagger in your browser and try making calls.

By default the default MemoryCacheCounterStore is used. If you want to use RedisCounterStore, add RedisConnectionString setting to appsettings.json file. For a local Redis server that connection string usually looks like localhost:6379.

How to see OpenTelemetry

The project is already instrumented with OpenTelemetry and Zipkin exporter, so all you have to do is:

  1. Run Zipkin locally, e.g.:

    curl -sSL https://zipkin.io/quickstart.sh | bash -s
    java -jar zipkin.jar
    
  2. Open Zipkin UI (http://localhost:9411/zipkin).

  3. Observe traces, e.g.:

    image

About

Sample code demonstrating how to use ThrottlingTroll with ASP.NET Core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published