Skip to content

Commit

Permalink
Added support for more CUSTOM backends recognition
Browse files Browse the repository at this point in the history
Fixed excessive number of hyperlinks corrupting large reports
Added all components of Snapshot report
  • Loading branch information
danielodievich committed Sep 30, 2017
1 parent cdf2e8c commit 82dec2e
Show file tree
Hide file tree
Showing 54 changed files with 5,090 additions and 2,124 deletions.
86 changes: 47 additions & 39 deletions AppDynamics.Dexter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,45 +98,53 @@
<Compile Include="Program.cs" />
<Compile Include="DataObjects\ProgramOptions\ProgramOptions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReportObjects\Segment.cs" />
<Compile Include="ReportObjects\Snapshot.cs" />
<Compile Include="ReportObjects\EventReportMaps\HealthRuleViolationEventReportMap.cs" />
<Compile Include="ReportObjects\HealthRuleViolationEvent.cs" />
<Compile Include="ReportObjects\Event.cs" />
<Compile Include="ReportObjects\ActivityFlow.cs" />
<Compile Include="ReportObjects\ActivityFlowReportMaps\ActivityFlowReportMap.cs" />
<Compile Include="ReportObjects\EventReportMaps\EventReportMap.cs" />
<Compile Include="ReportObjects\MetricSummary.cs" />
<Compile Include="ReportObjects\MetricReportMaps\MetricSummaryMetricReportMap.cs" />
<Compile Include="ReportObjects\MetricReportMaps\ErrorMetricReportMap.cs" />
<Compile Include="ReportObjects\MetricReportMaps\ServiceEndpointMetricReportMap.cs" />
<Compile Include="ReportObjects\MetricReportMaps\BusinessTransactionMetricReportMap.cs" />
<Compile Include="ReportObjects\EntityBase.cs" />
<Compile Include="ReportObjects\MetricEnums.cs" />
<Compile Include="ReportObjects\MetricReportMaps\MetricValueMetricReportMap.cs" />
<Compile Include="ReportObjects\MetricValue.cs" />
<Compile Include="ReportObjects\MetricReportMaps\BackendMetricReportMap.cs" />
<Compile Include="ReportObjects\MetricReportMaps\NodeMetricReportMap.cs" />
<Compile Include="ReportObjects\MetricReportMaps\TierMetricReportMap.cs" />
<Compile Include="ReportObjects\EntityBusinessTransaction.cs" />
<Compile Include="ReportObjects\EntityNode.cs" />
<Compile Include="ReportObjects\EntityReportMaps\BusinessTransactionEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityReportMaps\NodeEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityBackend.cs" />
<Compile Include="ReportObjects\EntityReportMaps\BackendEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityServiceEndpoint.cs" />
<Compile Include="ReportObjects\EntityReportMaps\ServiceEndpointEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityError.cs" />
<Compile Include="ReportObjects\EntityReportMaps\ErrorEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityReportMaps\TierEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityTier.cs" />
<Compile Include="ReportObjects\EntityApplication.cs" />
<Compile Include="ReportObjects\EntityReportMaps\ApplicationEntityReportMap.cs" />
<Compile Include="ReportObjects\EntityController.cs" />
<Compile Include="ReportObjects\EntityReportMaps\ControllerEntityReportMap.cs" />
<Compile Include="ReportObjects\MetricReportMaps\ApplicationMetricReportMap.cs" />
<Compile Include="ReportObjects\SnapshotReportMaps\SegmentReportMap.cs" />
<Compile Include="ReportObjects\SnapshotReportMaps\SnapshotReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\Maps\BusinessDataReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\BusinessData.cs" />
<Compile Include="ReportObjects\Snapshot\ExitCall.cs" />
<Compile Include="ReportObjects\Snapshot\Maps\DetectedErrorReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\Maps\ServiceEndpointCallReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\Maps\ExitCallReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\Segment.cs" />
<Compile Include="ReportObjects\Snapshot\DetectedError.cs" />
<Compile Include="ReportObjects\Snapshot\ServiceEndpointCall.cs" />
<Compile Include="ReportObjects\Snapshot\Snapshot.cs" />
<Compile Include="ReportObjects\Event\Maps\HealthRuleViolationEventReportMap.cs" />
<Compile Include="ReportObjects\Event\HealthRuleViolationEvent.cs" />
<Compile Include="ReportObjects\Event\Event.cs" />
<Compile Include="ReportObjects\ActivityFlow\ActivityFlow.cs" />
<Compile Include="ReportObjects\ActivityFlow\Maps\ActivityFlowReportMap.cs" />
<Compile Include="ReportObjects\Event\Maps\EventReportMap.cs" />
<Compile Include="ReportObjects\Metric\MetricSummary.cs" />
<Compile Include="ReportObjects\Metric\Maps\MetricSummaryMetricReportMap.cs" />
<Compile Include="ReportObjects\Metric\Maps\ErrorMetricReportMap.cs" />
<Compile Include="ReportObjects\Metric\Maps\ServiceEndpointMetricReportMap.cs" />
<Compile Include="ReportObjects\Metric\Maps\BusinessTransactionMetricReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityBase.cs" />
<Compile Include="ReportObjects\Metric\MetricEnums.cs" />
<Compile Include="ReportObjects\Metric\Maps\MetricValueMetricReportMap.cs" />
<Compile Include="ReportObjects\Metric\MetricValue.cs" />
<Compile Include="ReportObjects\Metric\Maps\BackendMetricReportMap.cs" />
<Compile Include="ReportObjects\Metric\Maps\NodeMetricReportMap.cs" />
<Compile Include="ReportObjects\Metric\Maps\TierMetricReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityBusinessTransaction.cs" />
<Compile Include="ReportObjects\Entity\EntityNode.cs" />
<Compile Include="ReportObjects\Entity\Maps\BusinessTransactionEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\Maps\NodeEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityBackend.cs" />
<Compile Include="ReportObjects\Entity\Maps\BackendEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityServiceEndpoint.cs" />
<Compile Include="ReportObjects\Entity\Maps\ServiceEndpointEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityError.cs" />
<Compile Include="ReportObjects\Entity\Maps\ErrorEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\Maps\TierEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityTier.cs" />
<Compile Include="ReportObjects\Entity\EntityApplication.cs" />
<Compile Include="ReportObjects\Entity\Maps\ApplicationEntityReportMap.cs" />
<Compile Include="ReportObjects\Entity\EntityController.cs" />
<Compile Include="ReportObjects\Entity\Maps\ControllerEntityReportMap.cs" />
<Compile Include="ReportObjects\Metric\Maps\ApplicationMetricReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\Maps\SegmentReportMap.cs" />
<Compile Include="ReportObjects\Snapshot\Maps\SnapshotReportMap.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
11 changes: 9 additions & 2 deletions ControllerApi/ControllerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Reflection;

namespace AppDynamics.Dexter
{
Expand Down Expand Up @@ -48,7 +49,8 @@ public ControllerApi(string controllerURL, string userName, string userPassword)
httpClient.Timeout = new TimeSpan(0, 3, 0);
httpClient.BaseAddress = new Uri(this.ControllerUrl);
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", this.UserName, this.Password))));

httpClient.DefaultRequestHeaders.Add("x-requested-by", String.Format("AppDynamics DEXTER {0}", Assembly.GetEntryAssembly().GetName().Version));

// If customer controller certificates are not in trusted store, let's not fail
ServicePointManager.ServerCertificateValidationCallback += ignoreBadCertificates;
// If customer controller is still leveraging old TLS or SSL3 protocols, enable that
Expand Down Expand Up @@ -148,6 +150,11 @@ public string GetListOfBackends(int applicationID)
return this.GetListOfBackends(applicationID.ToString());
}

public string GetListOfBackendsAdditionalDetail(int applicationID)
{
return this.apiGET(String.Format("controller/restui/backendUiService/backendListViewData/{0}/false?time-range=last_15_minutes.BEFORE_NOW.-1.-1.15", applicationID), "application/json", true);
}

public string GetListOfServiceEndpoints(string applicationName)
{
return this.apiGET(String.Format("controller/rest/applications/{0}/metric-data?metric-path=Service Endpoints|*|*|Calls per Minute&time-range-type=BEFORE_NOW&duration-in-mins=15&output=JSON", applicationName), "application/json", false);
Expand All @@ -168,7 +175,7 @@ public string GetListOfServiceEndpointsInTier(int applicationID, string tierName
return this.GetListOfServiceEndpointsInTier(applicationID.ToString(), tierName);
}

public string GetListOfServiceEndpointsWithDetail(int applicationID)
public string GetListOfServiceEndpointsAdditionalDetail(int applicationID)
{
return this.apiGET(String.Format("controller/restui/serviceEndpoint/list2/{0}/{0}/APPLICATION?time-range=last_15_minutes.BEFORE_NOW.-1.-1.15", applicationID), "application/json", true);
}
Expand Down
4 changes: 2 additions & 2 deletions DataObjects/JobConfiguration/JobStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public enum JobStatus
ReportControllerAndApplicationConfiguration = 22,
ReportEventsAndHealthRuleViolations = 23,
ReportApplicationAndEntityMetrics = 24,
ReportIndividualApplicationAndEntityDetails = 25,
ReportSnapshots = 26,
ReportSnapshots = 25,
ReportIndividualApplicationAndEntityDetails = 26,
ReportFlameGraphs = 27,

Done = 30,
Expand Down
2 changes: 1 addition & 1 deletion Helpers/AESEncryptionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static string Decrypt(string cipherText)
}
catch (FormatException ex)
{
if (ex.Message == "Invalid length for a Base-64 char array or string.")
if (ex.Message == "Invalid length for a Base-64 char array or string." || ex.Message.StartsWith("The input is not a valid Base-64 string"))
{
// This is plaintext
return cipherText;
Expand Down
8 changes: 4 additions & 4 deletions JobFiles/DefaultJob.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"Input": {
"TimeRange" : {
"From": "2017-06-26T18:00:00",
"To": "2017-06-26T19:59:00"
"From": "2017-10-01T18:00:00",
"To": "2017-10-02T19:00:00"
},
"Flowmaps": true,
"Metrics": true,
"Snapshots": true,
"Configuration": true,
"Events": true
"Events": true,
"Configuration": true
},
"Target": [
{
Expand Down
7 changes: 2 additions & 5 deletions NLog.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>

<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<target name="mainLog" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard">
<target name="mainLog1" xsi:type="File" fileName="logs/AppDynamics.Dexter.Main.${shortdate}.log" keepFileOpen="true" openFileCacheTimeout="30" autoFlush="false" layout="${longdate}|${level}|${processname}|${processid}|${threadid}|${logger}|${message}"/>
<target name="mainLog1" xsi:type="File" fileName="logs/AppDynamics.Dexter.Main.${shortdate}.log" keepFileOpen="true" openFileCacheTimeout="30" autoFlush="false" archiveAboveSize="52428800" archiveFileName="logs/AppDynamics.Dexter.Main.${shortdate}.{#####}.log" layout="${longdate}|${level}|${processname}|${processid}|${threadid}|${logger}|${message}"/>
</target>
<target name="controllerApiLog" xsi:type="AsyncWrapper" queueLimit="5000" overflowAction="Discard">
<target name="controllerApiLog1" xsi:type="File" fileName="logs/AppDynamics.Dexter.Controller.${shortdate}.log" keepFileOpen="true" openFileCacheTimeout="30" autoFlush="false" layout="${longdate}|${level}|${processname}|${processid}|${threadid}|${logger}|${message}"/>
<target name="controllerApiLog1" xsi:type="File" fileName="logs/AppDynamics.Dexter.Controller.${shortdate}.log" keepFileOpen="true" openFileCacheTimeout="30" autoFlush="false" archiveAboveSize="52428800" archiveFileName="logs/AppDynamics.Dexter.Controller.${shortdate}.{#####}.log" layout="${longdate}|${level}|${processname}|${processid}|${threadid}|${logger}|${message}"/>
</target>
<target name="consoleLog" xsi:type="File" fileName="logs/AppDynamics.Dexter.Console.${shortdate}.log" keepFileOpen="true" openFileCacheTimeout="30" autoFlush="true" layout="${longdate}|${level}|${processname}|${processid}|${threadid}|${logger}|${message}"/>
<target name="console" xsi:type="ColoredConsole" layout="${message}" />
Expand All @@ -31,7 +29,6 @@
<logger name="AppDynamics.Dexter.Program" minlevel="Trace" writeTo="mainLog" final="true" />
<logger name="AppDynamics.Dexter.PrepareJob" minlevel="Trace" writeTo="mainLog" final="true" />
<logger name="AppDynamics.Dexter.ProcessJob" minlevel="Trace" writeTo="mainLog" final="true" />
<logger name="xxxxxxxAppDynamics.Dexter.JobConfigurationHelper" minlevel="Trace" writeTo="mainLog" final="true" />
<logger name="AppDynamics.Dexter.FileIOHelper" minlevel="Trace" writeTo="mainLog" final="true" />
-->
<logger name="AppDynamics.Dexter.ControllerApi" minlevel="Trace" writeTo="controllerApiLog" final="true" />
Expand Down
Loading

0 comments on commit 82dec2e

Please sign in to comment.