# Dotnet 8 \> Serilog \> OTEL \> APM

**URL:** <https://discuss.elastic.co/t/dotnet-8-serilog-otel-apm/351957>\
**Category:** APM\
**Tags:** docker, dotnet\
**Created:** [January 29, 2024, 5:56am UTC](https://discuss.elastic.co/t/dotnet-8-serilog-otel-apm/351957 "2024-01-29T05:56:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunny84](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Sunny84](https://discuss.elastic.co/u/Sunny84)\
**Post date:** [January 29, 2024, 5:56am UTC](https://discuss.elastic.co/t/dotnet-8-serilog-otel-apm/351957/1 "2024-01-29T05:56:17Z")

</div>

I am trying to create a demo on my local to prove that I can setup auto instrumentation of dotnet 8 web api using Serilog sink to send data to OTEL collector which in turn is forwarding Trace, Metrics and Logs data to elastic APM agent in fleet-server.

**The Problem is that the APM services doesn't show a service named - DotNetWebAPI in APM Services in Kibana.**

I have setup the ELK stack using this article - [https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose-part-2](https://www.elastic.co/blog/getting-started-with-the-elastic-stack-and-docker-compose-part-2)

# Version of Elastic products

STACK\_VERSION=8.8.2

I have loosely followed this article for dotnet 8 api, as it did not work with SSL, so i digressed a little, but the container is up and running and i can receive response from api endpoint in postman and can see the logs for it in the Kibana Logs Streams, but can't see the DotNetWebAPI in the APM services..

> **[Auto-instrumentation of .NET applications with OpenTelemetry — Elastic...](https://www.elastic.co/observability-labs/blog/auto-instrumentation-net-applications-opentelemetry)**
>
> OpenTelemetry provides an observability framework for cloud-native software, allowing us to trace, monitor, and debug applications seamlessly. In this post, we'll explore how to automatically instrument a .NET application using OpenTelemetry.

I have checked in my DotNetWebAPI code in this public repo - [GitHub - SunnyMittal/DotNetWebAPI](https://github.com/SunnyMittal/DotNetWebAPI/tree/master)

Elastic stack code is placed in this public repo -

> **[GitHub - SunnyMittal/ELK](https://github.com/SunnyMittal/ELK)**
>
> Contribute to SunnyMittal/ELK development by creating an account on GitHub.

Steps to reproduce the issue.

1. use any password to generate .net web api certs using below command **(use that password in ELK repo's .env file for variable - DOTNETWEBAPI\_CERT\_PASSWORD)**

```auto
dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p localDevNetCore

```

1. Build the docker image say using below command from DotNetWebAPI project folder  
`docker build . --progress plain -t "tb1"`
2. Standup ELK stack using below docker command from ELK folder  
`docker compose up -d`
3. Browse to this url to trigger the API and then check logs in Kibana Stream  
[https://localhost:32774/api/WeatherForecast](https://localhost:32774/api/WeatherForecast)

Let me know if you need any further info.  
Thanks in advance for your help!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/2/929d85bc2ef1af5eb40167742127a34180f2067e.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/1/41677aa611cd48cddb0edb08d68c823b728ca5cc.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 26, 2024, 5:56am UTC](https://discuss.elastic.co/t/dotnet-8-serilog-otel-apm/351957/2 "2024-02-26T05:56:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
