16 Dec 2022 03:42 PM
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.
Solved! Go to Solution.
17 Dec 2022 07:27 PM
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.
19 Dec 2022 08:52 AM
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 😉
19 Dec 2022 08:56 AM
Well, successfully reading a file that does not exist feels always strange 😁