# How to set environment for dotnet APM

**URL:** <https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [August 25, 2019, 10:25pm UTC](https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678 "2019-08-25T22:25:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Gilligan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_gilligan/32/46494_2.png) [@Chris\_Gilligan](https://discuss.elastic.co/u/Chris_Gilligan)\
**Post date:** [August 25, 2019, 10:25pm UTC](https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678/1 "2019-08-25T22:25:18Z")

</div>

Using the dotnet APM lib how do you set the environment for an application? I noticed the environment shows up as unknown in Kibana and i would like to put our actual environment names there so all our lower environments can use the same APM server etc.

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [August 26, 2019, 2:33am UTC](https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678/2 "2019-08-26T02:33:46Z")

</div>

Hi @Chris_Gilligan,

I would like to make sure we are on the same page - by

> the environment shows up as unknown in Kibana

do you refer to "Not defined" in drop down on the screen shot below?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/8/586d857dd7962d0ffb265acef4d04bfa9fd6e27b.png)

if so we do have PR in progress to allow configuring environment - [add environment property to service class by vhatsura · Pull Request #413 · elastic/apm-agent-dotnet · GitHub](https://github.com/elastic/apm-agent-dotnet/pull/413). I assume it would be merged quite soon.

Regarding

> so all our lower environments can use the same APM server etc.

I'm not sure I understand how environment is related to using the same APM server. Could you clarify that please?

---

<div class="post-metadata">

**Author:** ![Chris\_Gilligan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_gilligan/32/46494_2.png) [@Chris\_Gilligan](https://discuss.elastic.co/u/Chris_Gilligan)\
**Post date:** [August 26, 2019, 3:11am UTC](https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678/3 "2019-08-26T03:11:56Z")

</div>

Hi @Sergey_Kleyman,  
yes that is what i meant by environment. Sorry i was not in front of it at the time to get the correct message.

> [@Sergey\_Kleyman](#):
>
> > so all our lower environments can use the same APM server etc.
> 
> I'm not sure I understand how environment is related to using the same APM server. Could you clarify that please?

Basically we 3+ environments (dev, QA, sandbox, prod) etc that runs copies of our apps. I was hoping to use the same Elastic APM stack/servers for all the lower environments and then be able to filter to the correct APM information in Kibana using that environment drop down on the UI.

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [August 26, 2019, 3:25am UTC](https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678/4 "2019-08-26T03:25:52Z")

</div>

> I was hoping to use the same Elastic APM stack/servers for all the lower environments and then be able to filter to the correct APM information in Kibana using that environment drop down on the UI.

I see. Yes, it will work.

If you would like to get notification when this feature is implemented you can subscribe to [the PR](https://github.com/elastic/apm-agent-dotnet/pull/413) or [the issue](https://github.com/elastic/apm-agent-dotnet/issues/320) which the PR is intended to resolve.

---

<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:** [September 15, 2019, 11:25pm UTC](https://discuss.elastic.co/t/how-to-set-environment-for-dotnet-apm/196678/5 "2019-09-15T23:25:53Z")

</div>

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