<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to define tags based on environment variables for clusters in Open Q&amp;A</title>
    <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222606#M28430</link>
    <description>&lt;P&gt;&lt;SPAN&gt;To set an environment variable using PowerShell and make it persistent (available even after a system reboot), you can use the following command:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Environment]::SetEnvironmentVariable("VARIABLE_NAME", "VARIABLE_VALUE",[System.EnvironmentVariableTarget]::Machine)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VARIABLE_NAME is the name of the environment variable you want to set.&lt;/LI&gt;&lt;LI&gt;VARIABLE_VALUE is the value you want to assign to this variable.&lt;/LI&gt;&lt;LI&gt;[System.EnvironmentVariableTarget]::Machine means that the variable will be set as a machine variable, which means it will be available to all users on that computer and will be persistent.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://shellgeek.com/set-environment-variable-using-powershell/" target="_blank"&gt;https://shellgeek.com/set-environment-variable-using-powershell/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See if this works:)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Radek&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Sep 2023 12:36:57 GMT</pubDate>
    <dc:creator>radek_jasinski</dc:creator>
    <dc:date>2023-09-08T12:36:57Z</dc:date>
    <item>
      <title>How to define tags based on environment variables for clusters?</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222563#M28426</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;We've defined&amp;nbsp;tags based on environment variables for the MS SQL Server instances.&lt;/P&gt;
&lt;P&gt;It works fine on standalone instances, but it doesn't work for instances on cluster.&lt;/P&gt;
&lt;P&gt;The "Environment" variable is already used by the cluster configuration.&amp;nbsp;The manual setup done for the Dynatrace's tag (&lt;STRONG&gt;DT_CUSTOM_PROP= and&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;DT_TAGS=&lt;/STRONG&gt;) disapears after the restart of MSSQL service.&lt;/P&gt;
&lt;P&gt;I followed the instructions on the page :&amp;nbsp;&lt;A href="https://www.dynatrace.com/support/help/manage/tags-and-metadata/setup/define-tags-based-on-environment-variables#expand--how-to-define-an-environment-variable-for-windows--2" target="_blank" rel="noopener"&gt;https://www.dynatrace.com/support/help/manage/tags-and-metadata/setup/define-tags-based-on-environment-variables#expand--how-to-define-an-environment-variable-for-windows--2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Do you know how to setup the variables for &lt;SPAN&gt;SQL server&amp;nbsp;&lt;/SPAN&gt;clusters ?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Renata&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 08:43:01 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222563#M28426</guid>
      <dc:creator>renatarc</dc:creator>
      <dc:date>2023-09-11T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to define tags based on environment variables for clusters</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222571#M28428</link>
      <description>&lt;P&gt;Hi Renata,&lt;/P&gt;&lt;P&gt;I understand that you have correctly added variables to the registry on all servers in the cluster where you have MS SQL?&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dynatrace.com/support/help/shortlink/process-group-properties#variables" target="_blank"&gt;https://www.dynatrace.com/support/help/shortlink/process-group-properties#variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Don't you sometimes have a mechanism in the organization that verifies the configuration of servers and, if changes are detected, restores the original one.&lt;/P&gt;&lt;P&gt;Radek&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 10:07:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222571#M28428</guid>
      <dc:creator>radek_jasinski</dc:creator>
      <dc:date>2023-09-08T10:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to define tags based on environment variables for clusters</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222605#M28429</link>
      <description>&lt;P&gt;Hi Radek&lt;/P&gt;&lt;P&gt;There is any in-house script to restore the original values of the variables.&lt;/P&gt;&lt;P&gt;This configuration of the variables might be at the Cluster Manager level (quorum), but I don't know where/how to setup them.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Renata&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 12:25:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222605#M28429</guid>
      <dc:creator>renatarc</dc:creator>
      <dc:date>2023-09-08T12:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to define tags based on environment variables for clusters</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222606#M28430</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To set an environment variable using PowerShell and make it persistent (available even after a system reboot), you can use the following command:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Environment]::SetEnvironmentVariable("VARIABLE_NAME", "VARIABLE_VALUE",[System.EnvironmentVariableTarget]::Machine)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;VARIABLE_NAME is the name of the environment variable you want to set.&lt;/LI&gt;&lt;LI&gt;VARIABLE_VALUE is the value you want to assign to this variable.&lt;/LI&gt;&lt;LI&gt;[System.EnvironmentVariableTarget]::Machine means that the variable will be set as a machine variable, which means it will be available to all users on that computer and will be persistent.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://shellgeek.com/set-environment-variable-using-powershell/" target="_blank"&gt;https://shellgeek.com/set-environment-variable-using-powershell/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See if this works:)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Radek&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 12:36:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222606#M28430</guid>
      <dc:creator>radek_jasinski</dc:creator>
      <dc:date>2023-09-08T12:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to define tags based on environment variables for clusters</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222607#M28431</link>
      <description>&lt;P&gt;Thanks for your inputs.&lt;/P&gt;&lt;P&gt;I need to have the "tag" on Dynatrace only in the processes and Process Groups related to the MS SQL Server Service.&amp;nbsp;&lt;SPAN&gt;That's why on Windows, it has to be set in the registry of Service and not as a System Variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I set the variable in the system, the server and all the processes will be tagged in Dynatrace with this variable - this is not the goal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The documentation Dynatrace (&lt;A href="https://www.dynatrace.com/support/help/manage/tags-and-metadata/setup/define-tags-based-on-environment-variables?_ga=2.93742751.304844845.1694159519-927780096.1691067861&amp;amp;_gl=1*wowg3i*_ga*OTI3NzgwMDk2LjE2OTEwNjc4NjE.*_ga_1MEMV02JXV*MTY5NDE3MTYwMy4yMS4xLjE2OTQxNzcwMDEuMC4wLjA.#expand--how-to-define-an-environment-variable-for-windows--2" target="_blank" rel="noopener"&gt;Define tags based on environment variables&lt;/A&gt;&amp;nbsp;) says :&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;SPAN&gt;Applying&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" title="Find out how to define and apply tags manually and automatically." href="https://www.dynatrace.com/support/help/manage/tags-and-metadata/setup/how-to-define-tags" target="_blank" rel="noopener"&gt;tags&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;to hosts (instead of thoughtfully setting up environment variables as explained here) isn't recommended. The same applies to applications and processes. For details on setting up the&amp;nbsp;&lt;/SPAN&gt;DT_CUSTOM_PROP&lt;SPAN&gt;&amp;nbsp;environment variable for Tomcat or WebSphere application metadata, Kubernetes annotations for Kubernetes-based deployments, or AWS tagging, see&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" title="Learn when it's recommended to use tags that leverage auto-detected metadata, as well as best practices for enriching Dynatrace monitoring with additional metadata." href="https://www.dynatrace.com/support/help/manage/tags-and-metadata/basic-concepts/best-practices-and-recommendations-for-tagging#application-metadata-and-tagging" target="_blank" rel="noopener"&gt;Application metadata &amp;amp; tagging&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 12:52:05 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222607#M28431</guid>
      <dc:creator>renatarc</dc:creator>
      <dc:date>2023-09-08T12:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to define tags based on environment variables for clusters</title>
      <link>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222700#M28455</link>
      <description>&lt;P&gt;If you want to set a permanent variable for a specific process or group of processes in windows then you can do it this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can use PowerShell to create or modify environment variables in the Windows Registry.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Define permanent environment variables for different process groups&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;$RegistryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Group A Variables&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;$GroupA_Variable1 = "ValueA1"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;$GroupA_Variable2 = "ValueA2"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Group B Variables&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;$GroupB_Variable1 = "ValueB1"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;$GroupB_Variable2 = "ValueB2"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Set Group A Variables&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set-ItemProperty -Path $RegistryPath -Name "GroupA_Variable1" -Value $GroupA_Variable1&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set-ItemProperty -Path $RegistryPath -Name "GroupA_Variable2" -Value $GroupA_Variable2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;# Set Group B Variables&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set-ItemProperty -Path $RegistryPath -Name "GroupB_Variable1" -Value $GroupB_Variable1&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set-ItemProperty -Path $RegistryPath -Name "GroupB_Variable2" -Value $GroupB_Variable2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the above example, you set permanent environment variables for different process groups (&lt;/SPAN&gt;GroupA_Variable1&lt;SPAN&gt;, &lt;/SPAN&gt;GroupA_Variable2&lt;SPAN&gt;, &lt;/SPAN&gt;GroupB_Variable1&lt;SPAN&gt;, and &lt;/SPAN&gt;GroupB_Variable2&lt;SPAN&gt;) in the Windows Registry under &lt;/SPAN&gt;HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment&lt;SPAN&gt;. These variables will persist and be available to all processes system-wide.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After setting permanent environment variables, you may need to restart or refresh processes (such as Explorer or PowerShell sessions) for them to recognize the new variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Radek&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 07:31:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Open-Q-A/How-to-define-tags-based-on-environment-variables-for-clusters/m-p/222700#M28455</guid>
      <dc:creator>radek_jasinski</dc:creator>
      <dc:date>2023-09-11T07:31:52Z</dc:date>
    </item>
  </channel>
</rss>

