The current set up in this repo is very minimal. I am just touching the surface of what is possible. I wanted to demonstrate how to run the services locally
Build and run the api with docker on local port 4000
You should now be able to view OTEL metrics from the API
> curl http://localhost:4000/metrics
# TYPE process_runtime_dotnet_gc_collections_count counter# HELP process_runtime_dotnet_gc_collections_count Number of garbage collections that have occurred since process start.
process_runtime_dotnet_gc_collections_count{generation="gen2"} 0 1665568680770
process_runtime_dotnet_gc_collections_count{generation="gen1"} 0 1665568680770
process_runtime_dotnet_gc_collections_count{generation="gen0"} 0 1665568680770
...# EOF
Build and run the api with docker compose
Using docker compose, we can combine multiple docker containers into a single deployment
These containers can communicate with each other since we can specify what…
You should now be able to view OTEL metrics from the API
> curl http://localhost:4000/metrics
# TYPE process_runtime_dotnet_gc_collections_count counter# HELP process_runtime_dotnet_gc_collections_count Number of garbage collections that have occurred since process start.
process_runtime_dotnet_gc_collections_count{generation="gen2"} 0 1665568680770
process_runtime_dotnet_gc_collections_count{generation="gen1"} 0 1665568680770
process_runtime_dotnet_gc_collections_count{generation="gen0"} 0 1665568680770
...# EOF
Build and run the api with docker compose
Using docker compose, we can combine multiple docker containers into a single deployment.
These containers can communicate with each other since we can specify what network they can be added to.
Among other things, this will bring up Promethius. We have set Promethius up to scrape metrics from the /metrics endpoint of the weather forecaset API.
Notice in the promethius.yml file
static_configs:# replace the IP with your local IP for development# localhost is not it, as that is w/in the container :)-targets:['weather_forecast_api:5000']
To confirm promethius can access the API metric scraping endpoint, browse to Browse to the targets page. You should see
Then go to the explore page and select loki as the data source. Under labels, select filename. You should have have a log file accessable.
Traces
In the endpoint /WeatherForecast I added some external calls to show traces in action. Once you make some calls to this endpoint, you will start to generate traces
Zipkin
Browse to zipkin and click RUN QUERY. This should display some traces
Clicking one of these traces will give you more detail. As you can see, there is an over all request and the 2 external calls.
Jaeger
Browse to Jaeger, select a service and click Find Traces. This should display some traces
Similar to Zipkin, clicking on one of the traces will give more detail