18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
22 |
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/Views/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
33 |
41 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using AppInsightsProfilerExample
2 | @using AppInsightsProfilerExample.Models
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning",
5 | "ServiceProfiler":"Information"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
2 | for details on configuring this project to bundle and minify static web assets. */
3 | body {
4 | padding-top: 50px;
5 | padding-bottom: 20px;
6 | }
7 |
8 | /* Wrapping element */
9 | /* Set some basic padding to keep content from hitting the edges */
10 | .body-content {
11 | padding-left: 15px;
12 | padding-right: 15px;
13 | }
14 |
15 | /* Carousel */
16 | .carousel-caption p {
17 | font-size: 20px;
18 | line-height: 1.4;
19 | }
20 |
21 | /* Make .svg files in the carousel display properly in older browsers */
22 | .carousel-inner .item img[src$=".svg"] {
23 | width: 100%;
24 | }
25 |
26 | /* QR code generator */
27 | #qrCode {
28 | margin: 15px;
29 | }
30 |
31 | /* Hide/rearrange for smaller screens */
32 | @media screen and (max-width: 767px) {
33 | /* Hide captions */
34 | .carousel-caption {
35 | display: none;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerCLR2_1/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerCLR2_1/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap",
3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
4 | "keywords": [
5 | "css",
6 | "js",
7 | "less",
8 | "mobile-first",
9 | "responsive",
10 | "front-end",
11 | "framework",
12 | "web"
13 | ],
14 | "homepage": "http://getbootstrap.com",
15 | "license": "MIT",
16 | "moduleType": "globals",
17 | "main": [
18 | "less/bootstrap.less",
19 | "dist/js/bootstrap.js"
20 | ],
21 | "ignore": [
22 | "/.*",
23 | "_config.yml",
24 | "CNAME",
25 | "composer.json",
26 | "CONTRIBUTING.md",
27 | "docs",
28 | "js/tests",
29 | "test-infra"
30 | ],
31 | "dependencies": {
32 | "jquery": "1.9.1 - 3"
33 | },
34 | "version": "3.3.7",
35 | "_release": "3.3.7",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.3.7",
39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
40 | },
41 | "_source": "https://github.com/twbs/bootstrap.git",
42 | "_target": "v3.3.7",
43 | "_originalSource": "bootstrap",
44 | "_direct": true
45 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2016 Twitter, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/bootstrap/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/jquery-validation-unobtrusive/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation-unobtrusive",
3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
4 | "version": "3.2.9",
5 | "_release": "3.2.9",
6 | "_resolution": {
7 | "type": "version",
8 | "tag": "v3.2.9",
9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396"
10 | },
11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git",
12 | "_target": "^3.2.9",
13 | "_originalSource": "jquery-validation-unobtrusive",
14 | "_direct": true
15 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .NET Foundation. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/jquery-validation/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation",
3 | "homepage": "https://jqueryvalidation.org/",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/jquery-validation/jquery-validation.git"
7 | },
8 | "authors": [
9 | "Jörn Zaefferer "
10 | ],
11 | "description": "Form validation made easy",
12 | "main": "dist/jquery.validate.js",
13 | "keywords": [
14 | "forms",
15 | "validation",
16 | "validate"
17 | ],
18 | "license": "MIT",
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "test",
24 | "demo",
25 | "lib"
26 | ],
27 | "dependencies": {
28 | "jquery": ">= 1.7.2"
29 | },
30 | "version": "1.17.0",
31 | "_release": "1.17.0",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "1.17.0",
35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772"
36 | },
37 | "_source": "https://github.com/jzaefferer/jquery-validation.git",
38 | "_target": "^1.17.0",
39 | "_originalSource": "jquery-validation",
40 | "_direct": true
41 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/jquery/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "main": "dist/jquery.js",
4 | "license": "MIT",
5 | "ignore": [
6 | "package.json"
7 | ],
8 | "keywords": [
9 | "jquery",
10 | "javascript",
11 | "browser",
12 | "library"
13 | ],
14 | "homepage": "https://github.com/jquery/jquery-dist",
15 | "version": "3.3.1",
16 | "_release": "3.3.1",
17 | "_resolution": {
18 | "type": "version",
19 | "tag": "3.3.1",
20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e"
21 | },
22 | "_source": "https://github.com/jquery/jquery-dist.git",
23 | "_target": "^3.3.1",
24 | "_originalSource": "jquery",
25 | "_direct": true
26 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerCLR2_1/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright JS Foundation and other contributors, https://js.foundation/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/Dockerfile:
--------------------------------------------------------------------------------
1 | #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 |
3 | FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated6.0 AS base
4 | WORKDIR /home/site/wwwroot
5 | EXPOSE 80
6 |
7 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
8 | WORKDIR /src
9 | COPY ["EnableServiceProfilerForAzureFunction/SampleFunctionApp.csproj", "SampleFunctionApp/"]
10 | RUN dotnet restore "SampleFunctionApp/SampleFunctionApp.csproj"
11 | COPY . .
12 | WORKDIR "/src/SampleFunctionApp"
13 | RUN dotnet publish "SampleFunctionApp.csproj" -c Release -o /app/publish /p:UseAppHost=false
14 |
15 | FROM base AS final
16 | WORKDIR /home/site/wwwroot
17 | COPY --from=publish /app/publish .
18 | ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
19 | AzureFunctionsJobHost__Logging__Console__IsEnabled=true
20 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/Program.cs:
--------------------------------------------------------------------------------
1 | // -----------------------------------------------------------------------------
2 | // Copyright (c) Microsoft Corporation. All rights reserved.
3 | // -----------------------------------------------------------------------------
4 |
5 | using Microsoft.Extensions.Configuration;
6 | using Microsoft.Extensions.DependencyInjection;
7 | using Microsoft.Extensions.Hosting;
8 | using Microsoft.Extensions.Logging;
9 | using Microsoft.Azure.Functions.Worker;
10 |
11 | var host = new HostBuilder()
12 | .ConfigureLogging((ctx, logging) =>
13 | {
14 | logging.AddConfiguration(ctx.Configuration.GetSection("Logging"));
15 | logging.AddSimpleConsole(logging =>
16 | {
17 | logging.SingleLine = true;
18 | logging.UseUtcTimestamp = true;
19 | logging.TimestampFormat = "yyyy-MM-ddTHH:mm:ss.fffZ";
20 | });
21 | })
22 | .ConfigureServices((context, services) =>
23 | {
24 | services.AddApplicationInsightsTelemetryWorkerService();
25 | services.AddServiceProfiler(p =>
26 | {
27 | p.Duration = TimeSpan.FromSeconds(30);
28 | });
29 | services.ConfigureFunctionsApplicationInsights();
30 | })
31 | .ConfigureAppConfiguration((context, config) =>
32 | {
33 | config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
34 | })
35 | .ConfigureFunctionsWorkerDefaults()
36 | .Build();
37 |
38 | host.Run();
39 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "SampleFunctionApp": {
4 | "commandName": "Project",
5 | "commandLineArgs": "--port 7237"
6 | },
7 | "Docker": {
8 | "commandName": "Docker",
9 | "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
10 | "httpPort": 34880,
11 | "useSSL": false
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/Readme.md:
--------------------------------------------------------------------------------
1 | # Application Insights Profiler for Azure Function Example
2 |
3 | This folder contains an example of Application Insights Profiler running in an Azure Function of [isolated worker model](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide).
4 |
5 |
6 | ## Create an Azure Function
7 | Follow [this tutorial](https://learn.microsoft.com/en-us/azure/azure-functions/functions-get-started?pivots=programming-language-csharp#create-your-first-function) to create an Azure Function.
8 |
9 | Optionally, you can add a [DockerFile](./Dockerfile) to run your Azure Function in a container.
10 | See this [tutorial](../EnableServiceProfilerForContainerAppNet6/Readme.md#dockerize-the-application-above) for more details on how to dockerize your Azure Function.
11 |
12 | ## Create an Application Insights resource
13 |
14 | Follow the [Create an Application Insights resource](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-create-new-resource). Note down the [instrumentation key](https://docs.microsoft.com/en-us/azure/application-insights/app-insights-create-new-resource#copy-the-instrumentation-key).
15 |
16 | ## Add Application Insights Profiler to your Azure Function
17 | If you are building an Azure Function in **Isolated Worker Mode**, please refer to [this readme](../ServiceProfilerInWorkerNet6/) for further guidance on code instrumentation.
18 |
19 | Otherwise, you can refer to [this readme](../../README.md#get-started) for guidance on setting up Profiler in ASP.NET Core applications.
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/SampleFunctionApp.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.ApplicationInsights;
2 | using Microsoft.ApplicationInsights.DataContracts;
3 | using Microsoft.Azure.Functions.Worker;
4 | using Microsoft.Extensions.Logging;
5 |
6 | namespace FunctionApp1
7 | {
8 | public class SampleFunctionApp
9 | {
10 | private readonly ILogger _logger;
11 | private readonly TelemetryClient _telemetryClient;
12 |
13 | public SampleFunctionApp(ILoggerFactory loggerFactory, TelemetryClient telemetryClient)
14 | {
15 | _logger = loggerFactory.CreateLogger();
16 | _telemetryClient = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));
17 | }
18 |
19 | [Function("SampleFunctionApp")]
20 | public void Run([TimerTrigger("*/30 * * * * *", RunOnStartup = true)] TimerInfo myTimer)
21 | {
22 | _logger.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
23 |
24 | using (_telemetryClient.StartOperation("operation"))
25 | {
26 | if (myTimer.ScheduleStatus is not null)
27 | {
28 | _logger.LogInformation($"Next timer schedule at: {myTimer.ScheduleStatus.Next}");
29 | }
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/SampleFunctionApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net6.0
4 | v4
5 | Exe
6 | enable
7 | enable
8 | /home/site/wwwroot
9 | Linux
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | PreserveNewest
24 |
25 |
26 | PreserveNewest
27 |
28 |
29 | PreserveNewest
30 | Never
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "ApplicationInsights":
10 | {
11 | "InstrumentationKey": "your-instrumentatoin-key"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/dockerignore:
--------------------------------------------------------------------------------
1 | **/.classpath
2 | **/.dockerignore
3 | **/.env
4 | **/.git
5 | **/.gitignore
6 | **/.project
7 | **/.settings
8 | **/.toolstarget
9 | **/.vs
10 | **/.vscode
11 | **/*.*proj.user
12 | **/*.dbmdl
13 | **/*.jfm
14 | **/azds.yaml
15 | **/bin
16 | **/charts
17 | **/docker-compose*
18 | **/Dockerfile*
19 | **/node_modules
20 | **/npm-debug.log
21 | **/obj
22 | **/secrets.dev.yaml
23 | **/values.dev.yaml
24 | LICENSE
25 | README.md
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForAzureFunction/host.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0",
3 | "logging": {
4 | "applicationInsights": {
5 | "samplingSettings": {
6 | "isEnabled": true,
7 | "excludedTypes": "Request"
8 | },
9 | "enableLiveMetricsFilters": true
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/.dockerignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | using Microsoft.AspNetCore.Mvc;
8 | using EnableServiceProfilerForContainerApp.Models;
9 |
10 | namespace EnableServiceProfilerForContainerApp.Controllers
11 | {
12 | public class HomeController : Controller
13 | {
14 | public IActionResult Index()
15 | {
16 | SimulateDelay();
17 | return View();
18 | }
19 |
20 | public IActionResult About()
21 | {
22 | SimulateDelay();
23 | ViewData["Message"] = "Your application description page.";
24 | Thread.Sleep(2000);
25 | return View();
26 | }
27 |
28 | public IActionResult Contact()
29 | {
30 | SimulateDelay();
31 | ViewData["Message"] = "Your contact page.";
32 | return View();
33 | }
34 |
35 | public IActionResult Error()
36 | {
37 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
38 | }
39 |
40 |
41 | private void SimulateDelay()
42 | {
43 | // Delay for 500ms to 2s to simulate a bottleneck.
44 | Thread.Sleep((new Random()).Next(500, 2000));
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build-env
2 | WORKDIR /app
3 |
4 | # Copy everything and build
5 | COPY . ./
6 |
7 | # Adding a reference to hosting startup package
8 | RUN dotnet add package Microsoft.ApplicationInsights.Profiler.AspNetCore -v 2.*
9 |
10 | # Restore & publish the app
11 | RUN dotnet publish -c Release -o out
12 |
13 | # Build runtime image
14 | FROM mcr.microsoft.com/dotnet/aspnet:3.1
15 |
16 | # Create an argument to allow docker builder to passing in application insights conneection string.
17 | # For example: docker build . --build-arg APPINSIGHTS_CONN=YOUR_APPLICATIONINSIGHTS_CONNECTION_STRING
18 | ARG APPINSIGHTS_CONN
19 | # Making sure the argument is set. Fail the build of the container otherwise.
20 | RUN test -n "$APPINSIGHTS_CONN"
21 |
22 | # Light up Application Insights and Service Profiler
23 | ENV APPLICATIONINSIGHTS_CONNECTION_STRING=$APPINSIGHTS_CONN
24 | ENV ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.Profiler.AspNetCore
25 |
26 | WORKDIR /app
27 | COPY --from=build-env /app/out .
28 | ENTRYPOINT ["dotnet", "EnableServiceProfilerForContainerApp.dll"]
29 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/EnableServiceProfilerForContainerApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Models/ErrorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace EnableServiceProfilerForContainerApp.Models
4 | {
5 | public class ErrorViewModel
6 | {
7 | public string RequestId { get; set; }
8 |
9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
10 | }
11 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace EnableServiceProfilerForContainerApp
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | BuildWebHost(args).Run();
18 | }
19 |
20 | public static IWebHost BuildWebHost(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseStartup()
23 | .Build();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.Extensions.Configuration;
8 | using Microsoft.Extensions.DependencyInjection;
9 |
10 | namespace EnableServiceProfilerForContainerApp
11 | {
12 | public class Startup
13 | {
14 | public Startup(IConfiguration configuration)
15 | {
16 | Configuration = configuration;
17 | }
18 |
19 | public IConfiguration Configuration { get; }
20 |
21 | // This method gets called by the runtime. Use this method to add services to the container.
22 | public void ConfigureServices(IServiceCollection services)
23 | {
24 | services.AddMvc();
25 | }
26 |
27 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
28 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
29 | {
30 | if (env.IsDevelopment())
31 | {
32 | app.UseDeveloperExceptionPage();
33 | }
34 | else
35 | {
36 | app.UseExceptionHandler("/Home/Error");
37 | }
38 |
39 | app.UseStaticFiles();
40 |
41 | app.UseMvc(routes =>
42 | {
43 | routes.MapRoute(
44 | name: "default",
45 | template: "{controller=Home}/{action=Index}/{id?}");
46 | });
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
22 |
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using EnableServiceProfilerForContainerApp
2 | @using EnableServiceProfilerForContainerApp.Models
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning",
6 | "ServiceProfiler":"Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/bundleconfig.json:
--------------------------------------------------------------------------------
1 | // Configure bundling and minification for the project.
2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241
3 | [
4 | {
5 | "outputFileName": "wwwroot/css/site.min.css",
6 | // An array of relative input file paths. Globbing patterns supported
7 | "inputFiles": [
8 | "wwwroot/css/site.css"
9 | ]
10 | },
11 | {
12 | "outputFileName": "wwwroot/js/site.min.js",
13 | "inputFiles": [
14 | "wwwroot/js/site.js"
15 | ],
16 | // Optionally specify minification options
17 | "minify": {
18 | "enabled": true,
19 | "renameLocals": true
20 | },
21 | // Optionally generate .map file
22 | "sourceMap": false
23 | }
24 | ]
25 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Wrapping element */
7 | /* Set some basic padding to keep content from hitting the edges */
8 | .body-content {
9 | padding-left: 15px;
10 | padding-right: 15px;
11 | }
12 |
13 | /* Carousel */
14 | .carousel-caption p {
15 | font-size: 20px;
16 | line-height: 1.4;
17 | }
18 |
19 | /* Make .svg files in the carousel display properly in older browsers */
20 | .carousel-inner .item img[src$=".svg"] {
21 | width: 100%;
22 | }
23 |
24 | /* QR code generator */
25 | #qrCode {
26 | margin: 15px;
27 | }
28 |
29 | /* Hide/rearrange for smaller screens */
30 | @media screen and (max-width: 767px) {
31 | /* Hide captions */
32 | .carousel-caption {
33 | display: none;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerApp/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Write your JavaScript code.
2 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerApp/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap",
3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
4 | "keywords": [
5 | "css",
6 | "js",
7 | "less",
8 | "mobile-first",
9 | "responsive",
10 | "front-end",
11 | "framework",
12 | "web"
13 | ],
14 | "homepage": "http://getbootstrap.com",
15 | "license": "MIT",
16 | "moduleType": "globals",
17 | "main": [
18 | "less/bootstrap.less",
19 | "dist/js/bootstrap.js"
20 | ],
21 | "ignore": [
22 | "/.*",
23 | "_config.yml",
24 | "CNAME",
25 | "composer.json",
26 | "CONTRIBUTING.md",
27 | "docs",
28 | "js/tests",
29 | "test-infra"
30 | ],
31 | "dependencies": {
32 | "jquery": "1.9.1 - 3"
33 | },
34 | "version": "3.3.7",
35 | "_release": "3.3.7",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.3.7",
39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
40 | },
41 | "_source": "https://github.com/twbs/bootstrap.git",
42 | "_target": "v3.3.7",
43 | "_originalSource": "bootstrap",
44 | "_direct": true
45 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2016 Twitter, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/bootstrap/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/jquery-validation-unobtrusive/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation-unobtrusive",
3 | "version": "3.2.6",
4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.",
6 | "main": [
7 | "jquery.validate.unobtrusive.js"
8 | ],
9 | "ignore": [
10 | "**/.*",
11 | "*.json",
12 | "*.md",
13 | "*.txt",
14 | "gulpfile.js"
15 | ],
16 | "keywords": [
17 | "jquery",
18 | "asp.net",
19 | "mvc",
20 | "validation",
21 | "unobtrusive"
22 | ],
23 | "authors": [
24 | "Microsoft"
25 | ],
26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm",
27 | "repository": {
28 | "type": "git",
29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git"
30 | },
31 | "dependencies": {
32 | "jquery-validation": ">=1.8",
33 | "jquery": ">=1.8"
34 | },
35 | "_release": "3.2.6",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.2.6",
39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7"
40 | },
41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git",
42 | "_target": "3.2.6",
43 | "_originalSource": "jquery-validation-unobtrusive"
44 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/jquery-validation/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation",
3 | "homepage": "http://jqueryvalidation.org/",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/jzaefferer/jquery-validation.git"
7 | },
8 | "authors": [
9 | "Jörn Zaefferer "
10 | ],
11 | "description": "Form validation made easy",
12 | "main": "dist/jquery.validate.js",
13 | "keywords": [
14 | "forms",
15 | "validation",
16 | "validate"
17 | ],
18 | "license": "MIT",
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "test",
24 | "demo",
25 | "lib"
26 | ],
27 | "dependencies": {
28 | "jquery": ">= 1.7.2"
29 | },
30 | "version": "1.14.0",
31 | "_release": "1.14.0",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "1.14.0",
35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48"
36 | },
37 | "_source": "git://github.com/jzaefferer/jquery-validation.git",
38 | "_target": ">=1.8",
39 | "_originalSource": "jquery-validation"
40 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/jquery/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "main": "dist/jquery.js",
4 | "license": "MIT",
5 | "ignore": [
6 | "package.json"
7 | ],
8 | "keywords": [
9 | "jquery",
10 | "javascript",
11 | "browser",
12 | "library"
13 | ],
14 | "homepage": "https://github.com/jquery/jquery-dist",
15 | "version": "2.2.0",
16 | "_release": "2.2.0",
17 | "_resolution": {
18 | "type": "version",
19 | "tag": "2.2.0",
20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5"
21 | },
22 | "_source": "git://github.com/jquery/jquery-dist.git",
23 | "_target": "2.2.0",
24 | "_originalSource": "jquery"
25 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerApp/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright jQuery Foundation and other contributors, https://jquery.org/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/.dockerignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace EnableServiceProfilerForContainerAppNet6.Controllers;
4 |
5 | [ApiController]
6 | [Route("[controller]")]
7 | public class WeatherForecastController : ControllerBase
8 | {
9 | private static readonly string[] Summaries = new[]
10 | {
11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12 | };
13 |
14 | private readonly ILogger _logger;
15 |
16 | public WeatherForecastController(ILogger logger)
17 | {
18 | _logger = logger;
19 | }
20 |
21 | [HttpGet(Name = "GetWeatherForecast")]
22 | public IEnumerable Get()
23 | {
24 | SimulateDelay();
25 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
26 | {
27 | Date = DateTime.Now.AddDays(index),
28 | TemperatureC = Random.Shared.Next(-20, 55),
29 | Summary = Summaries[Random.Shared.Next(Summaries.Length)]
30 | })
31 | .ToArray();
32 | }
33 |
34 | private void SimulateDelay()
35 | {
36 | // Delay for 500ms to 2s to simulate a bottleneck.
37 | Thread.Sleep((new Random()).Next(500, 2000));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/EnableServiceProfilerForContainerAppNet6.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/Program.cs:
--------------------------------------------------------------------------------
1 | using EnableServiceProfilerForContainerAppNet6;
2 | using Microsoft.ApplicationInsights.Extensibility;
3 |
4 | var builder = WebApplication.CreateBuilder(args);
5 |
6 | // Add services to the container.
7 | builder.Services.AddSingleton();
8 | builder.Services.AddApplicationInsightsTelemetry();
9 | builder.Services.AddServiceProfiler(profilerSettings =>
10 | {
11 | profilerSettings.Duration = TimeSpan.FromMinutes(1);
12 | });
13 |
14 | builder.Services.AddControllers();
15 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
16 | builder.Services.AddEndpointsApiExplorer();
17 | builder.Services.AddSwaggerGen();
18 |
19 | var app = builder.Build();
20 |
21 | // Configure the HTTP request pipeline.
22 | if (app.Environment.IsDevelopment())
23 | {
24 | app.UseSwagger();
25 | app.UseSwaggerUI();
26 | }
27 |
28 | app.UseHttpsRedirection();
29 |
30 | app.UseAuthorization();
31 |
32 | app.MapControllers();
33 |
34 | app.Run();
35 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/RoleInstanceTelemetryInitializer.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.ApplicationInsights.Channel;
2 | using Microsoft.ApplicationInsights.Extensibility;
3 |
4 | namespace EnableServiceProfilerForContainerAppNet6;
5 |
6 | public class RoleInstanceTelemetryInitializer : ITelemetryInitializer
7 | {
8 | public void Initialize(ITelemetry telemetry)
9 | {
10 | string? computerName = Environment.GetEnvironmentVariable("COMPUTERNAME");
11 | if (string.IsNullOrEmpty(computerName))
12 | {
13 | return;
14 | }
15 | telemetry.Context.Cloud.RoleInstance = computerName;
16 | }
17 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | namespace EnableServiceProfilerForContainerAppNet6;
2 |
3 | public class WeatherForecast
4 | {
5 | public DateTime Date { get; set; }
6 |
7 | public int TemperatureC { get; set; }
8 |
9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10 |
11 | public string? Summary { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "ApplicationInsights":
10 | {
11 | "InstrumentationKey": "your-instrumentatoin-key"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 | WORKDIR /app
3 |
4 | # Copy csproj and restore as distinct layers
5 | COPY *.csproj ./
6 | RUN dotnet restore
7 |
8 | # Copy everything else and build
9 | COPY * ./
10 | RUN dotnet publish -c Release -o out
11 |
12 | # Build runtime image
13 | FROM mcr.microsoft.com/dotnet/aspnet:6.0
14 | WORKDIR /app
15 | COPY --from=build-env /app/out .
16 | ENTRYPOINT ["dotnet", "EnableServiceProfilerForContainerAppNet6.dll"]
17 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/images/Profiler_MachineInstance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerAppNet6/images/Profiler_MachineInstance.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerForContainerAppNet6/images/kudu_env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerForContainerAppNet6/images/kudu_env.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/AddApplicationInsights.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/AddApplicationInsights.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/AddNuGetPackageOfServiceProfiler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/AddNuGetPackageOfServiceProfiler.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/ApplicationInsightsConfigured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/ApplicationInsightsConfigured.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/CreateAppService.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/CreateAppService.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/DockerSupport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/DockerSupport.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/PublishTarget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/PublishTarget.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/ServiceProfilerLogInVSOutput.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/ServiceProfilerLogInVSOutput.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/SetEnvInPortal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/SetEnvInPortal.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/.media/performance-blade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/.media/performance-blade.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/.dockerignore:
--------------------------------------------------------------------------------
1 | .dockerignore
2 | .env
3 | .git
4 | .gitignore
5 | .vs
6 | .vscode
7 | docker-compose.yml
8 | docker-compose.*.yml
9 | */bin
10 | */obj
11 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27428.2011
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnableSPInVS", "EnableSPInVS\EnableSPInVS.csproj", "{A24E5A76-43AC-4305-8A04-E86C5D8D1CC1}"
7 | EndProject
8 | Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{BD39E430-1256-41D8-A264-5ECFF6971154}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {A24E5A76-43AC-4305-8A04-E86C5D8D1CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {A24E5A76-43AC-4305-8A04-E86C5D8D1CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {A24E5A76-43AC-4305-8A04-E86C5D8D1CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {A24E5A76-43AC-4305-8A04-E86C5D8D1CC1}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {BD39E430-1256-41D8-A264-5ECFF6971154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {BD39E430-1256-41D8-A264-5ECFF6971154}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {BD39E430-1256-41D8-A264-5ECFF6971154}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {BD39E430-1256-41D8-A264-5ECFF6971154}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {79F2F05D-7C69-4FEC-AC2F-DD9CB4382E9F}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Connected Services/Application Insights/ConnectedService.json:
--------------------------------------------------------------------------------
1 | {
2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
3 | "Version": "8.11.10212.1",
4 | "GettingStartedDocument": {
5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=798432"
6 | }
7 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Mvc;
7 | using EnableSPInVS.Models;
8 |
9 | namespace EnableSPInVS.Controllers
10 | {
11 | public class HomeController : Controller
12 | {
13 | public IActionResult Index()
14 | {
15 | return View();
16 | }
17 |
18 | public IActionResult About()
19 | {
20 | ViewData["Message"] = "Your application description page.";
21 |
22 | return View();
23 | }
24 |
25 | public IActionResult Contact()
26 | {
27 | ViewData["Message"] = "Your contact page.";
28 |
29 | return View();
30 | }
31 |
32 | public IActionResult Error()
33 | {
34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/aspnetcore:2.0 AS base
2 | WORKDIR /app
3 | EXPOSE 80
4 |
5 | FROM microsoft/aspnetcore-build:2.0 AS build
6 | WORKDIR /src
7 | COPY EnableSPInVS.sln ./
8 | COPY EnableSPInVS/EnableSPInVS.csproj EnableSPInVS/
9 | RUN dotnet restore -nowarn:msb3202,nu1503
10 | COPY . .
11 | WORKDIR /src/EnableSPInVS
12 | RUN dotnet build -c Release -o /app
13 |
14 | FROM build AS publish
15 | RUN dotnet publish -c Release -o /app
16 |
17 | FROM base AS final
18 | WORKDIR /app
19 | COPY --from=publish /app .
20 | ENTRYPOINT ["dotnet", "EnableSPInVS.dll"]
21 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/EnableSPInVS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.0
5 | ..\docker-compose.dcproj
6 | /subscriptions/e8ea4e2c-5bc5-46a9-ac97-3dc3462bab38/resourcegroups/EnableSPInVS/providers/microsoft.insights/components/EnableSPInVS
7 | /subscriptions/e8ea4e2c-5bc5-46a9-ac97-3dc3462bab38/resourcegroups/EnableSPInVS/providers/microsoft.insights/components/EnableSPInVS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Models/ErrorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace EnableSPInVS.Models
4 | {
5 | public class ErrorViewModel
6 | {
7 | public string RequestId { get; set; }
8 |
9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
10 | }
11 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace EnableSPInVS
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | BuildWebHost(args).Run();
18 | }
19 |
20 | public static IWebHost BuildWebHost(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseApplicationInsights()
23 | .UseStartup()
24 | .Build();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.Extensions.Configuration;
8 | using Microsoft.Extensions.DependencyInjection;
9 |
10 | namespace EnableSPInVS
11 | {
12 | public class Startup
13 | {
14 | public Startup(IConfiguration configuration)
15 | {
16 | Configuration = configuration;
17 | }
18 |
19 | public IConfiguration Configuration { get; }
20 |
21 | // This method gets called by the runtime. Use this method to add services to the container.
22 | public void ConfigureServices(IServiceCollection services)
23 | {
24 | services.AddMvc();
25 | }
26 |
27 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
28 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
29 | {
30 | if (env.IsDevelopment())
31 | {
32 | app.UseBrowserLink();
33 | app.UseDeveloperExceptionPage();
34 | }
35 | else
36 | {
37 | app.UseExceptionHandler("/Home/Error");
38 | }
39 |
40 | app.UseStaticFiles();
41 |
42 | app.UseMvc(routes =>
43 | {
44 | routes.MapRoute(
45 | name: "default",
46 | template: "{controller=Home}/{action=Index}/{id?}");
47 | });
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
22 |
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using EnableSPInVS
2 | @using EnableSPInVS.Models
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Warning",
6 | // Append the following line:
7 | "ServiceProfiler": "Information"
8 | }
9 | },
10 | "ApplicationInsights": {
11 | // Replace this with your own iKey.
12 | "InstrumentationKey": "0f1b2415-9a4f-4da1-9d26-548f502ddemo"
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/bundleconfig.json:
--------------------------------------------------------------------------------
1 | // Configure bundling and minification for the project.
2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241
3 | [
4 | {
5 | "outputFileName": "wwwroot/css/site.min.css",
6 | // An array of relative input file paths. Globbing patterns supported
7 | "inputFiles": [
8 | "wwwroot/css/site.css"
9 | ]
10 | },
11 | {
12 | "outputFileName": "wwwroot/js/site.min.js",
13 | "inputFiles": [
14 | "wwwroot/js/site.js"
15 | ],
16 | // Optionally specify minification options
17 | "minify": {
18 | "enabled": true,
19 | "renameLocals": true
20 | },
21 | // Optionally generate .map file
22 | "sourceMap": false
23 | }
24 | ]
25 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 50px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | /* Wrapping element */
7 | /* Set some basic padding to keep content from hitting the edges */
8 | .body-content {
9 | padding-left: 15px;
10 | padding-right: 15px;
11 | }
12 |
13 | /* Carousel */
14 | .carousel-caption p {
15 | font-size: 20px;
16 | line-height: 1.4;
17 | }
18 |
19 | /* Make .svg files in the carousel display properly in older browsers */
20 | .carousel-inner .item img[src$=".svg"] {
21 | width: 100%;
22 | }
23 |
24 | /* QR code generator */
25 | #qrCode {
26 | margin: 15px;
27 | }
28 |
29 | /* Hide/rearrange for smaller screens */
30 | @media screen and (max-width: 767px) {
31 | /* Hide captions */
32 | .carousel-caption {
33 | display: none;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Write your JavaScript code.
2 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap",
3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
4 | "keywords": [
5 | "css",
6 | "js",
7 | "less",
8 | "mobile-first",
9 | "responsive",
10 | "front-end",
11 | "framework",
12 | "web"
13 | ],
14 | "homepage": "http://getbootstrap.com",
15 | "license": "MIT",
16 | "moduleType": "globals",
17 | "main": [
18 | "less/bootstrap.less",
19 | "dist/js/bootstrap.js"
20 | ],
21 | "ignore": [
22 | "/.*",
23 | "_config.yml",
24 | "CNAME",
25 | "composer.json",
26 | "CONTRIBUTING.md",
27 | "docs",
28 | "js/tests",
29 | "test-infra"
30 | ],
31 | "dependencies": {
32 | "jquery": "1.9.1 - 3"
33 | },
34 | "version": "3.3.7",
35 | "_release": "3.3.7",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.3.7",
39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
40 | },
41 | "_source": "https://github.com/twbs/bootstrap.git",
42 | "_target": "v3.3.7",
43 | "_originalSource": "bootstrap",
44 | "_direct": true
45 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2016 Twitter, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/bootstrap/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/jquery-validation-unobtrusive/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation-unobtrusive",
3 | "version": "3.2.6",
4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.",
6 | "main": [
7 | "jquery.validate.unobtrusive.js"
8 | ],
9 | "ignore": [
10 | "**/.*",
11 | "*.json",
12 | "*.md",
13 | "*.txt",
14 | "gulpfile.js"
15 | ],
16 | "keywords": [
17 | "jquery",
18 | "asp.net",
19 | "mvc",
20 | "validation",
21 | "unobtrusive"
22 | ],
23 | "authors": [
24 | "Microsoft"
25 | ],
26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm",
27 | "repository": {
28 | "type": "git",
29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git"
30 | },
31 | "dependencies": {
32 | "jquery-validation": ">=1.8",
33 | "jquery": ">=1.8"
34 | },
35 | "_release": "3.2.6",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.2.6",
39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7"
40 | },
41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git",
42 | "_target": "3.2.6",
43 | "_originalSource": "jquery-validation-unobtrusive"
44 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/jquery-validation/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation",
3 | "homepage": "http://jqueryvalidation.org/",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/jzaefferer/jquery-validation.git"
7 | },
8 | "authors": [
9 | "Jörn Zaefferer "
10 | ],
11 | "description": "Form validation made easy",
12 | "main": "dist/jquery.validate.js",
13 | "keywords": [
14 | "forms",
15 | "validation",
16 | "validate"
17 | ],
18 | "license": "MIT",
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "test",
24 | "demo",
25 | "lib"
26 | ],
27 | "dependencies": {
28 | "jquery": ">= 1.7.2"
29 | },
30 | "version": "1.14.0",
31 | "_release": "1.14.0",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "1.14.0",
35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48"
36 | },
37 | "_source": "git://github.com/jzaefferer/jquery-validation.git",
38 | "_target": ">=1.8",
39 | "_originalSource": "jquery-validation"
40 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/jquery/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "main": "dist/jquery.js",
4 | "license": "MIT",
5 | "ignore": [
6 | "package.json"
7 | ],
8 | "keywords": [
9 | "jquery",
10 | "javascript",
11 | "browser",
12 | "library"
13 | ],
14 | "homepage": "https://github.com/jquery/jquery-dist",
15 | "version": "2.2.0",
16 | "_release": "2.2.0",
17 | "_resolution": {
18 | "type": "version",
19 | "tag": "2.2.0",
20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5"
21 | },
22 | "_source": "git://github.com/jquery/jquery-dist.git",
23 | "_target": "2.2.0",
24 | "_originalSource": "jquery"
25 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/EnableSPInVS/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright jQuery Foundation and other contributors, https://jquery.org/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/docker-compose.dcproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2.0
5 | Linux
6 | bd39e430-1256-41d8-a264-5ecff6971154
7 | LaunchBrowser
8 | http://localhost:{ServicePort}
9 | enablespinvs
10 |
11 |
12 |
13 | docker-compose.yml
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/docker-compose.override.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | enablespinvs:
5 | environment:
6 | - ASPNETCORE_ENVIRONMENT=Development
7 | ports:
8 | - "80"
9 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVS/EnableSPInVS/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 | enablespinvs:
5 | environment:
6 | - ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.Profiler.AspNetCore
7 | image: enablespinvs
8 | build:
9 | context: .
10 | dockerfile: EnableSPInVS/Dockerfile
11 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.dockerignore:
--------------------------------------------------------------------------------
1 | .dockerignore
2 | .env
3 | .git
4 | .gitignore
5 | .vs
6 | .vscode
7 | docker-compose.yml
8 | docker-compose.*.yml
9 | */bin
10 | */obj
11 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/AddApplicationInsights.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/AddApplicationInsights.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/AddNuGetPackageOfServiceProfiler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/AddNuGetPackageOfServiceProfiler.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/ApplicationInsightsConfigured.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/ApplicationInsightsConfigured.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/CreateAppService.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/CreateAppService.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/DockerSupport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/DockerSupport.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/PublishTarget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/PublishTarget.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/ServiceProfilerLogInVSOutput.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/ServiceProfilerLogInVSOutput.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/SetEnvInPortal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/SetEnvInPortal.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/V2/001_NewProject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/V2/001_NewProject.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/V2/005_AddNuGetPackages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/V2/005_AddNuGetPackages.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/.media/performance-blade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/.media/performance-blade.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2018
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppInsightsProfilerExample", "AppInsightsProfilerExample\AppInsightsProfilerExample.csproj", "{6682A2FE-C053-4B37-AE59-382996AA5C6E}"
7 | EndProject
8 | Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{EE47C84C-457B-4A28-A9F5-3673971F6A01}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {6682A2FE-C053-4B37-AE59-382996AA5C6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {6682A2FE-C053-4B37-AE59-382996AA5C6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {6682A2FE-C053-4B37-AE59-382996AA5C6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {6682A2FE-C053-4B37-AE59-382996AA5C6E}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {EE47C84C-457B-4A28-A9F5-3673971F6A01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {EE47C84C-457B-4A28-A9F5-3673971F6A01}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {EE47C84C-457B-4A28-A9F5-3673971F6A01}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {EE47C84C-457B-4A28-A9F5-3673971F6A01}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {0166927E-7CB1-4259-B1A6-53A6AE9D5C54}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/AppInsightsProfilerExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.1
5 | ..\docker-compose.dcproj
6 | /subscriptions/e8ea4e2c-5bc5-46a9-ac97-3dc3462bab38/resourcegroups/saars_aiprofiler_clr21_vs/providers/microsoft.insights/components/saars_aiprofiler_clr21_vs
7 | /subscriptions/e8ea4e2c-5bc5-46a9-ac97-3dc3462bab38/resourcegroups/saars_aiprofiler_clr21_vs/providers/microsoft.insights/components/saars_aiprofiler_clr21_vs
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Connected Services/Application Insights/ConnectedService.json:
--------------------------------------------------------------------------------
1 | {
2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
3 | "Version": "8.12.10405.1",
4 | "GettingStartedDocument": {
5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=798432"
6 | }
7 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | using Microsoft.AspNetCore.Mvc;
8 | using AppInsightsProfilerExample.Models;
9 |
10 | namespace AppInsightsProfilerExample.Controllers
11 | {
12 | public class HomeController : Controller
13 | {
14 | public IActionResult Index()
15 | {
16 | SimulateDelay();
17 | return View();
18 | }
19 |
20 | public IActionResult About()
21 | {
22 | SimulateDelay();
23 | ViewData["Message"] = "Your application description page.";
24 | return View();
25 | }
26 |
27 | public IActionResult Contact()
28 | {
29 | SimulateDelay();
30 | ViewData["Message"] = "Your contact page.";
31 | return View();
32 | }
33 |
34 | public IActionResult Privacy()
35 | {
36 | SimulateDelay();
37 | return View();
38 | }
39 |
40 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
41 | public IActionResult Error()
42 | {
43 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
44 | }
45 |
46 | private void SimulateDelay()
47 | {
48 | // Delay for 500ms to 2s to simulate a bottleneck.
49 | Thread.Sleep((new Random()).Next(500, 2000));
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
2 | WORKDIR /app
3 | EXPOSE 80
4 |
5 | FROM microsoft/dotnet:2.1-sdk AS build
6 | WORKDIR /src
7 | COPY AppInsightsProfilerExample/AppInsightsProfilerExample.csproj AppInsightsProfilerExample/
8 | RUN dotnet restore AppInsightsProfilerExample/AppInsightsProfilerExample.csproj
9 | COPY . .
10 | WORKDIR /src/AppInsightsProfilerExample
11 | RUN dotnet build AppInsightsProfilerExample.csproj -c Release -o /app
12 |
13 | FROM build AS publish
14 | RUN dotnet publish AppInsightsProfilerExample.csproj -c Release -o /app
15 |
16 | FROM base AS final
17 | WORKDIR /app
18 | COPY --from=publish /app .
19 | ENTRYPOINT ["dotnet", "AppInsightsProfilerExample.dll"]
20 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Models/ErrorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AppInsightsProfilerExample.Models
4 | {
5 | public class ErrorViewModel
6 | {
7 | public string RequestId { get; set; }
8 |
9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
10 | }
11 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace AppInsightsProfilerExample
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseApplicationInsights()
23 | .UseStartup();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.Http;
8 | using Microsoft.AspNetCore.Mvc;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 |
12 | namespace AppInsightsProfilerExample
13 | {
14 | public class Startup
15 | {
16 | public Startup(IConfiguration configuration)
17 | {
18 | Configuration = configuration;
19 | }
20 |
21 | public IConfiguration Configuration { get; }
22 |
23 | // This method gets called by the runtime. Use this method to add services to the container.
24 | public void ConfigureServices(IServiceCollection services)
25 | {
26 | services.Configure(options =>
27 | {
28 | // This lambda determines whether user consent for non-essential cookies is needed for a given request.
29 | options.CheckConsentNeeded = context => true;
30 | options.MinimumSameSitePolicy = SameSiteMode.None;
31 | });
32 |
33 |
34 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
35 | }
36 |
37 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
38 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
39 | {
40 | if (env.IsDevelopment())
41 | {
42 | app.UseDeveloperExceptionPage();
43 | }
44 | else
45 | {
46 | app.UseExceptionHandler("/Home/Error");
47 | }
48 |
49 | app.UseStaticFiles();
50 | app.UseCookiePolicy();
51 |
52 | app.UseMvc(routes =>
53 | {
54 | routes.MapRoute(
55 | name: "default",
56 | template: "{controller=Home}/{action=Index}/{id?}");
57 | });
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Views/Home/About.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "About";
3 | }
4 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
22 |
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Views/Shared/_CookieConsentPartial.cshtml:
--------------------------------------------------------------------------------
1 | @using Microsoft.AspNetCore.Http.Features
2 |
3 | @{
4 | var consentFeature = Context.Features.Get();
5 | var showBanner = !consentFeature?.CanTrack ?? false;
6 | var cookieString = consentFeature?.CreateConsentCookie();
7 | }
8 |
9 | @if (showBanner)
10 | {
11 |
33 |
41 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using AppInsightsProfilerExample
2 | @using AppInsightsProfilerExample.Models
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning",
5 | "ServiceProfiler": "Information"
6 | }
7 | },
8 | "AllowedHosts": "*",
9 | "ApplicationInsights": {
10 | "InstrumentationKey": "Your applicatoin insights key"
11 | }
12 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
2 | for details on configuring this project to bundle and minify static web assets. */
3 | body {
4 | padding-top: 50px;
5 | padding-bottom: 20px;
6 | }
7 |
8 | /* Wrapping element */
9 | /* Set some basic padding to keep content from hitting the edges */
10 | .body-content {
11 | padding-left: 15px;
12 | padding-right: 15px;
13 | }
14 |
15 | /* Carousel */
16 | .carousel-caption p {
17 | font-size: 20px;
18 | line-height: 1.4;
19 | }
20 |
21 | /* Make .svg files in the carousel display properly in older browsers */
22 | .carousel-inner .item img[src$=".svg"] {
23 | width: 100%;
24 | }
25 |
26 | /* QR code generator */
27 | #qrCode {
28 | margin: 15px;
29 | }
30 |
31 | /* Hide/rearrange for smaller screens */
32 | @media screen and (max-width: 767px) {
33 | /* Hide captions */
34 | .carousel-caption {
35 | display: none;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap",
3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.",
4 | "keywords": [
5 | "css",
6 | "js",
7 | "less",
8 | "mobile-first",
9 | "responsive",
10 | "front-end",
11 | "framework",
12 | "web"
13 | ],
14 | "homepage": "http://getbootstrap.com",
15 | "license": "MIT",
16 | "moduleType": "globals",
17 | "main": [
18 | "less/bootstrap.less",
19 | "dist/js/bootstrap.js"
20 | ],
21 | "ignore": [
22 | "/.*",
23 | "_config.yml",
24 | "CNAME",
25 | "composer.json",
26 | "CONTRIBUTING.md",
27 | "docs",
28 | "js/tests",
29 | "test-infra"
30 | ],
31 | "dependencies": {
32 | "jquery": "1.9.1 - 3"
33 | },
34 | "version": "3.3.7",
35 | "_release": "3.3.7",
36 | "_resolution": {
37 | "type": "version",
38 | "tag": "v3.3.7",
39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86"
40 | },
41 | "_source": "https://github.com/twbs/bootstrap.git",
42 | "_target": "v3.3.7",
43 | "_originalSource": "bootstrap",
44 | "_direct": true
45 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2011-2016 Twitter, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/bootstrap/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/jquery-validation-unobtrusive/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation-unobtrusive",
3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
4 | "version": "3.2.9",
5 | "_release": "3.2.9",
6 | "_resolution": {
7 | "type": "version",
8 | "tag": "v3.2.9",
9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396"
10 | },
11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git",
12 | "_target": "^3.2.9",
13 | "_originalSource": "jquery-validation-unobtrusive",
14 | "_direct": true
15 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) .NET Foundation. All rights reserved.
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 | these files except in compliance with the License. You may obtain a copy of the
5 | License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software distributed
10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the
12 | specific language governing permissions and limitations under the License.
13 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/jquery-validation/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery-validation",
3 | "homepage": "https://jqueryvalidation.org/",
4 | "repository": {
5 | "type": "git",
6 | "url": "git://github.com/jquery-validation/jquery-validation.git"
7 | },
8 | "authors": [
9 | "Jörn Zaefferer "
10 | ],
11 | "description": "Form validation made easy",
12 | "main": "dist/jquery.validate.js",
13 | "keywords": [
14 | "forms",
15 | "validation",
16 | "validate"
17 | ],
18 | "license": "MIT",
19 | "ignore": [
20 | "**/.*",
21 | "node_modules",
22 | "bower_components",
23 | "test",
24 | "demo",
25 | "lib"
26 | ],
27 | "dependencies": {
28 | "jquery": ">= 1.7.2"
29 | },
30 | "version": "1.17.0",
31 | "_release": "1.17.0",
32 | "_resolution": {
33 | "type": "version",
34 | "tag": "1.17.0",
35 | "commit": "fc9b12d3bfaa2d0c04605855b896edb2934c0772"
36 | },
37 | "_source": "https://github.com/jzaefferer/jquery-validation.git",
38 | "_target": "^1.17.0",
39 | "_originalSource": "jquery-validation",
40 | "_direct": true
41 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/jquery-validation/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | =====================
3 |
4 | Copyright Jörn Zaefferer
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/jquery/.bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "main": "dist/jquery.js",
4 | "license": "MIT",
5 | "ignore": [
6 | "package.json"
7 | ],
8 | "keywords": [
9 | "jquery",
10 | "javascript",
11 | "browser",
12 | "library"
13 | ],
14 | "homepage": "https://github.com/jquery/jquery-dist",
15 | "version": "3.3.1",
16 | "_release": "3.3.1",
17 | "_resolution": {
18 | "type": "version",
19 | "tag": "3.3.1",
20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e"
21 | },
22 | "_source": "https://github.com/jquery/jquery-dist.git",
23 | "_target": "^3.3.1",
24 | "_originalSource": "jquery",
25 | "_direct": true
26 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/AppInsightsProfilerExample/wwwroot/lib/jquery/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright JS Foundation and other contributors, https://js.foundation/
2 |
3 | This software consists of voluntary contributions made by many
4 | individuals. For exact contribution history, see the revision history
5 | available at https://github.com/jquery/jquery
6 |
7 | The following license applies to all parts of this software except as
8 | documented below:
9 |
10 | ====
11 |
12 | Permission is hereby granted, free of charge, to any person obtaining
13 | a copy of this software and associated documentation files (the
14 | "Software"), to deal in the Software without restriction, including
15 | without limitation the rights to use, copy, modify, merge, publish,
16 | distribute, sublicense, and/or sell copies of the Software, and to
17 | permit persons to whom the Software is furnished to do so, subject to
18 | the following conditions:
19 |
20 | The above copyright notice and this permission notice shall be
21 | included in all copies or substantial portions of the Software.
22 |
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 |
31 | ====
32 |
33 | All files located in the node_modules and external directories are
34 | externally maintained libraries used by this software which have their
35 | own licenses; we recommend you read them, as their terms may differ from
36 | the terms above.
37 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/docker-compose.dcproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2.1
5 | Linux
6 | ee47c84c-457b-4a28-a9f5-3673971f6a01
7 | LaunchBrowser
8 | {Scheme}://localhost:{ServicePort}
9 | appinsightsprofilerexample
10 |
11 |
12 |
13 | docker-compose.yml
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/docker-compose.override.yml:
--------------------------------------------------------------------------------
1 | version: '3.4'
2 |
3 | services:
4 | appinsightsprofilerexample:
5 | environment:
6 | - ASPNETCORE_ENVIRONMENT=Development
7 | ports:
8 | - "80"
9 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_1/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.4'
2 |
3 | services:
4 | appinsightsprofilerexample:
5 | image: ${DOCKER_REGISTRY}appinsightsprofilerexample
6 | environment:
7 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.ApplicationInsights.Profiler.AspNetCore"
8 | build:
9 | context: .
10 | dockerfile: AppInsightsProfilerExample/Dockerfile
11 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/001_CreateProject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/001_CreateProject.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/003_AI_Enabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/003_AI_Enabled.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/005_NuGets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/005_NuGets.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/006_DebuggingKestrel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/006_DebuggingKestrel.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/007_ServiceProfilerLogging.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/EnableServiceProfilerInVSCLR2_2_Win/.media/007_ServiceProfilerLogging.png
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.168
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnableSPInVSWin", "EnableSPInVSWin\EnableSPInVSWin.csproj", "{65B77662-6F74-422C-B8DE-33845708A227}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {65B77662-6F74-422C-B8DE-33845708A227}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {65B77662-6F74-422C-B8DE-33845708A227}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {65B77662-6F74-422C-B8DE-33845708A227}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {65B77662-6F74-422C-B8DE-33845708A227}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {9AC0B2E7-A842-4AA6-82FB-262496ED214C}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/Connected Services/Application Insights/ConnectedService.json:
--------------------------------------------------------------------------------
1 | {
2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
3 | "Version": "8.14.11009.1",
4 | "GettingStartedDocument": {
5 | "Uri": "https://go.microsoft.com/fwlink/?LinkID=798432"
6 | }
7 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/Controllers/ValuesController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Mvc;
7 |
8 | namespace EnableSPInVSWin.Controllers
9 | {
10 | [Route("api/[controller]")]
11 | [ApiController]
12 | public class ValuesController : ControllerBase
13 | {
14 | // GET api/values
15 | [HttpGet]
16 | public ActionResult> Get()
17 | {
18 | SimulateDelay();
19 | return new string[] { "value1", "value2" };
20 | }
21 |
22 | // GET api/values/5
23 | [HttpGet("{id}")]
24 | public ActionResult Get(int id)
25 | {
26 | SimulateDelay();
27 | return "value";
28 | }
29 |
30 | // POST api/values
31 | [HttpPost]
32 | public void Post([FromBody] string value)
33 | {
34 | }
35 |
36 | // PUT api/values/5
37 | [HttpPut("{id}")]
38 | public void Put(int id, [FromBody] string value)
39 | {
40 | }
41 |
42 | // DELETE api/values/5
43 | [HttpDelete("{id}")]
44 | public void Delete(int id)
45 | {
46 | }
47 |
48 | private void SimulateDelay()
49 | {
50 | // Delay for 500ms to 2s to simulate a bottleneck.
51 | Thread.Sleep((new Random()).Next(500, 2000));
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/EnableSPInVSWin.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp2.2
5 | InProcess
6 | /subscriptions/41dd6365-42d0-4631-b6f1-6f38a08f0248/resourcegroups/EnableSPInVSWin/providers/microsoft.insights/components/EnableSPInVSWin
7 | /subscriptions/41dd6365-42d0-4631-b6f1-6f38a08f0248/resourcegroups/EnableSPInVSWin/providers/microsoft.insights/components/EnableSPInVSWin
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore;
7 | using Microsoft.AspNetCore.Hosting;
8 | using Microsoft.Extensions.Configuration;
9 | using Microsoft.Extensions.Logging;
10 |
11 | namespace EnableSPInVSWin
12 | {
13 | public class Program
14 | {
15 | public static void Main(string[] args)
16 | {
17 | CreateWebHostBuilder(args).Build().Run();
18 | }
19 |
20 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
21 | WebHost.CreateDefaultBuilder(args)
22 | .UseApplicationInsights()
23 | .UseStartup();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.HttpsPolicy;
8 | using Microsoft.AspNetCore.Mvc;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 | using Microsoft.Extensions.Logging;
12 | using Microsoft.Extensions.Options;
13 |
14 | namespace EnableSPInVSWin
15 | {
16 | public class Startup
17 | {
18 | public Startup(IConfiguration configuration)
19 | {
20 | Configuration = configuration;
21 | }
22 |
23 | public IConfiguration Configuration { get; }
24 |
25 | // This method gets called by the runtime. Use this method to add services to the container.
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | // Add this line to enable Service Profiler
29 | services.AddServiceProfiler();
30 | services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
31 | }
32 |
33 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
34 | public void Configure(IApplicationBuilder app, IHostingEnvironment env)
35 | {
36 | if (env.IsDevelopment())
37 | {
38 | app.UseDeveloperExceptionPage();
39 | }
40 | else
41 | {
42 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
43 | app.UseHsts();
44 | }
45 |
46 | app.UseHttpsRedirection();
47 | app.UseMvc();
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerInVSCLR2_2_Win/EnableSPInVSWin/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | },
7 | "ServiceProfiler": {
8 | "SkipUpload": true
9 | },
10 | "AllowedHosts": "*",
11 | "ApplicationInsights": {
12 | "InstrumentationKey": "4e0746b4-7da3-4972-b300-036432bf379c"
13 | }
14 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | // Use IntelliSense to find out which attributes exist for C# debugging
6 | // Use hover for the description of the existing attributes
7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8 | "name": ".NET Core Launch (web)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/bin/Debug/net7.0/EnableServiceProfilerNet7.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}",
16 | "stopAtEntry": false,
17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18 | "serverReadyAction": {
19 | "action": "openExternally",
20 | "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
21 | },
22 | "env": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | },
25 | "sourceFileMap": {
26 | "/Views": "${workspaceFolder}/Views"
27 | }
28 | },
29 | {
30 | "name": ".NET Core Attach",
31 | "type": "coreclr",
32 | "request": "attach"
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the tasks.json format
4 | "version": "2.0.0",
5 | "tasks": [
6 | {
7 | "label": "build",
8 | "command": "dotnet",
9 | "type": "shell",
10 | "args": [
11 | "build",
12 | // Ask dotnet build to generate full paths for file names.
13 | "/property:GenerateFullPaths=true",
14 | // Do not generate summary otherwise it leads to duplicate errors in Problems panel
15 | "/consoleloggerparameters:NoSummary"
16 | ],
17 | "group": "build",
18 | "presentation": {
19 | "reveal": "silent"
20 | },
21 | "problemMatcher": "$msCompile"
22 | }
23 | ]
24 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using HeavyArrayForecast;
2 | using Microsoft.AspNetCore.Mvc;
3 |
4 | namespace EnableServiceProfilerNet7.Controllers;
5 |
6 | [ApiController]
7 | [Route("[controller]")]
8 | public class WeatherForecastController : ControllerBase
9 | {
10 | private readonly ILogger _logger;
11 |
12 | public WeatherForecastController(ILogger logger)
13 | {
14 | _logger = logger;
15 | }
16 |
17 | [HttpGet(Name = "GetWeatherForecast")]
18 | public IEnumerable Get()
19 | {
20 | return WeatherForecastHelper.GetForecasts();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/EnableServiceProfilerNet7.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/Program.cs:
--------------------------------------------------------------------------------
1 | var builder = WebApplication.CreateBuilder(args);
2 |
3 | // Add services to the container.
4 |
5 | builder.Services.AddControllers();
6 |
7 | // Enable application insights and profiler.
8 | builder.Services.AddApplicationInsightsTelemetry();
9 | builder.Services.AddServiceProfiler();
10 |
11 | var app = builder.Build();
12 |
13 | app.UseHttpsRedirection();
14 |
15 | app.UseAuthorization();
16 |
17 | app.MapControllers();
18 |
19 | app.Run();
20 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/Readme.md:
--------------------------------------------------------------------------------
1 | # Enable Profiler for WebAPI in .NET 7
2 |
3 | > ⚠️ .NET 7 has reached its end of support. For information on upgrading, please visit .
4 |
5 | This folder contains a live example of Profiler running in .NET 7 WebAPI.
6 |
7 | Enabling the profiler in .NET 7 does not require any changes in the steps. Please refer to [the readme for .NET 6](../EnableServiceProfilerForContainerAppNet6/Readme.md) for instructions.
8 |
9 | If you are building a **Worker**, please refer to [this readme](../ServiceProfilerInWorkerNet6/) for further guidance.
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | // "ApplicationInsights": {
10 | // "ConnectionString": "-- Your connection string --"
11 | // }
12 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
2 | WORKDIR /app
3 |
4 | # Copy csproj and restore as distinct layers
5 | COPY *.csproj ./
6 | RUN dotnet restore
7 |
8 | # Copy everything else and build
9 | COPY * ./
10 | RUN dotnet publish -c Release -o out
11 |
12 | # Build runtime image
13 | FROM mcr.microsoft.com/dotnet/aspnet:7.0
14 | WORKDIR /app
15 | COPY --from=build-env /app/out .
16 | ENTRYPOINT ["dotnet", "EnableServiceProfilerNet7.dll"]
17 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet7/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "7.0.203",
4 | "rollForward": "major"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet8/EnableServiceProfilerNet8.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet8/Program.cs:
--------------------------------------------------------------------------------
1 |
2 | using HeavyArrayForecast;
3 |
4 | var builder = WebApplication.CreateBuilder(args);
5 |
6 | builder.Services.AddApplicationInsightsTelemetry(); // Register Application Insights
7 | builder.Services.AddServiceProfiler(opt =>
8 | {
9 | // Customize by code, for example:
10 | opt.Duration = TimeSpan.FromSeconds(30); // Profile for 30 seconds than the default of 2 minutes.
11 | }); // Register Profiler
12 |
13 | var app = builder.Build();
14 |
15 | app.MapGet("/", () => WeatherForecastHelper.GetForecasts());
16 |
17 | app.Run();
18 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet8/Readme.md:
--------------------------------------------------------------------------------
1 | # Enable Profiler for WebAPI in .NET 8
2 |
3 | This folder contains a live example of Profiler running in .NET 8 Minimal WebAPI.
4 |
5 | Enabling the profiler in .NET 8 does not require any changes in the steps. Please refer to [the readme for .NET 6](../EnableServiceProfilerForContainerAppNet6/Readme.md) for instructions.
6 |
7 | If you are building a **Worker**, please refer to [this readme](../ServiceProfilerInWorkerNet6/) for further guidance.
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet8/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "ApplicationInsights":
9 | {
10 | "ConnectionString": "Your-ConnectionString"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet8/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/examples/EnableServiceProfilerNet8/query.http:
--------------------------------------------------------------------------------
1 | # Use this file with VSCode Rest client extension
2 | GET http://localhost:5000/
3 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/.dockerignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | global.json
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using Microsoft.AspNetCore.Mvc;
6 | using Microsoft.Extensions.Logging;
7 |
8 | namespace ServiceProfiler.EventPipe.DockerApp30HS.Controllers
9 | {
10 | [ApiController]
11 | [Route("[controller]")]
12 | public class WeatherForecastController : ControllerBase
13 | {
14 | private static readonly string[] Summaries = new[]
15 | {
16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
17 | };
18 |
19 | private readonly ILogger _logger;
20 |
21 | public WeatherForecastController(ILogger logger)
22 | {
23 | _logger = logger;
24 | }
25 |
26 | [HttpGet]
27 | public IEnumerable Get()
28 | {
29 | SimulateDelay();
30 | var rng = new Random();
31 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
32 | {
33 | Date = DateTime.Now.AddDays(index),
34 | TemperatureC = rng.Next(-20, 55),
35 | Summary = Summaries[rng.Next(Summaries.Length)]
36 | })
37 | .ToArray();
38 | }
39 |
40 | private void SimulateDelay()
41 | {
42 | // Delay for 200ms to 5s to simulate a bottleneck.
43 | Thread.Sleep((new Random()).Next(200, 5000));
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
2 | WORKDIR /app
3 |
4 | # Copy everything for build
5 | COPY . ./
6 |
7 | # Add additional nuget packages
8 | RUN dotnet add package Microsoft.ApplicationInsights.AspNetCore --no-restore
9 | RUN dotnet add package Microsoft.ApplicationInsights.Profiler.AspNetCore -v 2.* --no-restore
10 |
11 | # Restore
12 | RUN dotnet restore
13 |
14 | # Publish
15 | RUN dotnet publish -c Release -o out
16 |
17 | # Build runtime image
18 | FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
19 |
20 | # Setup environment variable for application insights connection string
21 | ENV APPLICATIONINSIGHTS_CONNECTION_STRING="YOUR-APPLICATIONINSIGHTS_CONNECTION_STRING"
22 |
23 | # Setup environment variable for hosting startup assembly
24 | ENV ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.Profiler.HostingStartup30
25 |
26 | WORKDIR /app
27 | COPY --from=build-env /app/out .
28 |
29 | ENTRYPOINT ["dotnet", "ServiceProfiler.EventPipe.DockerApp30HS.dll"]
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.Hosting;
8 | using Microsoft.Extensions.Logging;
9 |
10 | namespace ServiceProfiler.EventPipe.DockerApp30HS
11 | {
12 | public class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | CreateHostBuilder(args).Build().Run();
17 | }
18 |
19 | public static IHostBuilder CreateHostBuilder(string[] args) =>
20 | Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder =>
22 | {
23 | webBuilder.UseStartup();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/ServiceProfiler.EventPipe.DockerApp30HS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.HttpsPolicy;
8 | using Microsoft.AspNetCore.Mvc;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 | using Microsoft.Extensions.Hosting;
12 | using Microsoft.Extensions.Logging;
13 |
14 | namespace ServiceProfiler.EventPipe.DockerApp30HS
15 | {
16 | public class Startup
17 | {
18 | public Startup(IConfiguration configuration)
19 | {
20 | Configuration = configuration;
21 | }
22 |
23 | public IConfiguration Configuration { get; }
24 |
25 | // This method gets called by the runtime. Use this method to add services to the container.
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | services.AddControllers();
29 | }
30 |
31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
32 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
33 | {
34 | if (env.IsDevelopment())
35 | {
36 | app.UseDeveloperExceptionPage();
37 | }
38 |
39 | app.UseHttpsRedirection();
40 |
41 | app.UseRouting();
42 |
43 | app.UseAuthorization();
44 |
45 | app.UseEndpoints(endpoints =>
46 | {
47 | endpoints.MapControllers();
48 | });
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ServiceProfiler.EventPipe.DockerApp30HS
4 | {
5 | public class WeatherForecast
6 | {
7 | public DateTime Date { get; set; }
8 |
9 | public int TemperatureC { get; set; }
10 |
11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12 |
13 | public string Summary { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Debug",
5 | "System": "Information",
6 | "Microsoft": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "3.1.101"
4 | }
5 | }
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/media/AppSettings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/HostingStartupCLR3/media/AppSettings.png
--------------------------------------------------------------------------------
/examples/HostingStartupCLR3/media/EnableLogs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/examples/HostingStartupCLR3/media/EnableLogs.png
--------------------------------------------------------------------------------
/examples/PerfIssueLib/HeavyArrayForecast/HeavyArrayForecast.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | 10.0
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/PerfIssueLib/HeavyArrayForecast/Readme.md:
--------------------------------------------------------------------------------
1 | # Heavy Weather Forcast
2 |
3 | Generate weather forecast for multiple times, unnecessarily realize the list and return the result once.
4 |
5 | Use this for a performance issue demo.
6 |
--------------------------------------------------------------------------------
/examples/PerfIssueLib/HeavyArrayForecast/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace HeavyArrayForecast;
4 |
5 | public class WeatherForecast
6 | {
7 | public DateTime Date { get; set; }
8 |
9 | public int TemperatureC { get; set; }
10 |
11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12 |
13 | public string Summary { get; set; }
14 | }
15 |
--------------------------------------------------------------------------------
/examples/PerfIssueLib/HeavyArrayForecast/WeatherForecastHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace HeavyArrayForecast;
6 |
7 | public static class WeatherForecastHelper
8 | {
9 | private static readonly string[] Summaries = new[]
10 | {
11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12 | };
13 |
14 | public static IEnumerable GetForecasts(int redundantIterations = 1000000)
15 | {
16 | IEnumerable forecasts = null;
17 | Random rng = new();
18 | for (int i = 0; i < redundantIterations; i++)
19 | {
20 | // Calling ToList() realize it too early.
21 | forecasts = Enumerable.Range(1, 20).Select(index => new WeatherForecast
22 | {
23 | Date = DateTime.Now.AddDays(index),
24 | TemperatureC = rng.Next(-20, 55),
25 | Summary = Summaries[rng.Next(Summaries.Length)]
26 | }).ToList();
27 | }
28 |
29 | return forecasts;
30 | }
31 | }
--------------------------------------------------------------------------------
/examples/QuickStart3_0/.dockerignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | global.json
4 | nuget.config
5 | pkgs/
--------------------------------------------------------------------------------
/examples/QuickStart3_0/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to find out which attributes exist for C# debugging
3 | // Use hover for the description of the existing attributes
4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": ".NET Core Launch (web)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/QuickStart3_0.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}",
16 | "stopAtEntry": false,
17 | // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
18 | "serverReadyAction": {
19 | "action": "openExternally",
20 | "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
21 | },
22 | "env": {
23 | "ASPNETCORE_ENVIRONMENT": "Development"
24 | },
25 | "sourceFileMap": {
26 | "/Views": "${workspaceFolder}/Views"
27 | }
28 | },
29 | {
30 | "name": ".NET Core Attach",
31 | "type": "coreclr",
32 | "request": "attach",
33 | "processId": "${command:pickProcess}"
34 | }
35 | ]
36 | }
--------------------------------------------------------------------------------
/examples/QuickStart3_0/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "Build QuickStart for .NET Core 3.0",
6 | "command": "dotnet",
7 | "type": "process",
8 | "group": "build",
9 | "args": [
10 | "build",
11 | "${workspaceFolder}/QuickStart3_0.csproj",
12 | "/property:GenerateFullPaths=true",
13 | "/consoleloggerparameters:NoSummary"
14 | ],
15 | "problemMatcher": "$msCompile"
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/examples/QuickStart3_0/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using Microsoft.AspNetCore.Mvc;
7 | using Microsoft.Extensions.Logging;
8 |
9 | namespace QuickStart3_0.Controllers
10 | {
11 | [ApiController]
12 | [Route("[controller]")]
13 | public class WeatherForecastController : ControllerBase
14 | {
15 | private static readonly string[] Summaries = new[]
16 | {
17 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
18 | };
19 |
20 | private readonly ILogger _logger;
21 |
22 | public WeatherForecastController(ILogger logger)
23 | {
24 | _logger = logger;
25 | }
26 |
27 | [HttpGet]
28 | public IEnumerable Get()
29 | {
30 | SimulateDelay();
31 | var rng = new Random();
32 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
33 | {
34 | Date = DateTime.Now.AddDays(index),
35 | TemperatureC = rng.Next(-20, 55),
36 | Summary = Summaries[rng.Next(Summaries.Length)]
37 | })
38 | .ToArray();
39 | }
40 |
41 | private void SimulateDelay()
42 | {
43 | // Delay for 500ms to 2s to simulate a bottleneck.
44 | Thread.Sleep((new Random()).Next(500, 2000));
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.Hosting;
8 | using Microsoft.Extensions.Logging;
9 |
10 | namespace QuickStart3_0
11 | {
12 | public class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | CreateHostBuilder(args).Build().Run();
17 | }
18 |
19 | public static IHostBuilder CreateHostBuilder(string[] args) =>
20 | Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder =>
22 | {
23 | webBuilder.UseStartup();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/QuickStart3_0.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.HttpsPolicy;
8 | using Microsoft.AspNetCore.Mvc;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 | using Microsoft.Extensions.Hosting;
12 | using Microsoft.Extensions.Logging;
13 |
14 | namespace QuickStart3_0
15 | {
16 | public class Startup
17 | {
18 | public Startup(IConfiguration configuration)
19 | {
20 | Configuration = configuration;
21 | }
22 |
23 | public IConfiguration Configuration { get; }
24 |
25 | // This method gets called by the runtime. Use this method to add services to the container.
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | services.AddControllers();
29 | services.AddApplicationInsightsTelemetry();
30 | services.AddServiceProfiler();
31 | }
32 |
33 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
34 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
35 | {
36 | if (env.IsDevelopment())
37 | {
38 | app.UseDeveloperExceptionPage();
39 | }
40 |
41 | app.UseHttpsRedirection();
42 |
43 | app.UseRouting();
44 |
45 | app.UseAuthorization();
46 |
47 | app.UseEndpoints(endpoints =>
48 | {
49 | endpoints.MapControllers();
50 | });
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace QuickStart3_0
4 | {
5 | public class WeatherForecast
6 | {
7 | public DateTime Date { get; set; }
8 |
9 | public int TemperatureC { get; set; }
10 |
11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12 |
13 | public string Summary { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "ApplicationInsights": {
3 | "ConnectionString": "your-connection-string"
4 | },
5 | "Logging": {
6 | "LogLevel": {
7 | "Default": "Warning",
8 | "ServiceProfiler": "Information"
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/examples/QuickStart3_0/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*"
10 | }
11 |
--------------------------------------------------------------------------------
/examples/QuickStart3_0/dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env
2 | WORKDIR /app
3 |
4 | # Copy csproj and restore as distinct layers
5 | COPY *.csproj ./
6 | RUN dotnet restore
7 |
8 | # Copy everything else and build
9 | COPY . ./
10 | RUN dotnet publish -c Release -o out
11 |
12 | # Build runtime image
13 | FROM mcr.microsoft.com/dotnet/core/aspnet:3.0
14 | ENV APPLICATIONINSIGHTS_CONNECTION_STRING="***your-application-insights-connection-string***"
15 | WORKDIR /app
16 | COPY --from=build-env /app/out .
17 | ENTRYPOINT ["dotnet", "QuickStart3_0.dll"]
--------------------------------------------------------------------------------
/examples/QuickStart3_1/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using HeavyArrayForecast;
3 | using Microsoft.AspNetCore.Mvc;
4 | using Microsoft.Extensions.Logging;
5 |
6 | namespace QuickStart3_1.Controllers
7 | {
8 | [ApiController]
9 | [Route("[controller]")]
10 | public class WeatherForecastController : ControllerBase
11 | {
12 | private readonly ILogger _logger;
13 |
14 | public WeatherForecastController(ILogger logger)
15 | {
16 | _logger = logger;
17 | }
18 |
19 | [HttpGet]
20 | public IEnumerable Get()
21 | {
22 | return WeatherForecastHelper.GetForecasts();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/QuickStart3_1/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.Hosting;
8 | using Microsoft.Extensions.Logging;
9 |
10 | namespace QuickStart3_1
11 | {
12 | public class Program
13 | {
14 | public static void Main(string[] args)
15 | {
16 | CreateHostBuilder(args).Build().Run();
17 | }
18 |
19 | public static IHostBuilder CreateHostBuilder(string[] args) =>
20 | Host.CreateDefaultBuilder(args)
21 | .ConfigureWebHostDefaults(webBuilder =>
22 | {
23 | webBuilder.UseStartup();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/QuickStart3_1/QuickStart3_1.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/QuickStart3_1/Readme.md:
--------------------------------------------------------------------------------
1 | # Quick Start (.NET Core 3.1 WebAPI)
2 |
3 | > ⚠️ .NET Core 3.x has reached its end of support. For information on upgrading, please visit .
4 |
5 | ## Build the solution
6 |
7 | Refer to the same steps to build a [WebAPI for .NET 3.0](../QuickStart3_0/Readme.md).
8 |
9 | ## To run this example locally
10 |
11 | * Create an Application Insights resource in Azure, refer to [Create workspace-based resource](https://docs.microsoft.com/en-us/azure/azure-monitor/app/create-workspace-resource) for instructions.
12 | * Note down the connection string.
13 |
14 | * Update the connection string in [appsettings.Development.json](appsettings.Development.json).
15 |
16 | ```jsonc
17 | {
18 | ...
19 | "ApplicationInsights": {
20 | "ConnectionString": "__ReplaceWithYourConnectionString__"
21 | }
22 | }
23 | ```
24 |
25 | * Run the code
26 |
27 | ```shell
28 | dotnet run
29 | ```
30 |
31 | Example of a successful log locally:
32 |
33 | ```shell
34 | > PS D:\Repos\profiler\examples\QuickStart3_1> dotnet run
35 | info: Microsoft.ApplicationInsights.Profiler.Core.IServiceProfilerContext[0]
36 | Profiler Endpoint: https://profiler.monitor.azure.com/
37 | info: Microsoft.ApplicationInsights.Profiler.AspNetCore.ServiceProfilerStartupFilter[0]
38 | Starting application insights profiler with instrumentation key: your-ikey-will-show-up-here
39 | info: Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider[0]
40 | Service Profiler session started.
41 | info: Microsoft.Hosting.Lifetime[0]
42 | Now listening on: https://localhost:5001
43 | info: Microsoft.Hosting.Lifetime[0]
44 | Now listening on: http://localhost:5000
45 | info: Microsoft.Hosting.Lifetime[0]
46 | Application started. Press Ctrl+C to shut down.
47 | info: Microsoft.Hosting.Lifetime[0]
48 | Hosting environment: Development
49 | info: Microsoft.Hosting.Lifetime[0]
50 | Content root path: D:\Repos\fork-ai-profiler\examples\QuickStart3_1
51 | info: Microsoft.ApplicationInsights.Profiler.Core.UploaderProxy.TraceUploaderProxy[0]
52 | Finished calling trace uploader. Exit code: 0
53 | info: Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider[0]
54 | Service Profiler session finished.
55 | ```
56 |
--------------------------------------------------------------------------------
/examples/QuickStart3_1/Startup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Microsoft.AspNetCore.Builder;
6 | using Microsoft.AspNetCore.Hosting;
7 | using Microsoft.AspNetCore.HttpsPolicy;
8 | using Microsoft.AspNetCore.Mvc;
9 | using Microsoft.Extensions.Configuration;
10 | using Microsoft.Extensions.DependencyInjection;
11 | using Microsoft.Extensions.Hosting;
12 | using Microsoft.Extensions.Logging;
13 |
14 | namespace QuickStart3_1
15 | {
16 | public class Startup
17 | {
18 | public Startup(IConfiguration configuration)
19 | {
20 | Configuration = configuration;
21 | }
22 |
23 | public IConfiguration Configuration { get; }
24 |
25 | // This method gets called by the runtime. Use this method to add services to the container.
26 | public void ConfigureServices(IServiceCollection services)
27 | {
28 | services.AddControllers();
29 | services.AddApplicationInsightsTelemetry();
30 | services.AddServiceProfiler(profilerSettings =>
31 | {
32 | // Refer to https://github.com/microsoft/ApplicationInsights-Profiler-AspNetCore/blob/main/Configurations.md for more settings.
33 | profilerSettings.Duration=TimeSpan.FromSeconds(30);
34 | });
35 | }
36 |
37 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
38 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
39 | {
40 | if (env.IsDevelopment())
41 | {
42 | app.UseDeveloperExceptionPage();
43 | }
44 |
45 | app.UseHttpsRedirection();
46 |
47 | app.UseRouting();
48 |
49 | app.UseAuthorization();
50 |
51 | app.UseEndpoints(endpoints =>
52 | {
53 | endpoints.MapControllers();
54 | });
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/examples/QuickStart3_1/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information",
7 | "Microsoft.ApplicationInsights.Profiler": "Information"
8 | }
9 | },
10 | "ApplicationInsights": {
11 | "ConnectionString": "GetTheConnectionStringFromApplicationInsights"
12 | }
13 | }
--------------------------------------------------------------------------------
/examples/QuickStart3_1/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information",
7 | "Microsoft.ApplicationInsights.Profiler": "Information"
8 | }
9 | },
10 | "AllowedHosts": "*"
11 | }
12 |
--------------------------------------------------------------------------------
/examples/QuickStart3_1/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "3.1.407",
4 | "rollForward": "latestMajor"
5 | }
6 | }
--------------------------------------------------------------------------------
/examples/QuickStart3_1/test.http:
--------------------------------------------------------------------------------
1 | GET http://localhost:5000/weatherforecast/
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/.gitignore:
--------------------------------------------------------------------------------
1 | Pkgs
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/SharedLib/SharedLib.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | enable
6 | true
7 | ProfilerExample.SharedLib
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | analyzers;build
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/WebAPI/Controllers/WeatherForecastController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace WebAPIOne.Controllers;
4 |
5 | [ApiController]
6 | [Route("[controller]")]
7 | public class WeatherForecastController : ControllerBase
8 | {
9 | private static readonly string[] Summaries = new[]
10 | {
11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12 | };
13 |
14 | private readonly ILogger _logger;
15 |
16 | public WeatherForecastController(ILogger logger)
17 | {
18 | _logger = logger;
19 | }
20 |
21 | [HttpGet(Name = "GetWeatherForecast")]
22 | public IEnumerable Get()
23 | {
24 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast
25 | {
26 | Date = DateTime.Now.AddDays(index),
27 | TemperatureC = Random.Shared.Next(-20, 55),
28 | Summary = Summaries[Random.Shared.Next(Summaries.Length)]
29 | })
30 | .ToArray();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/WebAPI/Program.cs:
--------------------------------------------------------------------------------
1 | var builder = WebApplication.CreateBuilder(args);
2 |
3 | // Add services to the container.
4 | builder.Services.AddApplicationInsightsTelemetry();
5 | builder.Services.AddServiceProfiler();
6 |
7 | builder.Services.AddControllers();
8 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
9 | builder.Services.AddEndpointsApiExplorer();
10 | builder.Services.AddSwaggerGen();
11 |
12 | var app = builder.Build();
13 |
14 | // Configure the HTTP request pipeline.
15 | if (app.Environment.IsDevelopment())
16 | {
17 | app.UseSwagger();
18 | app.UseSwaggerUI();
19 | }
20 |
21 | app.UseHttpsRedirection();
22 |
23 | app.UseAuthorization();
24 |
25 | app.MapControllers();
26 |
27 | app.Run();
28 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/WebAPI/WeatherForecast.cs:
--------------------------------------------------------------------------------
1 | namespace WebAPIOne;
2 |
3 | public class WeatherForecast
4 | {
5 | public DateTime Date { get; set; }
6 |
7 | public int TemperatureC { get; set; }
8 |
9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10 |
11 | public string? Summary { get; set; }
12 | }
13 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/WebAPI/WebAPI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/WebAPI/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/WebAPI/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/examples/ReReleaseNuGet/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/.gitignore:
--------------------------------------------------------------------------------
1 | secrets.json
2 | Pkgs/*
3 | nuget.config
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/Program.cs:
--------------------------------------------------------------------------------
1 | using ServiceProfilerInWorkerNet6;
2 |
3 | IHost host = Host.CreateDefaultBuilder(args)
4 | .ConfigureLogging(logging =>
5 | {
6 | logging.AddSimpleConsole(c =>
7 | {
8 | c.SingleLine = true;
9 | });
10 | })
11 | .ConfigureServices(services =>
12 | {
13 | services.AddApplicationInsightsTelemetryWorkerService();
14 | services.AddServiceProfiler();
15 |
16 | services.AddHostedService();
17 | })
18 | .Build();
19 |
20 | await host.RunAsync();
21 |
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/ServiceProfilerInWorkerNet6.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | enable
7 | dotnet-ServiceProfilerInWorkerNet6-0ce04438-b60a-43d1-9a0f-c7acd9e40d4b
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/Worker.cs:
--------------------------------------------------------------------------------
1 | using HeavyArrayForecast;
2 | using Microsoft.ApplicationInsights;
3 | using Microsoft.ApplicationInsights.DataContracts;
4 |
5 | namespace ServiceProfilerInWorkerNet6;
6 |
7 | public class Worker : BackgroundService
8 | {
9 | private readonly TelemetryClient _telemetryClient;
10 | private readonly ILogger _logger;
11 |
12 | public Worker(
13 | TelemetryClient telemetryClient,
14 | ILogger logger)
15 | {
16 | _telemetryClient = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));
17 | _logger = logger;
18 | }
19 |
20 | protected override async Task ExecuteAsync(CancellationToken stoppingToken)
21 | {
22 | while (!stoppingToken.IsCancellationRequested)
23 | {
24 | _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
25 |
26 | // These request operations will be captured by the profiler
27 | using (_telemetryClient.StartOperation("operation"))
28 | {
29 | _ = WeatherForecastHelper.GetForecasts();
30 | _logger.LogInformation("Wether reported.");
31 | }
32 |
33 | // Wait for 10 seconds, do not repeat too frequently.
34 | await Task.Delay(TimeSpan.FromSeconds(10), stoppingToken);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.Hosting.Lifetime": "Information"
6 | }
7 | },
8 | "ServiceProfiler":{
9 | "Duration": "00:00:15"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.Hosting.Lifetime": "Information"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/examples/ServiceProfilerInWorkerNet6/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "6.0.401",
4 | "rollForward": "latestMinor"
5 | }
6 | }
--------------------------------------------------------------------------------
/media/CodeOptimizations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/CodeOptimizations.png
--------------------------------------------------------------------------------
/media/OnDemandProfilerTrace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/OnDemandProfilerTrace.png
--------------------------------------------------------------------------------
/media/OneTimeProfilerTrace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/OneTimeProfilerTrace.png
--------------------------------------------------------------------------------
/media/Troubleshoot-UploaderCannotBeExtracted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/Troubleshoot-UploaderCannotBeExtracted.png
--------------------------------------------------------------------------------
/media/Troubleshoot-UploaderLocator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/Troubleshoot-UploaderLocator.png
--------------------------------------------------------------------------------
/media/issue-enable-profiler.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/issue-enable-profiler.PNG
--------------------------------------------------------------------------------
/media/performance-blade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/performance-blade.png
--------------------------------------------------------------------------------
/media/profiler-traces.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/microsoft/ApplicationInsights-Profiler-AspNetCore/019e9c696a2bcc3256ff98cb2fb95b7cc30bbeb1/media/profiler-traces.png
--------------------------------------------------------------------------------