cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get a hold of process-group-instance-id within dotnet code

Is it possible to get a hold of the current process-group-instance-id from within dotnet code itself. We want to add it to some log-to-db system as a field. In a later stage the logs are processed by LogStash and pushed to Dynatrace LM2.0.

The flow already works but with the ID we could link it to the correct entity and management zone.

3 REPLIES 3

Julius_Loman
DynaMight Legend
DynaMight Legend

Yes, using the file open interface you are able to retrieve the process group instance ID and host ID as soon as there is OneAgent running on the host. Also if you want the trace id / span id, you can fetch them using either using OneAgent SDK for .NET  or using OpenTelemetry.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Thanks Julius. Exactly what I was looking for. I saw it in OTEL context already and it's strange looking code but it works indeed 😉

Well, successfully reading a file that does not exist feels always strange 😁

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts