Skip to content

Dotnet with OpenTelemetry + OpenObserve - 1 Web + 2 API

Notifications You must be signed in to change notification settings

geffzhang/dotnet-otlp-openobserve

 
 

Repository files navigation

dotnet-otlp-openobserve

Dotnet with OpenTelemetry + OpenObserve - 1 Web + 2 API , A sample code showing how to instrument three asp.net core 7 microservices for distributed tracing and metrics with OTLP and OpenObserve. The local OTLP spans are collected by the OpenTelemetry collector, and exported to OpenObserve collector exporter over HTTP. Serilog Sink for OpenObserve is an extension that integrates Serilog, a favored logging library for .NET applications, with OpenObserve. Crafted by Konrad Kaminski-Pawlak, the sink allows for effortless logging to OpenObserve, thereby enhancing the ability to store, analyze, and manage logs. See Serilog Sink for OpenObserve

Requirenments

Docker with OpenObserve See https://openobserve.ai/docs/quickstart/#openobserve-cloud

Run with

mkdir data
docker run -v $PWD/data:/data -e ZO_DATA_DIR="/data" -p 5080:5080 \
    -e ZO_ROOT_USER_EMAIL="[email protected]" -e ZO_ROOT_USER_PASSWORD="Complexpass#123" \
    public.ecr.aws/zinclabs/openobserve:latest

Start Notes

The first try the Kibana didn't start with the user - kibana_system Had to change the password "changeme" of "kibana_system"

docker-compose exec elasticsearch bin/elasticsearch-reset-password --batch --user kibana_system

Then copy the new pass to .env

Testing with ElasticSearch - AppSearch

To enable the management experience for Enterprise Search, modify the Kibana configuration file in [kibana/config/kibana.yml][config-kbn] and add the following setting:

enterpriseSearch.host: http://enterprise-search:3002

Project dotnet

Set multiple Start Visual Studio - Web, Api1, Api2 Will start the https profile configs

Configurations

  • ApiApplication1 (calls api2)
  "Api2Url": "https://localhost:7132",
  "elk-apm-server": "http://localhost:8200"
  • ApiApplication2 (standalone)
  "elk-apm-server": "http://localhost:8200"
  • WebApplication1 (calls api1 & api2)
  "elk-apm-server": "http://localhost:8200",

  "Api1Url": "https://localhost:7199",
  "Api2Url": "https://localhost:7132"

DEMO

ServiceMap

ServiceMap .

Trace Timeline

trace-timeline

Discover

discover.

DEMO Log Exception

Trace Timeline

trace-timeline

Observability To Discover

Observability To Discover.

ElasticSearch - API

Create Index (API)

Elasticsearch-Index-API

Add Documents via API (curl, postman...)

AddDocuments

Browse Documents

BrowseDocuments

.NET ElasticSearchClient - Search by index

DotNetSearch

About

Dotnet with OpenTelemetry + OpenObserve - 1 Web + 2 API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 61.2%
  • HTML 19.5%
  • Dockerfile 12.6%
  • CSS 4.6%
  • Batchfile 1.3%
  • JavaScript 0.8%