1
0
Форкнуть 0
ASP.NET Core web applications monitoring
Перейти к файлу
kartang ddd4d47ea7 Adding and updating powershell scripts to build and test 2016-05-05 17:59:17 -07:00
keys Enable strong name signing 2015-11-04 21:58:45 -08:00
src/Microsoft.ApplicationInsights.AspNetCore Merge from master and the associated changes 2016-05-05 12:14:43 -07:00
test Merge from master and the associated changes 2016-05-05 12:14:43 -07:00
.gitattributes Update to RC2 along with the renaming of dependencies, Renaming To AspNetCore and Change the runtime to CLI 2016-03-17 13:21:03 -07:00
.gitignore Reverting back gitignore changes 2016-03-21 10:42:07 -07:00
ApplicationInsights.AspNetCore.sln Refining MVC application by removing additional files and contents 2016-04-22 16:06:41 -07:00
CleanPackages.ps1 Automated build and added ps script to clean dnx packages 2015-07-08 09:44:07 -07:00
Common.targets removed additional white spaces 2015-07-06 09:15:38 -07:00
LICENSE Initial commit 2015-03-17 12:39:40 -07:00
NuGet.config Updates to corefx build and the associated changes 2016-05-04 14:22:26 -07:00
Readme.md Fixing dnx versions 2016-04-29 09:28:51 -07:00
RunTests.ps1 Adding and updating powershell scripts to build and test 2016-05-05 17:59:17 -07:00
SetEnv.targets Addressed comments and refined the code 2015-07-06 09:00:56 -07:00
build.cmd Fixing tests availability in RC1, adding tests to make sure modules are working and refining some sections of the code 2016-01-28 16:26:24 -08:00
build.ps1 Adding and updating powershell scripts to build and test 2016-05-05 17:59:17 -07:00
dirs.proj Multiple Builds Based on Nuget Feed 2015-06-26 10:24:54 -07:00
global.json Adding server telemetry channel, enabling sampling (with default adaptive) and removing existing configure option to create config 2016-04-18 10:25:44 -07:00

Readme.md

Microsoft Application Insights for ASP.NET Core applications

This repository has a code for Application Insights monitoring of ASP.NET 5 applications. Read about contribution policies on Application Insights Home repository

Recent updates

We have upgraded ASP.NET Core SDK to use Windows Server Telemetry channel which enables Telemetry processors, filtering, sampling as well as Metrics Stream functionality. Please read more here.

Getting Started

Application Insights monitoring is a service that allows you to collect monitoring and diagnostics information about your application. Getting started guide shows how you can onboard your ASP.NET Core web application to use Application Insights SDK.

Application Insights collects lots of out-of-the-box information like requests, exceptions and usage. It also allows to configure additional data collection. Configure guide demonstrates the most common tasks you may want to do.

Repository structure

root\
    ApplicationInsights.AspNet.sln - Main Solution

    src\
        ApplicationInsights.AspNet - Application Insights package

    test\
        ApplicationInsights.AspNet.Tests - Unit tests
        FunctionalTestUtils - test utilities for functional tests
        Mvc6Framework45.FunctionalTests - functional tests for MVC application
        WebApiShimFw46.FunctionalTests - functional tests for Web API application
        PerfTest - performance test

Developing

Pre-requisites

git clone https://github.com/Microsoft/ApplicationInsights-aspnetcore.git

Building

From Visual Studio 2015

devenv ApplicationInsights.AspNet.sln

From Visual Studio 2015 Developer Command Prompt.

msbuild ApplicationInsights.AspNet.sln
  • If you get NPM package restore errors, make sure Node and NPM are added to PATH.
  • If you get Bower pacakge restore errors, make sure Git is added to PATH.
  • If you get Dnu package restore errors, make sure Dnx is installed or open the solution in Visual Studio 2015, which will take care of this.

Branches

Running and writing tests

There are two sets of tests unit tests and functional tests. Please use unit tests for all features testing. The purpose of functional tests is just end-to-end validation of functionality on sample applications.

Functional tests Functional tests are regular web applications with unit tests integrated into them. Application can be compiled as a regular web application as well as set of tests. Typical functional test will do the following:

  1. Host the current project in In-Proc server.
  2. Initialize application insights telemetry channel.
  3. Initiate request to self hosted web application using HttpClient.
  4. Check data received in telemetry channel.

Those are modifications made for regular web application to make it work this way:

Add dependencies to project.json:

"FunctionalTestUtils": "1.0.0-*",
"xunit.runner.dnx": "2.1.0-rc1-*",
"xunit": "2.1.0-rc1-*"

and test command:

"test": "xunit.runner.dnx"

Add this initialization logic to Startup.cs:

services.AddFunctionalTestTelemetryChannel();

Running Tests You can run unit tests using Visual Studio.

You can run unit tests using DNX from command line. Prerequisite to this is that you should make sure you have the exact versions of DNX runtimes. You can check the available runtimes in %userprofile%.dnx\runtimes folder (or using dnvm list in command prompt). They should be:

  • dnx-clr-win-x64.1.0.0-rc1-update2
  • dnx-clr-win-x86.1.0.0-rc1-update2
  • dnx-coreclr-win-x64.1.0.0-rc1-update2
  • dnx-coreclr-win-x86.1.0.0-rc1-update2

If you are seeing that dnx.exe is not available (or defined), use the following two commands to set the required DNX runtime to the user path:

dnvm alias default 1.0.0-rc1-update2 -r clr -arch x86
dnvm use default

After that you can open a developer command prompt, navigate to each test folder and run:

dnx test

You can also run all tests using the following Powershell from root directory. Prerequisite to this is that you should make sure to have exactly four DNX runtimes (in %userprofile%.dnx\runtimes folder):

powershell .\RunTests.ps1