Skip to content

Commit

Permalink
summary: Environment variable naming consistency (#2812)
Browse files Browse the repository at this point in the history
feat: Implement consistent naming scheme for all environment variables. All environment variables starting with (or containing) `NEWRELIC_` are now named `NEW_RELIC_`. Support for previous environment variables is retained, so this is not a breaking change. (#718) (#2812)

notice: Environment variables that start with or contain `NEWRELIC_` are deprecated and may be removed in a future major release. Users are encouraged to update their installation to use `NEW_RELIC_` names as soon as possible.
  • Loading branch information
tippmar-nr authored Oct 10, 2024
1 parent 25a9d30 commit b00edda
Show file tree
Hide file tree
Showing 68 changed files with 830 additions and 423 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_profiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:

env:
profiler_path: ${{ github.workspace }}/src/Agent/NewRelic/Profiler
CORECLR_NEWRELIC_HOME: ${{ github.workspace }}/src/Agent/NewRelic/newrelichome_x64_coreclr_linux # not used but required by Profiler/docker-compose.yml
CORECLR_NEW_RELIC_HOME: ${{ github.workspace }}/src/Agent/NewRelic/newrelichome_x64_coreclr_linux # not used but required by Profiler/docker-compose.yml

steps:
# intentionally disabled for this job, when enabled it causes a failure in the Build Linux Profiler step
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nuget_slack_notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
DOTTY_WEBHOOK: ${{ secrets.SLACK_NUGET_NOTIFICATIONS_WEBHOOK }}
DOTTY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CORECLR_ENABLE_PROFILING: 1
CORECLR_NEWRELIC_HOME: ${{ env.scan-tool-publish-path }}/newrelic
CORECLR_NEW_RELIC_HOME: ${{ env.scan-tool-publish-path }}/newrelic
CORECLR_PROFILER: "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"
CORECLR_PROFILER_PATH: ${{ env.scan-tool-publish-path }}/newrelic/libNewRelicProfiler.so
NEW_RELIC_APP_NAME: Dotty
Expand Down
2 changes: 1 addition & 1 deletion build/ArtifactBuilder/Artifacts/MsiInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MsiInstaller : Artifact
private readonly string[] _coreIISRegistryValues = new string[] {
"CORECLR_ENABLE_PROFILING=1",
"CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}",
"CORECLR_NEWRELIC_HOME=[NETAGENTCOMMONFOLDER]" };
"CORECLR_NEW_RELIC_HOME=[NETAGENTCOMMONFOLDER]" };

private readonly AgentComponents _frameworkAgentComponents;
private readonly AgentComponents _coreAgentComponents;
Expand Down
2 changes: 1 addition & 1 deletion build/Linux/build/common/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# This script can be used to run a dotnet application with New Relic monitoring.

CORECLR_NEWRELIC_HOME=${CORECLR_NEWRELIC_HOME:-/usr/local/newrelic-dotnet-agent} CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} CORECLR_PROFILER_PATH=$CORECLR_NEWRELIC_HOME/libNewRelicProfiler.so $@
CORECLR_NEW_RELIC_HOME=${CORECLR_NEW_RELIC_HOME:-/usr/local/newrelic-dotnet-agent} CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A} CORECLR_PROFILER_PATH=$CORECLR_NEW_RELIC_HOME/libNewRelicProfiler.so $@
6 changes: 3 additions & 3 deletions build/Linux/build/common/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

if [ -z "$CORECLR_NEWRELIC_HOME" ]; then
echo "CORECLR_NEWRELIC_HOME is undefined"
if [ -z "$CORECLR_NEW_RELIC_HOME" ]; then
echo "CORECLR_NEW_RELIC_HOME is undefined"
else
export CORECLR_ENABLE_PROFILING=1
export CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
export CORECLR_PROFILER_PATH=$CORECLR_NEWRELIC_HOME/libNewRelicProfiler.so
export CORECLR_PROFILER_PATH=$CORECLR_NEW_RELIC_HOME/libNewRelicProfiler.so
fi
4 changes: 2 additions & 2 deletions build/Linux/build/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ fi
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null

echo "export CORECLR_NEWRELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/${PACKAGE_NAME}-path.sh
echo "export CORECLR_NEW_RELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/${PACKAGE_NAME}-path.sh
source /etc/profile.d/${PACKAGE_NAME}-path.sh

chmod o+w $NEWRELIC_HOME/logs
chmod +x $NEWRELIC_HOME/*.sh 2> /dev/null

printf "Initialize the New Relic .NET Agent environment variables by running:\n"
printf "\t\033[1msource /etc/profile.d/${PACKAGE_NAME}-path.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEWRELIC_HOME/setenv.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEW_RELIC_HOME/setenv.sh\033[0m\n"
4 changes: 2 additions & 2 deletions build/Linux/build/rpm/newrelic-dotnet-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ fi
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.Instrumentation.xml 2> /dev/null
rm -f $NEWRELIC_HOME/extensions/NewRelic.Providers.Wrapper.Logging.dll 2> /dev/null

echo "export CORECLR_NEWRELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/%{name}-path.sh
echo "export CORECLR_NEW_RELIC_HOME=${NEWRELIC_HOME}" > /etc/profile.d/%{name}-path.sh
source /etc/profile.d/%{name}-path.sh

chmod o+w $NEWRELIC_HOME/logs
chmod +x $NEWRELIC_HOME/*.sh 2> /dev/null

printf "Initialize the New Relic .NET Agent environment variables by running:\n"
printf "\t\033[1msource /etc/profile.d/%{name}-path.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEWRELIC_HOME/setenv.sh\033[0m\n"
printf "\t\033[1msource $CORECLR_NEW_RELIC_HOME/setenv.sh\033[0m\n"
2 changes: 1 addition & 1 deletion build/Linux/test/scripts/custom_xml_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install_agent
verify_no_logs

dos2unix Instrumentation.xml &>/dev/null
cp Instrumentation.xml $CORECLR_NEWRELIC_HOME/extensions/
cp Instrumentation.xml $CORECLR_NEW_RELIC_HOME/extensions/
CORECLR_ENABLE_PROFILING=0 dotnet build
dotnet bin/Debug/net6.0/custom_xml.dll

Expand Down
4 changes: 2 additions & 2 deletions build/Linux/test/scripts/http_client_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ dos2unix /test/util.sh &>/dev/null && source /test/util.sh
print_header "HTTP Client Test"

install_agent_no_env
CORECLR_NEWRELIC_HOME=/usr/local/${PACKAGE_NAME}/
CORECLR_NEW_RELIC_HOME=/usr/local/${PACKAGE_NAME}/

verify_no_logs

$CORECLR_NEWRELIC_HOME/run.sh dotnet run
$CORECLR_NEW_RELIC_HOME/run.sh dotnet run

verify_logs_exist

Expand Down
2 changes: 1 addition & 1 deletion build/Linux/test/scripts/http_client_test_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install_tarball "/custom/install/path"

verify_no_logs

$CORECLR_NEWRELIC_HOME/run.sh dotnet run
$CORECLR_NEW_RELIC_HOME/run.sh dotnet run

verify_logs_exist

Expand Down
12 changes: 6 additions & 6 deletions build/Linux/test/scripts/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function install_tarball {
IS "$latest_tarball" =~ tar
tar xvfz "$latest_tarball"
popd
export CORECLR_NEWRELIC_HOME="${install_path}/${PACKAGE_NAME}"
echo "install_tarball CORECLR_NEWRELIC_HOME=${CORECLR_NEWRELIC_HOME}"
export CORECLR_NEW_RELIC_HOME="${install_path}/${PACKAGE_NAME}"
echo "install_tarball CORECLR_NEW_RELIC_HOME=${CORECLR_NEW_RELIC_HOME}"
source "${install_path}/${PACKAGE_NAME}/setenv.sh"
}

Expand Down Expand Up @@ -129,7 +129,7 @@ function bad {
}

function verify_no_logs {
log_dir="${CORECLR_NEWRELIC_HOME}/logs"
log_dir="${CORECLR_NEW_RELIC_HOME}/logs"
log_file_count=$(ls -A1 "$log_dir" |wc -l)
IS "$log_file_count" == 0
if [[ "$log_file_count" -gt 0 ]]; then
Expand All @@ -140,7 +140,7 @@ function verify_no_logs {
}

function verify_logs_exist {
log_dir="${CORECLR_NEWRELIC_HOME}/logs"
log_dir="${CORECLR_NEW_RELIC_HOME}/logs"
log_file_count=$(ls -A1 "$log_dir" |wc -l)
IS "$log_file_count" != 0
if [[ "$log_file_count" -gt 0 ]]; then
Expand All @@ -152,7 +152,7 @@ function verify_logs_exist {

function verify_agent_log_exists {
app_name="$1"
logfile_name="$CORECLR_NEWRELIC_HOME/logs/newrelic_agent_${app_name}.log"
logfile_name="$CORECLR_NEW_RELIC_HOME/logs/newrelic_agent_${app_name}.log"
OK -e "$logfile_name"
if [[ -e "$logfile_name" ]]; then
good "Verified agent log file $logfile_name was created"
Expand All @@ -162,7 +162,7 @@ function verify_agent_log_exists {
}

function verify_agent_log_grep {
count=$(grep "$1" ${CORECLR_NEWRELIC_HOME}/logs/* |wc -l)
count=$(grep "$1" ${CORECLR_NEW_RELIC_HOME}/logs/* |wc -l)
IS "$count" != 0
if [[ "$count" -gt 0 ]]; then
good "$1 was in the log files"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<add name="COR_PROFILER_PATH" value="%HOME%\NewRelicAgent\Framework\NewRelic.Profiler.dll" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="COR_PROFILER_PATH_32" value="%HOME%\NewRelicAgent\Framework\x86\NewRelic.Profiler.dll" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="COR_PROFILER_PATH_64" value="%HOME%\NewRelicAgent\Framework\NewRelic.Profiler.dll" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="NEWRELIC_HOME" value="%HOME%\NewRelicAgent\Framework" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="NEW_RELIC_HOME" value="%HOME%\NewRelicAgent\Framework" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="CORECLR_ENABLE_PROFILING" value="1" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="CORECLR_PROFILER" value="{36032161-FFC0-4B61-B559-F6C5D41BAE5A}" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="CORECLR_PROFILER_PATH_32" value="%HOME%\NewRelicAgent\Core\x86\NewRelic.Profiler.dll" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="CORECLR_PROFILER_PATH_64" value="%HOME%\NewRelicAgent\Core\NewRelic.Profiler.dll" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="CORECLR_NEWRELIC_HOME" value="%HOME%\NewRelicAgent\Core" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="CORECLR_NEW_RELIC_HOME" value="%HOME%\NewRelicAgent\Core" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
<add name="NEW_RELIC_METADATA_AZURE_APP_SERVICE_NAME" value="%WEBSITE_SITE_NAME%" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing"/>
</environmentVariables>
</runtime>
Expand Down
20 changes: 17 additions & 3 deletions build/Packaging/AzureSiteExtension/Content/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,26 @@ try
$is35App = CheckIfAppIs35
$agentVersion = ""

if ($env:NEWRELIC_AGENT_VERSION_OVERRIDE -ne $null)
if ($env:NEW_RELIC_AGENT_VERSION_OVERRIDE -ne $null)
{
try
{
$version = [System.Version]$env:NEW_RELIC_AGENT_VERSION_OVERRIDE.ToString()
$agentVersion = $version.ToString()
}
catch
{
WriteToInstallLog "NEW_RELIC_AGENT_VERSION_OVERRIDE environment variable has an incorrect Agent version number. Failed to install."
exit 1
}
}
elseif ($env:NEWRELIC_AGENT_VERSION_OVERRIDE -ne $null) # check for deprecated environment variable
{
try
{
$version = [System.Version]$env:NEWRELIC_AGENT_VERSION_OVERRIDE.ToString()
$agentVersion = $version.ToString()
WriteToInstallLog "NEWRELIC_AGENT_VERSION_OVERRIDE environment variable is deprecated and may be removed in a future release. Please use NEW_RELIC_AGENT_VERSION_OVERRIDE instead."
}
catch
{
Expand All @@ -306,7 +320,7 @@ try

if ($env:NEWRELIC_LICENSEKEY -eq $null -and $env:NEW_RELIC_LICENSE_KEY -eq $null)
{
WriteToInstallLog "The environment variable NEWRELIC_LICENSEKEY or NEW_RELIC_LICENSE_KEY must be set. Please make sure to add one."
WriteToInstallLog "The environment variable NEW_RELIC_LICENSE_KEY must be set. Please make sure to add it."
}

RemoveNewRelicInstallArtifacts "."
Expand All @@ -323,7 +337,7 @@ try
"/configuration/system.webServer/runtime/environmentVariables/add[@name='CORECLR_PROFILER']",
"/configuration/system.webServer/runtime/environmentVariables/add[@name='CORECLR_PROFILER_PATH_32']",
"/configuration/system.webServer/runtime/environmentVariables/add[@name='CORECLR_PROFILER_PATH_64']",
"/configuration/system.webServer/runtime/environmentVariables/add[@name='CORECLR_NEWRELIC_HOME']")
"/configuration/system.webServer/runtime/environmentVariables/add[@name='CORECLR_NEW_RELIC_HOME']")
$file = resolve-path(".\applicationHost.xdt")
RemoveXmlElements $file $xPaths
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ function update_azure_service_definition([System.__ComObject] $project){

#Helps Azure Workers find the newrelic.config
$variableNHNode = $xml.CreateElement('Variable','http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition')
$variableNHNode.SetAttribute('name','NEWRELIC_HOME')
$variableNHNode.SetAttribute('name','NEW_RELIC_HOME')
$variableNHNode.SetAttribute('value','D:\ProgramData\New Relic\.NET Agent\')

#Helps Azure Workers find the NewRelic.Agent.Core.dll
$variableNIPNode = $xml.CreateElement('Variable','http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition')
$variableNIPNode.SetAttribute('name','NEWRELIC_INSTALL_PATH')
$variableNIPNode.SetAttribute('name','NEW_RELIC_INSTALL_PATH')
$variableNIPNode.SetAttribute('value','D:\Program Files\New Relic\.NET Agent\')

$runtimeEnvironmentNode.AppendChild($variableCEPNode)
Expand Down Expand Up @@ -390,7 +390,7 @@ function cleanup_azure_service_definition([System.__ComObject] $project){

$runtimeNode = $modified.Runtime
if($runtimeNode -ne $null -and $runtimeNode.ChildNodes.Count -gt 0){
$variableNodes = $runtimeNode.Environment.Variable | where { $_.name -eq "COR_ENABLE_PROFILING" -or $_.name -eq "COR_PROFILER" -or $_.name -eq "NEWRELIC_HOME" -or $_.name -eq "NEWRELIC_INSTALL_PATH" }
$variableNodes = $runtimeNode.Environment.Variable | where { $_.name -eq "COR_ENABLE_PROFILING" -or $_.name -eq "COR_PROFILER" -or $_.name -eq "NEW_RELIC_HOME" -or $_.name -eq "NEW_RELIC_INSTALL_PATH" }
if($variableNodes -ne $null -and $variableNodes.Count -gt 0){
foreach($varNode in $variableNodes){
[Void]$varNode.ParentNode.RemoveChild($varNode)
Expand Down
4 changes: 2 additions & 2 deletions build/Packaging/NugetAzureWebSites-x64/tools/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Write-Host "---------------------------------------"
Write-Host "COR_ENABLE_PROFILING 1"
Write-Host "COR_PROFILER {71DA0A04-7777-4EC6-9643-7D28B46A8A41}"
Write-Host "COR_PROFILER_PATH D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll"
Write-Host "NEWRELIC_HOME D:\Home\site\wwwroot\newrelic"
Write-Host "NEWRELIC_LICENSEKEY [REPLACE WITH YOUR LICENSE KEY]"
Write-Host "NEW_RELIC_HOME D:\Home\site\wwwroot\newrelic"
Write-Host "NEW_RELIC_LICENSE_KEY [REPLACE WITH YOUR LICENSE KEY]"
4 changes: 2 additions & 2 deletions build/Packaging/NugetAzureWebSites-x86/tools/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Write-Host "---------------------------------------"
Write-Host "COR_ENABLE_PROFILING 1"
Write-Host "COR_PROFILER {71DA0A04-7777-4EC6-9643-7D28B46A8A41}"
Write-Host "COR_PROFILER_PATH D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll"
Write-Host "NEWRELIC_HOME D:\Home\site\wwwroot\newrelic"
Write-Host "NEWRELIC_LICENSEKEY [REPLACE WITH YOUR LICENSE KEY]"
Write-Host "NEW_RELIC_HOME D:\Home\site\wwwroot\newrelic"
Write-Host "NEW_RELIC_LICENSE_KEY [REPLACE WITH YOUR LICENSE KEY]"
16 changes: 8 additions & 8 deletions build/build_functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ function Set-SystemEnvironment {
[Environment]::SetEnvironmentVariable("COR_PROFILER", "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}", "Machine")
if($Architecture -like "All" -or $Architecture -like "x64") {
[Environment]::SetEnvironmentVariable("COR_PROFILER_PATH", "$HomePath\newrelichome_x64\NewRelic.Profiler.dll", "Machine")
[Environment]::SetEnvironmentVariable("NEWRELIC_HOME", "$HomePath\newrelichome_x64", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_HOME", "$HomePath\newrelichome_x64", "Machine")
}
else {
[Environment]::SetEnvironmentVariable("COR_PROFILER_PATH", "$HomePath\newrelichome_x86\NewRelic.Profiler.dll", "Machine")
[Environment]::SetEnvironmentVariable("NEWRELIC_HOME", "$HomePath\newrelichome_x86", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_HOME", "$HomePath\newrelichome_x86", "Machine")
}
}

Expand All @@ -227,11 +227,11 @@ function Set-SystemEnvironment {
[Environment]::SetEnvironmentVariable("CORECLR_PROFILER", "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}", "Machine")
if($Architecture -like "All" -or $Architecture -like "x64") {
[Environment]::SetEnvironmentVariable("CORECLR_PROFILER_PATH", "$HomePath\newrelichome_x64_coreclr\NewRelic.Profiler.dll", "Machine")
[Environment]::SetEnvironmentVariable("NEWRELIC_HOME", "$HomePath\newrelichome_x64", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_HOME", "$HomePath\newrelichome_x64", "Machine")
}
else {
[Environment]::SetEnvironmentVariable("CORECLR_PROFILER_PATH", "$HomePath\newrelichome_x86_coreclr\NewRelic.Profiler.dll", "Machine")
[Environment]::SetEnvironmentVariable("NEWRELIC_HOME", "$HomePath\newrelichome_x86", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_HOME", "$HomePath\newrelichome_x86", "Machine")
}
}
}
Expand All @@ -251,11 +251,11 @@ function Set-SessionEnvironment {
$env:COR_PROFILER = "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}"
if($Architecture -like "All" -or $Architecture -like "x64") {
$env:COR_PROFILER_PATH = "$HomePath\newrelichome_x64\NewRelic.Profiler.dll"
$env:NEWRELIC_HOME = "$HomePath\newrelichome_x64"
$env:NEW_RELIC_HOME = "$HomePath\newrelichome_x64"
}
else {
$env:COR_PROFILER_PATH = "$HomePath\newrelichome_x86\NewRelic.Profiler.dll"
$env:NEWRELIC_HOME = "$HomePath\newrelichome_x86"
$env:NEW_RELIC_HOME = "$HomePath\newrelichome_x86"
}
}

Expand All @@ -264,11 +264,11 @@ function Set-SessionEnvironment {
$env:CORECLR_PROFILER = "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"
if($Architecture -like "All" -or $Architecture -like "x64") {
$env:CORECLR_PROFILER_PATH = "$HomePath\newrelichome_x64_coreclr\NewRelic.Profiler.dll"
$env:NEWRELIC_HOME = "$HomePath\newrelichome_x64"
$env:NEW_RELIC_HOME = "$HomePath\newrelichome_x64"
}
else {
$env:CORECLR_PROFILER_PATH = "$HomePath\newrelichome_x86_coreclr\NewRelic.Profiler.dll"
$env:NEWRELIC_HOME = "$HomePath\newrelichome_x86"
$env:NEW_RELIC_HOME = "$HomePath\newrelichome_x86"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions build/setupDotnetAgentDevelopmentEnvVars.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ $pathToDotnetAgentRepo = "C:\workspace\dotnet_agent"
[Environment]::SetEnvironmentVariable("COR_ENABLE_PROFILING", "1", "Machine")
[Environment]::SetEnvironmentVariable("COR_PROFILER", "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}", "Machine")
[Environment]::SetEnvironmentVariable("COR_PROFILER_PATH", "$pathToDotnetAgentRepo\Agent\New Relic Home x64\NewRelic.Profiler.dll", "Machine")
[Environment]::SetEnvironmentVariable("NEWRELIC_HOME", "$pathToDotnetAgentRepo\Agent\New Relic Home x64", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_HOME", "$pathToDotnetAgentRepo\Agent\New Relic Home x64", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_HOST", "staging-collector.newrelic.com", "Machine")
[Environment]::SetEnvironmentVariable("NEW_RELIC_LICENSE_KEY", "b25fd3ca20fe323a9a7c4a092e48d62dc64cc61d", "Machine")
# .NET Core Stuff
[Environment]::SetEnvironmentVariable("CORECLR_ENABLE_PROFILING", "1", "Machine")
[Environment]::SetEnvironmentVariable("CORECLR_PROFILER", "{71DA0A04-7777-4EC6-9643-7D28B46A8A41}", "Machine")
[Environment]::SetEnvironmentVariable("CORECLR_PROFILER_PATH", "$pathToDotnetAgentRepo\Agent\New Relic Home x64 CoreClr\NewRelic.Profiler.dll", "Machine")
[Environment]::SetEnvironmentVariable("CORECLR_NEWRELIC_HOME", "$pathToDotnetAgentRepo\Agent\New Relic Home x64 CoreClr", "Machine")
[Environment]::SetEnvironmentVariable("CORECLR_NEW_RELIC_HOME", "$pathToDotnetAgentRepo\Agent\New Relic Home x64 CoreClr", "Machine")
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You need to configure the following environment variables for the agent to attac
#### Environment variables for .NET Framework
```bash
NEW_RELIC_LICENSE_KEY=<your New Relic license key>
NEWRELIC_HOME=path\to\home\directory
NEW_RELIC_HOME=path\to\home\directory
COR_ENABLE_PROFILING=1
COR_PROFILER={71DA0A04-7777-4EC6-9643-7D28B46A8A41}
COR_PROFILER_PATH=path\to\home\directory\NewRelic.Profiler.dll
Expand All @@ -43,7 +43,7 @@ COR_PROFILER_PATH=path\to\home\directory\NewRelic.Profiler.dll
#### Environment variables for .NET Core
```bash
NEW_RELIC_LICENSE_KEY=<your New Relic license key>
CORECLR_NEWRELIC_HOME=path\to\home\directory
CORECLR_NEW_RELIC_HOME=path\to\home\directory
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
CORECLR_PROFILER_PATH=path\to\home\directory\NewRelic.Profiler.dll
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/Miscellaneous/azure-app-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ An example of this configuration inside a `.csproj` file looks something like:
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={36032161-FFC0-4B61-B559-F6C5D41BAE5A}
CORECLR_PROFILER_PATH=D:\Home\site\wwwroot\newrelic\NewRelic.Profiler.dll
CORECLR_NEWRELIC_HOME=D:\Home\site\wwwroot\newrelic
CORECLR_NEW_RELIC_HOME=D:\Home\site\wwwroot\newrelic
```
Note: environment variables for Azure App Services are set in the `Application settings` configuration page for your app, under `App settings`. You can verify the environment variables for your app by browsing to the `Environment` tab of your app's Kudu diagnostic console and then jumping to the `Environment Variables` section, e.g. `https://myappname.scm.azurewebsites.net/Env.cshtml#envVariables`

Expand Down
Loading

0 comments on commit b00edda

Please sign in to comment.