The following instructions explain how to deploy the .NET microservices agent for Splunk AppDynamics for Azure Service Fabric.
Before you Install
From nuget.org, download the NuGet package AppDynamics.Agent.Distrib.Micro.Windows
from https://www.nuget.org/packages/AppDynamics.Agent.Distrib.Micro.Windows/, then extract it to a folder. Then, use the following instructions to deploy the agent package.
Choose a procedure below to match your environment:
- Deploy the Package using Visual Studio
- Deploy the Package using another IDE
Deploy the Package using Visual Studio
- From your editor, open
ServiceManifest.xml
in each folder in the publishedapplication
root. Add the following environment variables in each
CodePackage
:<CodePackage ...> <EntryPoint> ... </EntryPoint> <EnvironmentVariables> <EnvironmentVariable Name="COR_ENABLE_PROFILING" Value="1" /> <EnvironmentVariable Name="COR_PROFILER" Value="{39AEABC1-56A5-405F-B8E7-C3668490DB4A}" /> <EnvironmentVariable Name="COR_PROFILER_PATH" Value="<PathToDeploymentFolder>/AppDynamics.Profiler_x64.dll" /> </EnvironmentVariables> </CodePackage>
Make a copy of the
AppDynamicsConfig.json
file and rename it to <executable_name>.AppDynamicsConfig.json.
For example, <servicefabricapplicationname
>.AppDynamicsConfig.json.
When you rename the
.json
file to the application name, do not include.exe
at the end of your application name.Copy
AppDynamics.Agent.dll
,AppDynamics.Profiler_x64.dll
,AppDynamicsAgentLog.config
,AppDynamicsConfig.json
from <nuget_package
>\content\AppDynamics
, then go to your Visual Studio solution "Solution Items" subfolder.Right-click on the Splunk AppDynamics related files and select Copy Always in Properties.
Update
<executable_name>.AppDynamicsConfig.json
with your configuration information:{ "controller": { "host":"", "port":0, "account":"", "password":"" }, "application": { "name":"" } }
Do not specify node; it will be assigned automatically; Specifying tier is optional, it could be assigned automatically.
The next steps are optional and should only be used if you need per service-instance control of the controller/application/tier.
Add the following environment variables to each CodePackage:
<EnvironmentVariable Name="appdynamics.controller.hostName" Value="< >" /> <EnvironmentVariable Name="appdynamics.controller.port" Value="< >" /> <EnvironmentVariable Name="appdynamics.agent.accountName" Value="< >" /> <EnvironmentVariable Name="appdynamics.agent.accountAccessKey" Value="< >" /> <EnvironmentVariable Name="appdynamics.agent.applicationName" Value="< >" /> <EnvironmentVariable Name="appdynamics_agent_tier_name" Value="< >" />
- Modify
ApplicationManifest.xml.
In eachServiceManifestImport
andCodePackage
folder add:In
ServiceManifestImport
:<EnvironmentOverrides CodePackageRef="Code"> <EnvironmentVariable Name="appdynamics.controller.hostName" Value="<AppD_ControllerHostName>" /> <EnvironmentVariable Name="appdynamics.controller.port" Value="<AppD_ControllerPort>" /> <EnvironmentVariable Name="appdynamics.agent.accountName" Value="<AppD_AccountName>" /> <EnvironmentVariable Name="appdynamics.agent.accountAccessKey" Value="<AppD_AccountAccessKey>" /> <EnvironmentVariable Name="appdynamics.agent.applicationName" Value="<AppD_ApplicationName>" /> <EnvironmentVariable Name="appdynamics_agent_tier_name" Value="<AppD_Service_Name_TierName>" /> </EnvironmentOverrides>
In
Parameters
:<Parameter Name="AppD_ControllerHostName" DefaultValue="<Your_Controller_Name>" /> <Parameter Name="AppD_ControllerPort" DefaultValue="<Your_Controller_Port>" /> <Parameter Name="AppD_AccountName" DefaultValue="<Your_Controller_Account_Name>" /> <Parameter Name="AppD_AccountAccessKey" DefaultValue="<Your_Controller_Access_Key>" /> <Parameter Name="AppD_ApplicationName" DefaultValue="<Your_Controller_App_Name>" />
- For each service:
<Parameter Name="AppD_%SERVICE_NAME%_TierName" DefaultValue="<Tier_Name_For_Service>" />
- If you need to provide the Splunk AppDynamics configuration during application package deployment, you can now do it using the -
ApplicationParameter
switch of theNew-ServiceFabricApplication cmdlet
.
Deploy the Package using another IDE
- From your editor, open
ServiceManifest.xml
in each folder in the published application root. Add the following environment variables in each CodePackage:
<CodePackage ...> <EntryPoint> ... </EntryPoint> <EnvironmentVariables> <EnvironmentVariable Name="COR_ENABLE_PROFILING" Value="1" /> <EnvironmentVariable Name="COR_PROFILER" Value="{39AEABC1-56A5-405F-B8E7-C3668490DB4A}" /> <EnvironmentVariable Name="COR_PROFILER_PATH" Value=AppDynamics/AppDynamics.Profiler_x64.dll" /> </EnvironmentVariables> </CodePackage>
Using PowerShell, unpack
AppDynamics.Agent.dll
,AppDynamics.Profiler_x64.dll
,AppDynamicsAgentLog.config
,AppDynamicsConfig.json
from<nuget_package>\content\AppDynamics
to the code package folder that contains the executable you want to run.Make a copy of the of the
AppDynamicsConfig.json
file and rename it to<executable_name>.AppDynamicsConfig.json
. For example,<servicefabricapplicationname>.AppDynamicsConfig.json
.When you rename the
.json
file to the application name, do not include .exe at the end of your application name.Update
<executable_name>.AppDynamicsConfig.json
with your configuration information:{ "controller": { "host":"", "port":0, "account":"", "password":"" }, "application": { "name":"" } }
Do not specify the node; it will be assigned automatically. Specifying the tier is optional; it could be assigned automatically.
The next steps are optional and should only be used if you need per service-instance control of the controller/application/tier.
Add the following environment variables to each CodePackage:
<EnvironmentVariable Name="appdynamics.controller.hostName" Value="" /> <EnvironmentVariable Name="appdynamics.controller.port" Value="" /> <EnvironmentVariable Name="appdynamics.agent.accountName" Value="" /> <EnvironmentVariable Name="appdynamics.agent.accountAccessKey" Value="" /> <EnvironmentVariable Name="appdynamics.agent.applicationName" Value="" /> <EnvironmentVariable Name="appdynamics_agent_tier_name" Value="" />
- Modify
ApplicationManifest.xml
. In eachServiceManifestImport
andCodePackage
folder add:In
ServiceManifestImport
:<EnvironmentOverrides CodePackageRef="Code"> <EnvironmentVariable Name="appdynamics.controller.hostName" Value="<AppD_ControllerHostName>" /> <EnvironmentVariable Name="appdynamics.controller.port" Value="<AppD_ControllerPort>" /> <EnvironmentVariable Name="appdynamics.agent.accountName" Value="<AppD_AccountName>" /> <EnvironmentVariable Name="appdynamics.agent.accountAccessKey" Value="<AppD_AccountAccessKey>" /> <EnvironmentVariable Name="appdynamics.agent.applicationName" Value="<AppD_ApplicationName>" /> <EnvironmentVariable Name="appdynamics_agent_tier_name" Value="<AppD_Service_Name_TierName>" /> </EnvironmentOverrides>
In
Parameters
:<Parameter Name="AppD_ControllerHostName" DefaultValue="<Your_Controller>" /> <Parameter Name="AppD_ControllerPort" DefaultValue="<Your_ControllerPORT>" /> <Parameter Name="AppD_AccountName" DefaultValue="<Your_Controller_AccountName>" /> <Parameter Name="AppD_AccountAccessKey" DefaultValue="<Your_Controller_AccessKey>" /> <Parameter Name="AppD_ApplicationName" DefaultValue="<Your_Controller_App_Name>" />
- For each service:
<Parameter Name="<AppD_Service_Name_TierName>" DefaultValue="<Tier_Name_For_Service>" />
- If you need to provide the Splunk AppDynamics configuration during application package deployment, you can now do it using the -
ApplicationParameter
switch of theNew-ServiceFabricApplication cmdlet
.