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

**URL:** <https://community.dynatrace.com/t/get-a-hold-of-process-group-instance-id-within-dotnet-code/37733>\
**Category:** Logs\
**Tags:** log-monitoring-class, oneagent, oneagent-sdk\
**Created:** [December 16, 2022, 3:42pm UTC](https://community.dynatrace.com/t/get-a-hold-of-process-group-instance-id-within-dotnet-code/37733 "2022-12-16T15:42:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [December 17, 2022, 7:27pm UTC](https://community.dynatrace.com/t/get-a-hold-of-process-group-instance-id-within-dotnet-code/37733/2 "2022-12-17T19:27:38Z")

</div>

Yes, using the [file open interface](https://www.dynatrace.com/support/help/shortlink/enrich-metrics#oneagent-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](https://github.com/Dynatrace/OneAgent-SDK-for-dotnet#tracecontext)&nbsp; or using [OpenTelemetry](https://www.dynatrace.com/support/help/shortlink/opent-dotnet).

---

_[View the full topic](https://community.dynatrace.com/t/get-a-hold-of-process-group-instance-id-within-dotnet-code/37733)._
