├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── APM_Dependencies.png ├── APM_Errors.png ├── APM_Inventory.png ├── APM_Logs.png ├── APM_Overview.png ├── APM_ServiceMap.png ├── APM_Transactions.png ├── APM_TransactionsFrontJavaScriptService.png ├── APM_TransactionsTraceLogs.png ├── APM_TransactionsTraceTimeline.png ├── APM_UserExperience_Dashboard.png ├── HealthChecks_Discover_Heartbeat.png ├── HealthChecks_Discover_Metricbeat.png ├── HealthChecks_Uptime.png ├── Logs_Correlation_Discover.png ├── Logs_Discover.png ├── Metrics_Discover.png ├── Metrics_Explorer.png ├── Readme.md └── src ├── NetApi.Elastic ├── Controllers │ ├── PersonsController.cs │ └── WeatherForecastController.cs ├── Dockerfile ├── Extensions │ └── CustomExtensions.cs ├── Models │ ├── Person.cs │ └── WeatherForecast.cs ├── NetApi.Elastic.csproj ├── Program.cs ├── Startup.cs ├── appsettings.Development.json └── appsettings.json └── NetClient.Elastic ├── App.razor ├── Dockerfile ├── Extensions └── CustomExtensions.cs ├── Models └── Person.cs ├── NetClient.Elastic.csproj ├── Pages ├── Counter.razor ├── FetchData.razor ├── Index.razor ├── _Host.cshtml └── _Layout.cshtml ├── Program.cs ├── Services └── IPersonApiService.cs ├── Settings.cs ├── Shared ├── MainLayout.razor ├── MainLayout.razor.css ├── NavMenu.razor ├── NavMenu.razor.css └── SurveyPrompt.razor ├── Startup.cs ├── Tasks └── DataService.cs ├── _Imports.razor ├── appsettings.Development.json ├── appsettings.json └── wwwroot ├── css ├── bootstrap │ ├── bootstrap.min.css │ └── bootstrap.min.css.map ├── open-iconic │ ├── FONT-LICENSE │ ├── ICON-LICENSE │ ├── README.md │ └── font │ │ ├── css │ │ └── open-iconic-bootstrap.min.css │ │ └── fonts │ │ ├── open-iconic.eot │ │ ├── open-iconic.otf │ │ ├── open-iconic.svg │ │ ├── open-iconic.ttf │ │ └── open-iconic.woff └── site.css ├── favicon.ico ├── icon-192.png ├── index.html ├── js └── elastic-apm-rum.umd.min.js └── sample-data └── weather.json /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch API (Development)", 6 | "type": "coreclr", 7 | "request": "launch", 8 | "preLaunchTask": "build-api", 9 | "program": "${workspaceFolder}/src/NetApi.Elastic/bin/Debug/net6.0/NetApi.Elastic.dll", 10 | "args": [], 11 | "cwd": "${workspaceFolder}/src/NetApi.Elastic/", 12 | "console" : "externalTerminal", 13 | "stopAtEntry": false, 14 | "env": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_URLS": "http://+:8090;https://+:8091", 17 | } 18 | }, 19 | { 20 | "name": "Launch Client (Development)", 21 | "type": "coreclr", 22 | "request": "launch", 23 | "preLaunchTask": "build-client", 24 | "program": "${workspaceFolder}/src/NetClient.Elastic/bin/Debug/net6.0/NetClient.Elastic.dll", 25 | "args": [], 26 | "cwd": "${workspaceFolder}/src/NetClient.Elastic/", 27 | "console" : "externalTerminal", 28 | "stopAtEntry": false, 29 | "env": { 30 | "ASPNETCORE_ENVIRONMENT": "Development", 31 | "ASPNETCORE_URLS": "http://+:8080;https://+:8081", 32 | } 33 | }, 34 | { 35 | "name": "Launch API (Production)", 36 | "type": "coreclr", 37 | "request": "launch", 38 | "preLaunchTask": "build-api", 39 | "program": "${workspaceFolder}/src/NetApi.Elastic/bin/Debug/net6.0/NetApi.Elastic.dll", 40 | "args": [], 41 | "cwd": "${workspaceFolder}/src/NetApi.Elastic/", 42 | "console" : "externalTerminal", 43 | "stopAtEntry": false, 44 | "env": { 45 | "ASPNETCORE_ENVIRONMENT": "Production", 46 | "ASPNETCORE_URLS": "http://+:8090;https://+:8091", 47 | } 48 | }, 49 | { 50 | "name": "Launch Client (Production)", 51 | "type": "coreclr", 52 | "request": "launch", 53 | "preLaunchTask": "build-client", 54 | "program": "${workspaceFolder}/src/NetClient.Elastic/bin/Debug/net6.0/NetClient.Elastic.dll", 55 | "args": [], 56 | "cwd": "${workspaceFolder}/src/NetClient.Elastic/", 57 | "console" : "externalTerminal", 58 | "stopAtEntry": false, 59 | "env": { 60 | "ASPNETCORE_ENVIRONMENT": "Production", 61 | "ASPNETCORE_URLS": "http://+:8080;https://+:8081", 62 | } 63 | }, 64 | { 65 | "name": "Docker API (Development)", 66 | "type": "docker", 67 | "request": "launch", 68 | "preLaunchTask": "docker-run-api: debug", 69 | "netCore": { 70 | "appProject": "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj" 71 | } 72 | }, 73 | { 74 | "name": "Docker Client (Development)", 75 | "type": "docker", 76 | "request": "launch", 77 | "preLaunchTask": "docker-run-client: debug", 78 | "netCore": { 79 | "appProject": "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj" 80 | } 81 | }, 82 | { 83 | "name": "Docker API (Production)", 84 | "type": "docker", 85 | "request": "launch", 86 | "preLaunchTask": "docker-run-api: release", 87 | "netCore": { 88 | "appProject": "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj" 89 | } 90 | }, 91 | { 92 | "name": "Docker Client (Production)", 93 | "type": "docker", 94 | "request": "launch", 95 | "preLaunchTask": "docker-run-client: release", 96 | "netCore": { 97 | "appProject": "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj" 98 | } 99 | } 100 | ], 101 | "compounds": [ 102 | { 103 | "name": "Launch Api/Client (Development)", 104 | "configurations": ["Launch API (Development)", "Launch Client (Development)"] 105 | }, 106 | { 107 | "name": "Launch Api/Client (Production)", 108 | "configurations": ["Launch API (Production)", "Launch Client (Production)"] 109 | }, 110 | { 111 | "name": "Docker Api/Client (Development)", 112 | "configurations": ["Docker API (Development)", "Docker Client (Development)"] 113 | }, 114 | { 115 | "name": "Docker Api/Client (Production)", 116 | "configurations": ["Docker API (Production)", "Docker Client (Production)"] 117 | } 118 | ] 119 | } -------------------------------------------------------------------------------- /.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": "clean-api", 8 | "command": "dotnet", 9 | "type": "process", 10 | "args": [ 11 | "clean", 12 | "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj", 13 | "/property:GenerateFullPaths=true", 14 | "/consoleloggerparameters:NoSummary" 15 | ], 16 | "problemMatcher": "$msCompile" 17 | }, 18 | { 19 | "label": "clean-client", 20 | "command": "dotnet", 21 | "type": "process", 22 | "args": [ 23 | "clean", 24 | "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj", 25 | "/property:GenerateFullPaths=true", 26 | "/consoleloggerparameters:NoSummary" 27 | ], 28 | "problemMatcher": "$msCompile" 29 | }, 30 | { 31 | "label": "build-api", 32 | "command": "dotnet", 33 | "type": "process", 34 | "dependsOn": [ 35 | "clean-api" 36 | ], 37 | "args": [ 38 | "build", 39 | "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj", 40 | "/property:GenerateFullPaths=true", 41 | "/consoleloggerparameters:NoSummary" 42 | ], 43 | "problemMatcher": "$msCompile", 44 | "group": { 45 | "kind": "build", 46 | "isDefault": true 47 | } 48 | }, 49 | { 50 | "label": "build-client", 51 | "command": "dotnet", 52 | "type": "process", 53 | "dependsOn": [ 54 | "clean-client" 55 | ], 56 | "args": [ 57 | "build", 58 | "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj", 59 | "/property:GenerateFullPaths=true", 60 | "/consoleloggerparameters:NoSummary" 61 | ], 62 | "problemMatcher": "$msCompile", 63 | "group": { 64 | "kind": "build", 65 | "isDefault": true 66 | } 67 | }, 68 | { 69 | "type": "docker-build", 70 | "label": "docker-build-api: debug", 71 | "dependsOn": [ 72 | "build-api" 73 | ], 74 | "dockerBuild": { 75 | "tag": "netapi-elastic:dev", 76 | "target": "base", 77 | "dockerfile": "${workspaceFolder}/src/NetApi.Elastic/Dockerfile", 78 | "context": "${workspaceFolder}/src/NetApi.Elastic", 79 | "pull": true 80 | }, 81 | "netCore": { 82 | "appProject": "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj" 83 | } 84 | }, 85 | { 86 | "type": "docker-build", 87 | "label": "docker-build-client: debug", 88 | "dependsOn": [ 89 | "build-client" 90 | ], 91 | "dockerBuild": { 92 | "tag": "netclient-elastic:dev", 93 | "target": "base", 94 | "dockerfile": "${workspaceFolder}/src/NetClient.Elastic/Dockerfile", 95 | "context": "${workspaceFolder}/src/NetClient.Elastic", 96 | "pull": true 97 | }, 98 | "netCore": { 99 | "appProject": "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj" 100 | } 101 | }, 102 | { 103 | "type": "docker-build", 104 | "label": "docker-build-api: release", 105 | "dockerBuild": { 106 | "tag": "netapi-elastic:latest", 107 | "dockerfile": "${workspaceFolder}/src/NetApi.Elastic/Dockerfile", 108 | "context": "${workspaceFolder}/src/NetApi.Elastic", 109 | "pull": true 110 | }, 111 | "netCore": { 112 | "appProject": "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj" 113 | } 114 | }, 115 | { 116 | "type": "docker-build", 117 | "label": "docker-build-client: release", 118 | "dockerBuild": { 119 | "tag": "netclient-elastic:latest", 120 | "dockerfile": "${workspaceFolder}/src/NetClient.Elastic/Dockerfile", 121 | "context": "${workspaceFolder}/src/NetClient.Elastic", 122 | "pull": true 123 | }, 124 | "netCore": { 125 | "appProject": "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj" 126 | } 127 | }, 128 | { 129 | "type": "docker-run", 130 | "label": "docker-run-api: debug", 131 | "dependsOn": [ 132 | "docker-build-api: debug" 133 | ], 134 | "dockerRun": { 135 | "containerName": "netapi-elastic", 136 | "ports": [ 137 | { 138 | "hostPort": 8090, 139 | "containerPort": 80 140 | } 141 | ], 142 | "env": { 143 | "ASPNETCORE_ENVIRONMENT": "Development" 144 | }, 145 | "extraHosts": [ 146 | { 147 | "hostname": "host.docker.internal", 148 | "ip": "host-gateway" 149 | } 150 | ] 151 | }, 152 | "netCore": { 153 | "appProject": "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj", 154 | "enableDebugging": true 155 | } 156 | }, 157 | { 158 | "type": "docker-run", 159 | "label": "docker-run-client: debug", 160 | "dependsOn": [ 161 | "docker-build-client: debug" 162 | ], 163 | "dockerRun": { 164 | "containerName": "netclient-elastic", 165 | "ports": [ 166 | { 167 | "hostPort": 8080, 168 | "containerPort": 80 169 | } 170 | ], 171 | "env": { 172 | "ASPNETCORE_ENVIRONMENT": "Development" 173 | }, 174 | "extraHosts": [ 175 | { 176 | "hostname": "host.docker.internal", 177 | "ip": "host-gateway" 178 | } 179 | ] 180 | }, 181 | "netCore": { 182 | "appProject": "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj", 183 | "enableDebugging": true 184 | } 185 | }, 186 | { 187 | "type": "docker-run", 188 | "label": "docker-run-api: release", 189 | "dependsOn": [ 190 | "docker-build-api: release" 191 | ], 192 | "dockerRun": { 193 | "containerName": "netapi-elastic", 194 | "ports": [ 195 | { 196 | "hostPort": 8090, 197 | "containerPort": 80 198 | } 199 | ], 200 | "volumes": [ 201 | { 202 | "localPath": "${userHome}/.vsdbg", 203 | "containerPath": "/remote_debugger", 204 | "permissions": "ro" 205 | } 206 | ], 207 | "env": { 208 | "ASPNETCORE_ENVIRONMENT": "Production" 209 | }, 210 | "extraHosts": [ 211 | { 212 | "hostname": "host.docker.internal", 213 | "ip": "host-gateway" 214 | } 215 | ] 216 | }, 217 | "netCore": { 218 | "appProject": "${workspaceFolder}/src/NetApi.Elastic/NetApi.Elastic.csproj", 219 | "enableDebugging": false 220 | } 221 | }, 222 | { 223 | "type": "docker-run", 224 | "label": "docker-run-client: release", 225 | "dependsOn": [ 226 | "docker-build-client: release" 227 | ], 228 | "dockerRun": { 229 | "containerName": "netclient-elastic", 230 | "ports": [ 231 | { 232 | "hostPort": 8080, 233 | "containerPort": 80 234 | } 235 | ], 236 | "volumes": [ 237 | { 238 | "localPath": "${userHome}/.vsdbg", 239 | "containerPath": "/remote_debugger", 240 | "permissions": "ro" 241 | } 242 | ], 243 | "env": { 244 | "ASPNETCORE_ENVIRONMENT": "Production" 245 | }, 246 | "extraHosts": [ 247 | { 248 | "hostname": "host.docker.internal", 249 | "ip": "host-gateway" 250 | } 251 | ] 252 | }, 253 | "netCore": { 254 | "appProject": "${workspaceFolder}/src/NetClient.Elastic/NetClient.Elastic.csproj", 255 | "enableDebugging": false 256 | } 257 | } 258 | ] 259 | } -------------------------------------------------------------------------------- /APM_Dependencies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_Dependencies.png -------------------------------------------------------------------------------- /APM_Errors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_Errors.png -------------------------------------------------------------------------------- /APM_Inventory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_Inventory.png -------------------------------------------------------------------------------- /APM_Logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_Logs.png -------------------------------------------------------------------------------- /APM_Overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_Overview.png -------------------------------------------------------------------------------- /APM_ServiceMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_ServiceMap.png -------------------------------------------------------------------------------- /APM_Transactions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_Transactions.png -------------------------------------------------------------------------------- /APM_TransactionsFrontJavaScriptService.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_TransactionsFrontJavaScriptService.png -------------------------------------------------------------------------------- /APM_TransactionsTraceLogs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_TransactionsTraceLogs.png -------------------------------------------------------------------------------- /APM_TransactionsTraceTimeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_TransactionsTraceTimeline.png -------------------------------------------------------------------------------- /APM_UserExperience_Dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/APM_UserExperience_Dashboard.png -------------------------------------------------------------------------------- /HealthChecks_Discover_Heartbeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/HealthChecks_Discover_Heartbeat.png -------------------------------------------------------------------------------- /HealthChecks_Discover_Metricbeat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/HealthChecks_Discover_Metricbeat.png -------------------------------------------------------------------------------- /HealthChecks_Uptime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/HealthChecks_Uptime.png -------------------------------------------------------------------------------- /Logs_Correlation_Discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/Logs_Correlation_Discover.png -------------------------------------------------------------------------------- /Logs_Discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/Logs_Discover.png -------------------------------------------------------------------------------- /Metrics_Discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/Metrics_Discover.png -------------------------------------------------------------------------------- /Metrics_Explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/Metrics_Explorer.png -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | - [Context](#context) 2 | - [Logs (via Serilog)](#logs-via-serilog) 3 | - [What is Serilog?](#what-is-serilog) 4 | - [NuGet packages](#nuget-packages) 5 | - [Serilog implementation](#serilog-implementation) 6 | - [Serilog configuration](#serilog-configuration) 7 | - [Writing logs](#writing-logs) 8 | - [Sending logs to Elasticsearch](#sending-logs-to-elasticsearch) 9 | - [Analyse logs in Kibana](#analyse-logs-in-kibana) 10 | - [Health checks (via Microsoft AspNetCore HealthChecks)](#health-checks-via-microsoft-aspnetcore-healthchecks) 11 | - [What are health checks?](#what-are-health-checks) 12 | - [NuGet packages](#nuget-packages-1) 13 | - [Health checks implementation](#health-checks-implementation) 14 | - [Sending health checks to Elasticsearch](#sending-health-checks-to-elasticsearch) 15 | - [Analyse health checks in Kibana](#analyse-health-checks-in-kibana) 16 | - [Metrics (via Prometheus)](#metrics-via-prometheus) 17 | - [What is Prometheus?](#what-is-prometheus) 18 | - [NuGet packages](#nuget-packages-2) 19 | - [Prometheus implementation](#prometheus-implementation) 20 | - [Forward Health checks to Prometheus](#forward-health-checks-to-prometheus) 21 | - [Business metrics](#business-metrics) 22 | - [Sending metrics to Elasticsearch](#sending-metrics-to-elasticsearch) 23 | - [Analyse metrics in Kibana](#analyse-metrics-in-kibana) 24 | - [Traces (via Elastic APM / RUM agent)](#traces-via-elastic-apm--rum-agent) 25 | - [What is Elastic APM / RUM agent?](#what-is-elastic-apm--rum-agent) 26 | - [Supported technologies](#supported-technologies) 27 | - [Elastic APM agent implementation](#elastic-apm-agent-implementation) 28 | - [Profiler auto instrumentation](#profiler-auto-instrumentation) 29 | - [NuGet - Zero code change setup](#nuget---zero-code-change-setup) 30 | - [NuGet - .Net Core setup](#nuget---net-core--setup) 31 | - [Elastic RUM agent implementation](#elastic-rum-agent-implementation) 32 | - [Sending traces to Elasticsearch](#sending-traces-to-elasticsearch) 33 | - [Analyse traces in Kibana](#analyse-traces-in-kibana) 34 | 35 | # Context 36 | 37 | The purpose of this application is to show how to integrate: 38 | 39 | - logs (via Serilog) 40 | - health checks (via Microsoft AspNetCore HealthChecks) 41 | - business metrics (via Prometheus) 42 | - traces (via Elastic APM) 43 | 44 | to an Elasticsearch cluster with .Net. 45 | 46 | There are two projects : 47 | 48 | - NetApi.Elastic : a Web API that exposes mainly an endpoint /persons and also a swagger endpoint in Development mode 49 | - NetClient.Elastic : a Web client with some razor pages on / and a persons view which interact with NetApi.Elastic 50 | 51 | # Logs (via Serilog) 52 | 53 | ## What is Serilog? 54 | 55 | Like many other libraries for .NET, Serilog provides diagnostic logging to files, the console, and elsewhere. It is easy to set up, has a clean API, and is portable between recent .NET platforms. Unlike other logging libraries, Serilog is built with powerful structured event data in mind. 56 | 57 | Source : [Serilog.net](https://serilog.net/) 58 | 59 | ## NuGet packages 60 | 61 | Following Serilog NuGet packages are used to immplement logging: 62 | 63 | - [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore): routes ASP.NET Core log messages through Serilog. 64 | 65 | - [Serilog.Enrichers.Environment](https://github.com/serilog/serilog-enrichers-environment): enriches Serilog events with information from the process environment. 66 | 67 | - [Serilog.Settings.Configuration](https://github.com/serilog/serilog-settings-configuration): reads configuration from Microsoft.Extensions.Configuration sources, including .NET Core's appsettings.json file. 68 | 69 | - [Serilog.Sinks.Console](https://github.com/serilog/serilog-sinks-console): writes log events to the Windows Console or an ANSI terminal via standard output. 70 | 71 | Following Elastic NuGet package is used to properly format logs for Elasticsearch: 72 | 73 | - [Elastic.CommonSchema.Serilog](https://github.com/elastic/ecs-dotnet): formats a Serilog event into a JSON representation that adheres to the Elastic Common Schema. 74 | 75 | ## Serilog implementation 76 | 77 | First, you have to add the following packages in your csproj file (you can update the version to the latest available for your .Net version). 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Then, you have to define Serilog as your log provider. In your Program.cs file, add the ConfigureLogging and UseSerilog as described below: 86 | 87 | public static IHost BuildHost(string[] args) => 88 | Host.CreateDefaultBuilder(args) 89 | .ConfigureLogging((host, builder) => builder.ClearProviders().AddSerilog(host.Configuration)) 90 | .UseSerilog() 91 | .UseServiceProviderFactory(new AutofacServiceProviderFactory()) 92 | .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) 93 | .Build(); 94 | 95 | The UseSerilog method sets Serilog as the logging provider. The AddSerilog method is a custom extension which will add Serilog to the logging pipeline and read the configuration from host configuration: 96 | 97 | public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, IConfiguration configuration) 98 | { 99 | Log.Logger = new LoggerConfiguration() 100 | .ReadFrom.Configuration(configuration) 101 | .CreateLogger(); 102 | 103 | builder.AddSerilog(); 104 | 105 | return builder; 106 | } 107 | 108 | When using the default middleware for HTTP request logging, it will write HTTP request information like method, path, timing, status code and exception details in several events. To avoid this and use streamlined request logging, you can use the middleware provided by Serilog. Add UseSerilogRequestLogging in Startup.cs before any handlers whose activities should be logged. 109 | 110 | public void Configure(IApplicationBuilder app) 111 | { 112 | app.UseRouting(); 113 | app.UseSerilogRequestLogging(); 114 | 115 | app.UseEndpoints(endpoints => 116 | { 117 | /// ... 118 | }); 119 | 120 | // ... 121 | } 122 | 123 | ## Serilog configuration 124 | 125 | As the Serilog configuration is read from host configuration, we will now set all configuration we need to the appsettings file. 126 | 127 | In Production environment, we will prepare logs for Elasticsearch ingestion, so use JSON format and add all needed information to logs. 128 | 129 | { 130 | "Serilog": { 131 | "Using": [], 132 | "MinimumLevel": { 133 | "Default": "Warning", 134 | "Override": { 135 | "Microsoft.Hosting": "Information", 136 | "NetClient.Elastic": "Information" 137 | } 138 | }, 139 | "Enrich": ["FromLogContext", "WithMachineName", "WithEnvironmentUserName", "WithEnvironmentName", "WithProcessId", "WithThreadId"], 140 | "Properties": { 141 | "Domain": "NetClient", 142 | "DomainContext": "NetClient.Elastic" 143 | }, 144 | "WriteTo": [ 145 | { 146 | "Name": "Console", 147 | "Args": { 148 | "formatter": "Elastic.CommonSchema.Serilog.EcsTextFormatter, Elastic.CommonSchema.Serilog" 149 | } 150 | } 151 | ] 152 | }, 153 | // ... 154 | } 155 | 156 | This configuration will: 157 | 158 | - set default log level to Warning except for "Microsoft.Hosting" and "NetClient.Elastic" (our application) namespaces which will be Information 159 | - enrich log with log context, machine name, and some other useful data when available 160 | - add custom properties to each log event : Domain and DomainContext 161 | - write logs to console, using the Elastic JSON formatter for Serilog 162 | 163 | In Development environment, generally, we won't want to display our logs in JSON format and we will prefer having minimal log level to Debug for our application, so, we will override this in the appsettings.Development.json file: 164 | 165 | { 166 | "Serilog": { 167 | "MinimumLevel": { 168 | "Override": { 169 | "NetClient.Elastic": "Debug" 170 | } 171 | }, 172 | "WriteTo": [ 173 | { 174 | "Name": "Console", 175 | "Args": { 176 | "outputTemplate": "-> [{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}" 177 | } 178 | } 179 | ] 180 | } 181 | } 182 | 183 | ## Writing logs 184 | 185 | Serilog is configured to use *Microsoft.Extensions.Logging.ILogger* interface. You can retrieve an instance of ILogger anywhere in your code with .Net IoC container: 186 | 187 | public PersonsController(ILogger logger) 188 | { 189 | _logger = logger; 190 | } 191 | 192 | You can add a simple log by using: 193 | 194 | _logger.LogDebug("Getting persons"); 195 | 196 | Serilog supports destructuring, allowing simple property or complex objects to be passed as parameters in your logs: 197 | 198 | # with a simple property: 199 | _logger.LogInformation("Person with id {Id} updated", id); 200 | 201 | # with a complex object: 202 | _logger.LogInformation("Person {@person} added", person); 203 | 204 | This can be very useful for example in a CQRS application to log queries and commands. 205 | 206 | See [Serilog documentation](https://github.com/serilog/serilog/wiki) for all information. 207 | 208 | In some case, you don't want a field from a complex object to be stored in you logs (for example, a password in a login command) or you may want to store the field with another name in your logs. You can use the NuGet [Destructurama.Attributed](https://github.com/destructurama/attributed) for these use cases. 209 | 210 | Add the NuGet in your csproj: 211 | 212 | 213 | 214 | Update the logger configuration in the AddSerilog extension method with the *.Destructure.UsingAttributes()* method: 215 | 216 | Log.Logger = new LoggerConfiguration() 217 | .ReadFrom.Configuration(configuration) 218 | .Destructure.UsingAttributes() 219 | .CreateLogger(); 220 | 221 | You can now add any attributes from Destructurama as [NotLogged] on your properties: 222 | 223 | [NotLogged] 224 | public string Password { get; set; } 225 | 226 | ## Sending logs to Elasticsearch 227 | 228 | All the logs are written in the console, and, as we use docker to deploy our application, they will be readable by using: 229 | 230 | docker container logs netclient-elastic 231 | 232 | To send the logs to Elasticseach, you will have to configure a filebeat agent (for example, with docker autodiscover): 233 | 234 | filebeat.autodiscover: 235 | providers: 236 | - type: docker 237 | hints.enabled: true 238 | hints.default_config: 239 | type: container 240 | paths: 241 | - /var/lib/docker/containers/${data.container.id}/*.log 242 | processors: 243 | - decode_json_fields: 244 | fields: ["message"] 245 | process_array: false 246 | max_depth: 1 247 | target: "" 248 | overwrite_keys: true 249 | add_error_key: true 250 | 251 | But if your logs are stored on the filesystem, you can easily use the filestream input of filebeat. 252 | 253 | For more information about this filebeat configuration, you can have a look to : https://github.com/ijardillier/docker-elk/blob/master/extensions/beats/filebeat/config/filebeat.yml 254 | 255 | ## Analyse logs in Kibana 256 | 257 | You can check how logs are ingested in the Discover module: 258 | 259 | ![Logs on Discover](Logs_Discover.png) 260 | 261 | Fields present in our logs and compliant with ECS are automatically set (@timestamp, log.level, event.action, message, ...) thanks to the EcsTextFormatter. 262 | Added fields like *domain*, *domain_context*, *id* or *person* in our logs are stored in the metadata object (flattened). 263 | 264 | The log level is dependant of the method used in the code (Verbose, Debug, Information, Warning, Error, Fatal). It is stored as keyword so you can easily use it for filtering, aggregation, .... You can find all error logs with (in KQL): 265 | 266 | log.level: "Error" 267 | 268 | We can see that, for the added action log, Serilog automatically generate *message* field with all properties defined in the person instance (except the Email property, which is tagged as *NotLogged*), due to destructuring. In this case, metadata are stored as following: 269 | 270 | { 271 | "message_template": "Person {@person} added", 272 | "request_id": "0HMPG79NSQK0U:00000008", 273 | "connection_id": "0HMPG79NSQK0U", 274 | "environment_name": "Production", 275 | "elastic_apm_transaction_id": "260cc4ce2c425d5b", 276 | "domain_context": "NetApi.Elastic", 277 | "person": { 278 | "id": 7, 279 | "full_name": "Anil", 280 | "city": "Tokyo", 281 | "country": "Japan", 282 | "$type": "Person" 283 | }, 284 | "request_path": "/api/v1.0/persons", 285 | "elastic_apm_trace_id": "5a2e6f2ccb298b5b2eeea36772933094", 286 | "domain": "NetApi" 287 | } 288 | 289 | This field is queryable by using, for example (in KQL): 290 | 291 | metadata.person.country : "Japan" 292 | 293 | # Health checks (via Microsoft AspNetCore HealthChecks) 294 | 295 | ## What are health checks? 296 | 297 | ASP.NET Core offers Health Checks Middleware and libraries for reporting the health of app infrastructure components. 298 | 299 | Health checks are exposed by an app as HTTP endpoints. Health check endpoints can be configured for various real-time monitoring scenarios: 300 | 301 | - Health probes can be used by container orchestrators and load balancers to check an app's status. For example, a container orchestrator may respond to a failing health check by halting a rolling deployment or restarting a container. A load balancer might react to an unhealthy app by routing traffic away from the failing instance to a healthy instance. 302 | - Use of memory, disk, and other physical server resources can be monitored for healthy status. 303 | - Health checks can test an app's dependencies, such as databases and external service endpoints, to confirm availability and normal functioning. 304 | 305 | Health checks are typically used with an external monitoring service or container orchestrator to check the status of an app. Before adding health checks to an app, decide on which monitoring system to use. The monitoring system dictates what types of health checks to create and how to configure their endpoints. 306 | 307 | Source : [Health checks in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-6.0) 308 | 309 | ## NuGet packages 310 | 311 | Following Xabaril NuGet package is used: 312 | 313 | - [AspNetCore.HealthChecks.UI.Client](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks#configuration): formats health checks endpoint response in a JSON representation. 314 | 315 | There are a lot of NuGet packages provided by [Xabaril](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks) which can help you to add health checks for your application dependencies: Azure services, databases, events bus, network, ... 316 | 317 | ## Health checks implementation 318 | 319 | First, you have to add the following packages in your csproj file (you can update the version to the latest available for your .Net version): 320 | 321 | 322 | 323 | Then, you have to register the HealthCheck service. This is done here in a custom extension which is used in the ConfigureServices of the Startup file: 324 | 325 | public virtual void ConfigureServices(IServiceCollection services) 326 | { 327 | // ... 328 | services.AddCustomHealthCheck(Configuration) 329 | // ... 330 | } 331 | 332 | public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) 333 | { 334 | IHealthChecksBuilder hcBuilder = services.AddHealthChecks(); 335 | hcBuilder.AddCheck("self", () => HealthCheckResult.Healthy()); 336 | return services; 337 | } 338 | 339 | This "self" check is just here to say that if the endpoint responds (the application is alive). You can also manage Unhealthy and Degraded mode if needed. 340 | 341 | The third step is to map endpoints for health checks: 342 | 343 | public void Configure(IApplicationBuilder app) 344 | { 345 | app.UseRouting(); 346 | // ... 347 | 348 | app.UseEndpoints(endpoints => 349 | { 350 | endpoints.MapHealthChecks("/liveness", new HealthCheckOptions 351 | { 352 | Predicate = r => r.Name.Contains("self") 353 | }); 354 | 355 | endpoints.MapHealthChecks("/hc", new HealthCheckOptions() 356 | { 357 | Predicate = _ => true, 358 | ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse 359 | }); 360 | }); 361 | } 362 | 363 | The first map exposes the /liveness endpoint with the self check described in the previous section. 364 | 365 | The result of a call to http://localhost:8080/liveness will just be: 366 | 367 | Status code : 200 (Ok) 368 | Content : Healthy 369 | 370 | The second map exposes the /hc endpoint with an aggregation of all health checks defined in a JSON format. 371 | 372 | The result of a call to http://localhost:8080/hc will be: 373 | 374 | Status code : 200 (Ok) 375 | Content : {"status":"Healthy","totalDuration":"00:00:00.0027779","entries":{"self":{"data":{},"duration":"00:00:00.0008869","status":"Healthy","tags":[]}}} 376 | 377 | ## Sending health checks to Elasticsearch 378 | 379 | All the health checks are available on the /hc endpoint. 380 | 381 | To send the health checks to Elasticseach, you will have to configure a metricbeat agent with http module: 382 | 383 | metricbeat.modules: 384 | - module: http 385 | metricsets: 386 | - json 387 | period: 10s 388 | hosts: ["host.docker.internal:8080"] 389 | namespace: "healthcheck" 390 | path: "/hc" 391 | 392 | For more information about this metricbeat configuration, you can have a look to: https://github.com/ijardillier/docker-elk/blob/master/extensions/beats/metricbeat/config/metricbeat.yml 393 | 394 | You can also use heartbeat agent and the /liveness endpoint in order to use the Uptime app in Kibana: 395 | 396 | heartbeat.monitors: 397 | - type: http 398 | id: http-monitor 399 | name: HTTP Monitor 400 | schedule: '@every 5s' # every 5 seconds from start of beat 401 | urls: 402 | - "http://host.docker.internal:8080/liveness" 403 | 404 | For more information about this heartbeat configuration, you can have a look to: https://github.com/ijardillier/docker-elk/blob/master/extensions/beats/heartbeat/config/heartbeat.yml 405 | 406 | When using Prometheus, it is possible to forward health checks metrics to Prometheus endpoint, and retrieve it with the same configuration of metricbeat, in a prometheus module. We will implement this in the next article. 407 | 408 | ## Analyse health checks in Kibana 409 | 410 | You can check how health checks are ingested in the Discover module: 411 | 412 | With Metricbeat: 413 | 414 | ![Health checks with Metricbeat on Discover](HealthChecks_Discover_Metricbeat.png) 415 | 416 | With Heartbeat: 417 | 418 | ![Health checks with Heartbeat on Discover](HealthChecks_Discover_Heartbeat.png) 419 | 420 | You can see how health checks are displayed in the Uptime App: 421 | 422 | ![Health checks on Uptime App](HealthChecks_Uptime.png) 423 | 424 | # Metrics (via Prometheus) 425 | 426 | ## What is Prometheus? 427 | 428 | Prometheus collects and stores its metrics as time series data, i.e. metrics information is stored with the timestamp at which it was recorded, alongside optional key-value pairs called labels. 429 | 430 | Source : [Prometheus](https://prometheus.io/) 431 | 432 | ## NuGet packages 433 | 434 | The following Prometheus for .Net NuGet packages are used: 435 | 436 | - [prometheus-net](https://github.com/prometheus-net/prometheus-net) 437 | - [prometheus-net.AspNetCore](https://github.com/prometheus-net/prometheus-net#aspnet-core-exporter-middleware) 438 | - [prometheus-net.AspNetCore.HealthChecks](https://github.com/prometheus-net/prometheus-net#aspnet-core-health-check-status-metrics) 439 | 440 | These are .NET libraries for instrumenting your applications and exporting metrics to Prometheus. 441 | 442 | ## Prometheus implementation 443 | 444 | First, you have to add the following packages in your csproj file (you can update the version to the latest available for your .Net version): 445 | 446 | 447 | 448 | 449 | 450 | By default, Prometheus .Net library add some application metrics about .Net (Memory, CPU, garbaging, ...). As we plan to use APM agent, we don't want it to add this metrics, so we can suppress them. We will also add some static labels to each metrics in order to be able to add contextual information from our application, as we did it for logs: 451 | 452 | public virtual void ConfigureServices(IServiceCollection services) 453 | { 454 | // ... 455 | 456 | Metrics.SuppressDefaultMetrics(); 457 | 458 | Metrics.DefaultRegistry.SetStaticLabels(new Dictionary 459 | { 460 | { "domain", "NetClient" }, 461 | { "domain_context", "NetClient.Elastic" } 462 | }); 463 | 464 | // ... 465 | } 466 | 467 | We also have to map endpoints for metrics: 468 | 469 | public void Configure(IApplicationBuilder app) 470 | { 471 | // ... 472 | 473 | app.UseEndpoints(endpoints => 474 | { 475 | // ... 476 | 477 | endpoints.MapMetrics(); 478 | }); 479 | } 480 | 481 | This map exposes the /metrics endpoint with the Prometheus format. 482 | If you need OpenMetrics format, you can easily access it with /metrics?accept=application/openmetrics-text 483 | 484 | The result is the below: 485 | 486 | # HELP aspnetcore_healthcheck_status ASP.NET Core health check status (0 == Unhealthy, 0.5 == Degraded, 1 == Healthy) 487 | # TYPE aspnetcore_healthcheck_status gauge 488 | aspnetcore_healthcheck_status{name="self",domain="NetClient",domain_context="NetClient.Elastic"} 1 489 | # HELP myapp_gauge1 A simple gauge 1 490 | # TYPE myapp_gauge1 gauge 491 | myapp_gauge1{service="service1",domain="NetClient",domain_context="NetClient.Elastic"} 1028 492 | # HELP myapp_gauge2 A simple gauge 2 493 | # TYPE myapp_gauge2 gauge 494 | myapp_gauge2{service="service1",domain="NetClient",domain_context="NetClient.Elastic"} 2403 495 | # HELP myapp_gauge3 A simple gauge 3 496 | # TYPE myapp_gauge3 gauge 497 | myapp_gauge3{service="service1",domain="NetClient",domain_context="NetClient.Elastic"} 3872 498 | ... 499 | 500 | ## Forward Health checks to Prometheus 501 | 502 | We can easily forward our health checks (described previously) to Prometheus endpoint, to avoid using http module from Metricbeat and retrieve all metrics including health checks from Metricbeat Prometheus module. By the way, we will also benefit from our static labels if defined. 503 | 504 | This is done here in our custom extension which is used in the ConfigureServices of the Startup file: 505 | 506 | public virtual void ConfigureServices(IServiceCollection services) 507 | { 508 | // ... 509 | services.AddCustomHealthCheck(Configuration) 510 | // ... 511 | } 512 | 513 | public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) 514 | { 515 | IHealthChecksBuilder hcBuilder = services.AddHealthChecks(); 516 | hcBuilder.AddCheck("self", () => HealthCheckResult.Healthy()); 517 | 518 | hcBuilder.ForwardToPrometheus(); 519 | 520 | return services; 521 | } 522 | 523 | ## Business metrics 524 | 525 | Prometheus .Net library offers an easy way to add business metrics. 526 | 527 | To create a new metric, you just have to instantiate an new counter, gauge, ...: 528 | 529 | private readonly Gauge Gauge1 = Metrics.CreateGauge("myapp_gauge1", "A simple gauge 1"); 530 | 531 | If you need to add attached labels, you have to add a configuration: 532 | 533 | private static readonly GaugeConfiguration configuration = new GaugeConfiguration { LabelNames = new[] { "service" }}; 534 | private readonly Gauge Gauge2 = Metrics.CreateGauge("myapp_gauge1", "A simple gauge 1", configuration); 535 | 536 | To apply a label and a value to a metric, use this kind of code: 537 | 538 | Gauge1.WithLabels("service1").Set(_random.Next(1000, 2000)); 539 | 540 | ## Sending metrics to Elasticsearch 541 | 542 | All the metrics are available on the /metrics endpoint. 543 | 544 | In our example, we don't have any Prometheus server, so metricbeat will directly access metrics from the application metrics endpoint. But if you have a Prometheus server, you can add a new target in your scrape configuration. 545 | 546 | So, to send the metrics to Elasticseach, you will have to configure a metricbeat agent with prometheus module: 547 | 548 | metricbeat.modules: 549 | - module: prometheus 550 | period: 10s 551 | metricsets: ["collector"] 552 | hosts: ["host.docker.internal:8080"] 553 | metrics_path: /metrics 554 | 555 | For more information about this metricbeat configuration, you can have a look to: https://github.com/ijardillier/docker-elk/blob/master/extensions/beats/metricbeat/config/metricbeat.yml 556 | 557 | ## Analyse metrics in Kibana 558 | 559 | You can check how metrics are ingested in the Discover module: 560 | 561 | ![Metrics on Discover](Metrics_Discover.png) 562 | 563 | You can see how metrics are displayed in the Metrics Explorer App: 564 | 565 | ![Metrics on Metrics Explorer App](Metrics_Explorer.png) 566 | 567 | # Traces (via Elastic APM / RUM agent) 568 | 569 | ## What is Elastic APM / RUM agent? 570 | 571 | The Elastic APM .NET Agent automatically measures the performance of your application and tracks errors. It has built-in support for the most popular frameworks, as well as a simple API which allows you to instrument any application. 572 | 573 | The agent auto-instruments supported technologies and records interesting events, like HTTP requests and database queries. To do this, it uses built-in capabilities of the instrumented frameworks like Diagnostic Source, an HTTP module for IIS, or IDbCommandInterceptor for Entity Framework. This means that for the supported technologies, there are no code changes required beyond enabling auto-instrumentation. 574 | 575 | Source : [APM .Net Agent](https://www.elastic.co/guide/en/apm/agent/dotnet/current/intro.html) 576 | 577 | Real User Monitoring captures user interaction with clients such as web browsers. The JavaScript Agent is Elastic’s RUM Agent. 578 | 579 | Unlike Elastic APM backend agents which monitor requests and responses, the RUM JavaScript agent monitors the real user experience and interaction within your client-side application. The RUM JavaScript agent is also framework-agnostic, which means it can be used with any front-end JavaScript application. 580 | 581 | You will be able to measure metrics such as "Time to First Byte", domInteractive, and domComplete which helps you discover performance issues within your client-side application as well as issues that relate to the latency of your server-side application. 582 | 583 | Source : [Real User Monitoring](https://www.elastic.co/guide/en/apm/guide/current/apm-rum.html) 584 | 585 | ## Supported technologies 586 | 587 | For APM agent, choosing between Profiler auto instrumentation and NuGet use will depend on your needs and supported technologies. 588 | 589 | See these page for more information: [Supported technologies](https://www.elastic.co/guide/en/apm/agent/dotnet/current/supported-technologies.html) 590 | 591 | For RUM agent, Elastic provides a JavaScript agent and adds framework-specific integrations for React, Angular and Vue. 592 | 593 | See these page for more information: [Supported technologies](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/supported-technologies.html) 594 | 595 | ## Elastic APM agent implementation 596 | 597 | ### Profiler auto instrumentation 598 | 599 | In our case, as we use Docker, it would be easy to add Profiler auto instrumentation, we just have to add these lines in our Dockerfile: 600 | 601 | ARG AGENT_VERSION=1.20.0 602 | 603 | FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine3.16 AS base 604 | 605 | # ... 606 | 607 | FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine3.16 AS build 608 | ARG AGENT_VERSION 609 | 610 | # install zip curl 611 | RUN apk update && apk add zip wget 612 | 613 | # pull down the zip file based on ${AGENT_VERSION} ARG and unzip 614 | RUN wget -q https://github.com/elastic/apm-agent-dotnet/releases/download/v${AGENT_VERSION}/elastic_apm_profiler_${AGENT_VERSION}-linux-x64.zip && \ 615 | unzip elastic_apm_profiler_${AGENT_VERSION}-linux-x64.zip -d /elastic_apm_profiler 616 | 617 | # ... 618 | 619 | FROM build AS publish 620 | 621 | # ... 622 | 623 | FROM base AS final 624 | 625 | WORKDIR /elastic_apm_profiler 626 | COPY --from=publish /elastic_apm_profiler . 627 | 628 | # ... 629 | 630 | # # Configures whether profiling is enabled for the currently running process. 631 | ENV CORECLR_ENABLE_PROFILING=1 632 | # # Specifies the GUID of the profiler to load into the currently running process. 633 | ENV CORECLR_PROFILER={FA65FE15-F085-4681-9B20-95E04F6C03CC} 634 | # # Specifies the path to the profiler DLL to load into the currently running process (or 32-bit or 64-bit process). 635 | ENV CORECLR_PROFILER_PATH=/elastic_apm_profiler/libelastic_apm_profiler.so 636 | 637 | # # Specifies the home directory of the profiler auto instrumentation. 638 | ENV ELASTIC_APM_PROFILER_HOME=/elastic_apm_profiler 639 | # # Specifies the path to the integrations.yml file that determines which methods to target for auto instrumentation. 640 | ENV ELASTIC_APM_PROFILER_INTEGRATIONS=/elastic_apm_profiler/integrations.yml 641 | # # Specifies the log level at which the profiler should log. 642 | ENV ELASTIC_APM_PROFILER_LOG=warn 643 | 644 | # Core configuration options / Specifies the service name (ElasticApm:ServiceName). 645 | ENV ELASTIC_APM_SERVICE_NAME=NetApi-Elastic 646 | # Core configuration options / Specifies the environment (ElasticApm:Environment) 647 | ENV ELASTIC_APM_ENVIRONMENT=Development 648 | # Core configuration options / Specifies the sample rate (ElasticApm:TransactionSampleRate). 649 | # 1.0 : Dev purpose only, should be lowered in Production to reduce overhead. 650 | ENV ELASTIC_APM_TRANSACTION_SAMPLE_RATE=1.0 651 | 652 | # Reporter configuration options / Specifies the URL for your APM Server (ElasticApm:ServerUrl). 653 | ENV ELASTIC_APM_SERVER_URL=https://host.docker.internal:8200 654 | # Reporter configuration options / Specifies if the agent should verify the SSL certificate if using HTTPS connection to the APM server (ElasticApm:VerifyServerCert). 655 | ENV ELASTIC_APM_VERIFY_SERVER_CERT=false /* Testing purpuse */ 656 | # Reporter configuration options / Specifies the path to a PEM-encoded certificate used for SSL/TLS by APM server (ElasticApm:ServerCert). 657 | # ENV ELASTIC_APM_SERVER_CERT= 658 | 659 | # Supportability configuration options / Sets the logging level for the agent (ElasticApm:LogLevel). 660 | ENV ELASTIC_APM_LOG_LEVEL=Debug 661 | 662 | # ... 663 | 664 | You can find all the documentation at this place: [Profiler Auto instrumentation](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-auto-instrumentation.html) 665 | 666 | But, in our case, we don't need any feature provided by the Profiler auto instrumentation. So this code is just shown for example. 667 | 668 | ### NuGet - Zero code change setup 669 | 670 | As we use .Net 6, we can also use the "zero code change" to integrate NuGet and be able to use NuGet features without changing any code. This is available when using .Net Core and .Net 5+. 671 | 672 | To do this, just add the following environment variables in the Dockerfile: 673 | 674 | ARG AGENT_VERSION=1.20.0 675 | 676 | FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine3.16 AS base 677 | 678 | # ... 679 | 680 | FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine3.16 AS build 681 | ARG AGENT_VERSION 682 | 683 | # install zip curl 684 | RUN apk update && apk add zip wget 685 | 686 | # pull down the zip file based on ${AGENT_VERSION} ARG and unzip 687 | RUN wget -q https://github.com/elastic/apm-agent-dotnet/releases/download/v${AGENT_VERSION}/ElasticApmAgent_${AGENT_VERSION}.zip && \ 688 | unzip ElasticApmAgent_${AGENT_VERSION}would.zip -d /ElasticApmAgent 689 | 690 | # ... 691 | 692 | FROM build AS publish 693 | 694 | # ... 695 | 696 | FROM base AS final 697 | 698 | WORKDIR /ElasticApmAgent 699 | COPY --from=publish /ElasticApmAgent . 700 | 701 | # ... 702 | 703 | # Inject the APM agent at startup 704 | ENV DOTNET_STARTUP_HOOKS=/ElasticApmAgent/ElasticApmAgentStartupHook.dll 705 | # If the startup hook integration throws an exception, additional detail can be obtained by setting the Startup Hooks Logging variable. 706 | ENV ELASTIC_APM_STARTUP_HOOKS_LOGGING=1 707 | 708 | # Core configuration options / Specifies the service name (ElasticApm:ServiceName). 709 | ENV ELASTIC_APM_SERVICE_NAME=NetApi-Elastic 710 | # Core configuration options / Specifies the environment (ElasticApm:Environment) 711 | ENV ELASTIC_APM_ENVIRONMENT=Development 712 | # Core configuration options / Specifies the sample rate (ElasticApm:TransactionSampleRate). 713 | # 1.0 : Dev purpose only, should be lowered in Production to reduce overhead. 714 | ENV ELASTIC_APM_TRANSACTION_SAMPLE_RATE=1.0 715 | 716 | # Reporter configuration options / Specifies the URL for your APM Server (ElasticApm:ServerUrl). 717 | ENV ELASTIC_APM_SERVER_URL=https://host.docker.internal:8200 718 | # Reporter configuration options / Specifies if the agent should verify the SSL certificate if using HTTPS connection to the APM server (ElasticApm:VerifyServerCert). 719 | ENV ELASTIC_APM_VERIFY_SERVER_CERT=false /* Testing purpuse */ 720 | # Reporter configuration options / Specifies the path to a PEM-encoded certificate used for SSL/TLS by APM server (ElasticApm:ServerCert). 721 | # ENV ELASTIC_APM_SERVER_CERT= 722 | 723 | # Supportability configuration options / Sets the logging level for the agent (ElasticApm:LogLevel). 724 | ENV ELASTIC_APM_LOG_LEVEL=Debug 725 | 726 | # ... 727 | 728 | But, with this implementation, we won't be able to make correlation with logs by adding transaction id and trace id. 729 | 730 | ### NuGet - .Net Core setup 731 | 732 | So, we will prefer using NuGet integration, adding logs correlation, and be able to choose the features to integrate. 733 | 734 | The following Elastic for .Net NuGet packages are used: 735 | 736 | - [Elastic.Apm.NetCoreAll](https://github.com/elastic/apm-agent-dotnet) 737 | - [Elastic.Apm.SerilogEnricher](https://github.com/elastic/ecs-dotnet/tree/main/src/Elastic.Apm.SerilogEnricher) 738 | 739 | But if you prefer choosing the features you want to integrate, you can choose only the packages you are interesting in instead of *Elastic.Apm.NetCoreAll*Elastic.Apm.NetCoreAll. The documentation is provided [here](https://github.com/elastic/apm-agent-dotnet#installation). 740 | 741 | To enable Elastic APM, you just have one line to add in your Configure method: 742 | 743 | public void Configure(IApplicationBuilder app) 744 | { 745 | app.UseAllElasticApm(Configuration); 746 | } 747 | 748 | In the case you only want to activate some modules, you can use the UseElasticApm method instead, after adding needed packages: 749 | 750 | app.UseElasticApm(Configuration, 751 | new HttpDiagnosticsSubscriber(), /* Enable tracing of outgoing HTTP requests */ 752 | new EfCoreDiagnosticsSubscriber()); /* Enable tracing of database calls through EF Core */ 753 | 754 | To define the APM server to communicate with, add the following configuration in the appsettings.json file: 755 | 756 | { 757 | "AllowedHosts": "*", 758 | "ElasticApm": 759 | { 760 | "ServerUrl": "https://host.docker.internal:8200", 761 | "LogLevel": "Information", 762 | "VerifyServerCert": false /* Testing purpuse */ 763 | } 764 | } 765 | 766 | See [this page](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-all-options-summary.html) for all options available. 767 | 768 | To add the transaction id and trace id to every Serilog log message that is created during a transaction, you just add to update your configuration in the appsettings.json file: 769 | 770 | { 771 | "Serilog": { 772 | "Using": ["Elastic.Apm.SerilogEnricher"], 773 | /* ... */ 774 | "Enrich": [/* ... */, "WithElasticApmCorrelationInfo"], 775 | /* ... */ 776 | } 777 | } 778 | 779 | ## Elastic RUM agent implementation 780 | 781 | For common JavaScript application, the implementation only takes a few lignes (asynchronous / non-blocking pattern): 782 | 783 | 793 | 794 | You can find this implementation in the source code in the sample _Layout.cshtml of the Blazor App. 795 | 796 | For frameworks like React, Angular and Vue, you can refer to [this page](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/framework-integrations.html). 797 | 798 | ## Sending traces to Elasticsearch 799 | 800 | The configuration has already been seen in the previous section. 801 | 802 | You just have to ensure you have an APM server available (this is now done with an elastic-agent with an APM integration in Fleet). 803 | 804 | ## Analyse traces in Kibana 805 | 806 | First thing we can check, the correlation ids for logs. 807 | 808 | ![Logs correlation ids on Discover](Logs_Correlation_Discover.png) 809 | 810 | Then, on the APM App on Kibana, we have a lot of information thanks to our traces. 811 | 812 | - APM Inventory which gives the list of all services that send traces: 813 | 814 | ![APM Inventory](APM_Inventory.png) 815 | 816 | - APM Service Map which display a map with our services (in case of complexe architecture, it is easy to see dependencies between services): 817 | 818 | ![APM Service map](APM_ServiceMap.png) 819 | 820 | - APM Overview which gives an overview of all information about traces: 821 | 822 | ![APM Overview](APM_Overview.png) 823 | 824 | - APM Transactions which gives information about all transactions coming from our services: 825 | 826 | ![APM Transactions](APM_Transactions.png) 827 | 828 | - APM Dependencies which list all dependencies of the current service: 829 | 830 | ![APM Dependencies](APM_Dependencies.png) 831 | 832 | - APM Errors which list all errors not catched by our service: 833 | 834 | ![APM Errors](APM_Errors.png) 835 | 836 | - APM Logs which list all logs for the current service: 837 | 838 | ![APM Logs](APM_Logs.png) 839 | 840 | - An interesting view is the trace sample on the Transactions view. You can view the detailed trace for a transaction: 841 | 842 | ![APM Transactions - Trace timeline](APM_TransactionsTraceTimeline.png) 843 | 844 | - The same view for JavaScript service (RUM): 845 | 846 | ![APM Transactions - Trace timeline - JavaScript service](APM_TransactionsFrontJavaScriptService.png) 847 | 848 | - And you can also see related logs: 849 | 850 | ![APM Transactions - Trace logs](APM_TransactionsTraceLogs.png) 851 | 852 | - APM User Experience Dashboard: 853 | 854 | ![APM User Experience Dashboard](APM_UserExperience_Dashboard.png) -------------------------------------------------------------------------------- /src/NetApi.Elastic/Controllers/PersonsController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using NetApi.Elastic.Models; 3 | 4 | namespace NetApi.Elastic.Controllers 5 | { 6 | [Route("api/v{version:apiVersion}/[controller]")] 7 | [ApiController] 8 | [ApiVersion("1.0")] 9 | public class PersonsController : ControllerBase 10 | { 11 | 12 | private static List persons = new List() 13 | { 14 | new Person{ Id=1, FullName="Usman", Email="usman@gmail.com", City="Mirpur", Country="Pakistan"}, 15 | new Person{ Id=2, FullName="Jolly", Email="jolly@gmail.com", City="Rome", Country="Italy"}, 16 | new Person{ Id=3, FullName="Tina", Email="tina@gmail.com", City="Berlin", Country="Germany"}, 17 | new Person{ Id=4, FullName="Anil", Email="anil@gmail.com", City="Mumbai", Country="India"}, 18 | }; 19 | 20 | private readonly ILogger _logger; 21 | 22 | public PersonsController(ILogger logger) 23 | { 24 | _logger = logger; 25 | } 26 | 27 | // GET: api/ 28 | [HttpGet] 29 | public IEnumerable Get() 30 | { 31 | _logger.LogDebug("Getting persons"); 32 | 33 | return persons; 34 | } 35 | 36 | // GET api//5 37 | [HttpGet("{id}")] 38 | public Person Get(int id) 39 | { 40 | _logger.LogDebug("Getting person with id {Id}", id); 41 | 42 | return persons.Where(x => x.Id == id).FirstOrDefault(); 43 | } 44 | 45 | // POST api/ 46 | [HttpPost] 47 | public void Post([FromBody] Person person) 48 | { 49 | _logger.LogDebug("Adding person {@person}", person); 50 | 51 | persons.Add(person); 52 | 53 | _logger.LogInformation("Person {@person} added", person); 54 | } 55 | 56 | // PUT api//5 57 | [HttpPut("{id}")] 58 | public void Put(int id, [FromBody] Person person) 59 | { 60 | _logger.LogDebug("Updating person with id {Id}", id); 61 | 62 | persons.Remove(persons.Where(x => x.Id == id).FirstOrDefault()); 63 | persons.Add(person); 64 | 65 | _logger.LogInformation("Person with id {Id} updated", id); 66 | } 67 | 68 | // DELETE api//5 69 | [HttpDelete("{id}")] 70 | public void Delete(int id) 71 | { 72 | _logger.LogDebug("Removing person with id {Id}", id); 73 | 74 | persons.Remove(persons.Where(x => x.Id == id).FirstOrDefault()); 75 | 76 | _logger.LogInformation("Person with id {Id} removed", id); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/NetApi.Elastic/Controllers/WeatherForecastController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using NetApi.Elastic.Models; 3 | 4 | namespace NetApi.Elastic.Controllers 5 | { 6 | [Route("api/v{version:apiVersion}/[controller]")] 7 | [ApiController] 8 | [ApiVersion("1.0")] 9 | public class WeatherForecastController : ControllerBase 10 | { 11 | private static readonly string[] Summaries = new[] 12 | { 13 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 14 | }; 15 | 16 | private readonly ILogger _logger; 17 | 18 | public WeatherForecastController(ILogger logger) 19 | { 20 | _logger = logger; 21 | } 22 | 23 | [HttpGet()] 24 | [MapToApiVersion("1.0")] 25 | public IEnumerable Get() 26 | { 27 | _logger.LogDebug("Getting weather forecast"); 28 | 29 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 30 | { 31 | Date = DateTime.Now.AddDays(index), 32 | TemperatureC = Random.Shared.Next(-20, 55), 33 | Summary = Summaries[Random.Shared.Next(Summaries.Length)] 34 | }) 35 | .ToArray(); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/NetApi.Elastic/Dockerfile: -------------------------------------------------------------------------------- 1 | #ARG AGENT_VERSION=1.20.0 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine3.16 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine3.16 AS build 8 | #ARG AGENT_VERSION 9 | 10 | # # install zip curl 11 | # RUN apk update && apk add zip wget 12 | 13 | # pull down the zip file based on ${AGENT_VERSION} ARG and unzip 14 | # RUN wget -q https://github.com/elastic/apm-agent-dotnet/releases/download/v${AGENT_VERSION}/elastic_apm_profiler_${AGENT_VERSION}-linux-x64.zip && \ 15 | # unzip elastic_apm_profiler_${AGENT_VERSION}-linux-x64.zip -d /elastic_apm_profiler 16 | 17 | # RUN wget -q https://github.com/elastic/apm-agent-dotnet/releases/download/v${AGENT_VERSION}/ElasticApmAgent_${AGENT_VERSION}.zip && \ 18 | # unzip ElasticApmAgent_${AGENT_VERSION}would.zip -d /ElasticApmAgent 19 | 20 | WORKDIR /src 21 | 22 | COPY . . 23 | 24 | RUN dotnet restore NetApi.Elastic.csproj 25 | RUN dotnet build -c Release -o /app/build 26 | 27 | FROM build AS publish 28 | 29 | RUN dotnet publish -c Release -o /app/publish 30 | 31 | FROM base AS final 32 | 33 | # WORKDIR /elastic_apm_profiler 34 | # COPY --from=publish /elastic_apm_profiler . 35 | # WORKDIR /ElasticApmAgent 36 | # COPY --from=publish /ElasticApmAgent . 37 | 38 | WORKDIR /app 39 | COPY --from=publish /app/publish . 40 | 41 | # # Configures whether profiling is enabled for the currently running process. 42 | # ENV CORECLR_ENABLE_PROFILING=1 43 | # # Specifies the GUID of the profiler to load into the currently running process. 44 | # ENV CORECLR_PROFILER={FA65FE15-F085-4681-9B20-95E04F6C03CC} 45 | # # Specifies the path to the profiler DLL to load into the currently running process (or 32-bit or 64-bit process). 46 | # ENV CORECLR_PROFILER_PATH=/elastic_apm_profiler/libelastic_apm_profiler.so 47 | 48 | # # Specifies the home directory of the profiler auto instrumentation. 49 | # ENV ELASTIC_APM_PROFILER_HOME=/elastic_apm_profiler 50 | # # Specifies the path to the integrations.yml file that determines which methods to target for auto instrumentation. 51 | # ENV ELASTIC_APM_PROFILER_INTEGRATIONS=/elastic_apm_profiler/integrations.yml 52 | # # Specifies the log level at which the profiler should log. 53 | # ENV ELASTIC_APM_PROFILER_LOG=warn 54 | 55 | # # Inject the APM agent at startup 56 | # ENV DOTNET_STARTUP_HOOKS=/ElasticApmAgent/ElasticApmAgentStartupHook.dll 57 | # # If the startup hook integration throws an exception, additional detail can be obtained by setting the Startup Hooks Logging variable. 58 | # ENV ELASTIC_APM_STARTUP_HOOKS_LOGGING=1 59 | 60 | # # Core configuration options / Specifies the service name (ElasticApm:ServiceName). 61 | # ENV ELASTIC_APM_SERVICE_NAME=NetApi-Elastic 62 | # # Core configuration options / Specifies the environment (ElasticApm:Environment) 63 | # ENV ELASTIC_APM_ENVIRONMENT=Development 64 | # # Core configuration options / Specifies the sample rate (ElasticApm:TransactionSampleRate). 65 | # # 1.0 : Dev purpose only, should be lowered in Production to reduce overhead. 66 | # ENV ELASTIC_APM_TRANSACTION_SAMPLE_RATE=1.0 67 | 68 | # # Reporter configuration options / Specifies the URL for your APM Server (ElasticApm:ServerUrl). 69 | # ENV ELASTIC_APM_SERVER_URL=https://host.docker.internal:8200 70 | # # Reporter configuration options / Specifies if the agent should verify the SSL certificate if using HTTPS connection to the APM server (ElasticApm:VerifyServerCert). 71 | # ENV ELASTIC_APM_VERIFY_SERVER_CERT=false 72 | # # Reporter configuration options / Specifies the path to a PEM-encoded certificate used for SSL/TLS by APM server (ElasticApm:ServerCert). 73 | # # ENV ELASTIC_APM_SERVER_CERT= 74 | 75 | # # Supportability configuration options / Sets the logging level for the agent (ElasticApm:LogLevel). 76 | # ENV ELASTIC_APM_LOG_LEVEL=Debug 77 | 78 | ENTRYPOINT ["dotnet", "NetApi.Elastic.dll"] -------------------------------------------------------------------------------- /src/NetApi.Elastic/Extensions/CustomExtensions.cs: -------------------------------------------------------------------------------- 1 | using Destructurama; 2 | using Microsoft.Extensions.Diagnostics.HealthChecks; 3 | using Prometheus; 4 | using Serilog; 5 | 6 | namespace NetApi.Elastic.Extensions 7 | { 8 | public static class CustomExtensions 9 | { 10 | public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) 11 | { 12 | IHealthChecksBuilder hcBuilder = services.AddHealthChecks(); 13 | 14 | hcBuilder.AddCheck("self", () => HealthCheckResult.Healthy()); 15 | 16 | hcBuilder.ForwardToPrometheus(); 17 | 18 | return services; 19 | } 20 | 21 | public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, IConfiguration configuration) 22 | { 23 | Log.Logger = new LoggerConfiguration() 24 | .ReadFrom.Configuration(configuration) 25 | .Destructure.UsingAttributes() 26 | .CreateLogger(); 27 | 28 | builder.AddSerilog(); 29 | 30 | return builder; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/NetApi.Elastic/Models/Person.cs: -------------------------------------------------------------------------------- 1 | using Destructurama.Attributed; 2 | 3 | namespace NetApi.Elastic.Models 4 | { 5 | public class Person 6 | { 7 | public int Id { get; set; } 8 | public string FullName { get; set; } 9 | 10 | [NotLogged] 11 | public string Email { get; set; } 12 | 13 | public string City { get; set; } 14 | public string Country { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/NetApi.Elastic/Models/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace NetApi.Elastic.Models 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 | } -------------------------------------------------------------------------------- /src/NetApi.Elastic/NetApi.Elastic.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | NetApi.Elastic 6 | NetApi.Elastic 7 | disable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/NetApi.Elastic/Program.cs: -------------------------------------------------------------------------------- 1 | using Autofac.Extensions.DependencyInjection; 2 | using NetApi.Elastic.Extensions; 3 | using Serilog; 4 | 5 | namespace NetApi.Elastic 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | BuildHost(args).Run(); 12 | } 13 | 14 | public static IHost BuildHost(string[] args) => 15 | Host.CreateDefaultBuilder(args) 16 | .ConfigureLogging((host, builder) => builder.ClearProviders().AddSerilog(host.Configuration)) 17 | .UseSerilog() 18 | .UseServiceProviderFactory(new AutofacServiceProviderFactory()) 19 | .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) 20 | .Build(); 21 | } 22 | } -------------------------------------------------------------------------------- /src/NetApi.Elastic/Startup.cs: -------------------------------------------------------------------------------- 1 | using Elastic.Apm.NetCoreAll; 2 | using HealthChecks.UI.Client; 3 | using Microsoft.AspNetCore.Diagnostics.HealthChecks; 4 | using NetApi.Elastic.Extensions; 5 | using Prometheus; 6 | using Serilog; 7 | 8 | namespace NetApi.Elastic 9 | { 10 | public class Startup 11 | { 12 | public Startup(IConfiguration configuration) 13 | { 14 | Configuration = configuration; 15 | } 16 | 17 | public IConfiguration Configuration { get; } 18 | 19 | public virtual void ConfigureServices(IServiceCollection services) 20 | { 21 | // Adds all custom configurations for this service. 22 | services 23 | .AddOptions() 24 | .AddCustomHealthCheck(Configuration); 25 | 26 | 27 | services.AddApiVersioning() 28 | .AddEndpointsApiExplorer() 29 | .AddSwaggerGen() 30 | .AddCors(policy => 31 | { 32 | policy.AddPolicy("OpenCorsPolicy", opt => opt 33 | .AllowAnyOrigin() 34 | .AllowAnyHeader() 35 | .AllowAnyMethod()); 36 | }); 37 | 38 | services.AddControllers(); 39 | 40 | // Suppress default metrics 41 | Metrics.SuppressDefaultMetrics(); 42 | 43 | // Defines statics labels for metrics 44 | Metrics.DefaultRegistry.SetStaticLabels(new Dictionary 45 | { 46 | { "domain", "NetApi" }, 47 | { "domain_context", "NetApi.Elastic" } 48 | }); 49 | } 50 | 51 | /// 52 | /// Configures the HTTP request pipeline. Automatically called by the runtime. 53 | /// 54 | /// The application builder. 55 | public void Configure(IApplicationBuilder app) 56 | { 57 | app.UseAllElasticApm(Configuration); 58 | app.UseRouting(); 59 | app.UseSerilogRequestLogging(); 60 | app.UseCors("OpenCorsPolicy"); 61 | 62 | app.UseEndpoints(endpoints => 63 | { 64 | endpoints.MapHealthChecks("/hc", new HealthCheckOptions() 65 | { 66 | Predicate = _ => true, 67 | ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse 68 | }); 69 | 70 | endpoints.MapHealthChecks("/liveness", new HealthCheckOptions 71 | { 72 | Predicate = r => r.Name.Contains("self") 73 | }); 74 | 75 | endpoints.MapMetrics(); 76 | 77 | endpoints.MapControllerRoute( 78 | name: "default", 79 | pattern: "{controller=Home}/{action=Index}/{id?}" 80 | ); 81 | }); 82 | } 83 | } 84 | } 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/NetApi.Elastic/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Serilog": { 3 | "MinimumLevel": { 4 | "Override": { 5 | "NetApi.Elastic": "Debug" 6 | } 7 | }, 8 | "WriteTo": [ 9 | { 10 | "Name": "Console", 11 | "Args": { 12 | "outputTemplate": "-> [{Timestamp:HH:mm:ss} {Level:u3} {ElasticApmTraceId} {ElasticApmTransactionId}] {Message:lj}{NewLine}{Exception}" 13 | } 14 | } 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /src/NetApi.Elastic/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Serilog": { 3 | "Using": ["Elastic.Apm.SerilogEnricher"], 4 | "MinimumLevel": { 5 | "Default": "Warning", 6 | "Override": { 7 | "Microsoft.AspnetCore": "Information", 8 | "Microsoft.Hosting": "Information", 9 | "NetApi.Elastic": "Information" 10 | } 11 | }, 12 | "Enrich": ["FromLogContext", "WithMachineName", "WithEnvironmentUserName", "WithEnvironmentName", "WithProcessId", "WithProcessName", "WithThreadId", "WithThreadName", "WithElasticApmCorrelationInfo"], 13 | "Properties": { 14 | "Domain": "NetApi", 15 | "DomainContext": "NetApi.Elastic" 16 | }, 17 | "WriteTo": [ 18 | { 19 | "Name": "Console", 20 | "Args": { 21 | "formatter": "Elastic.CommonSchema.Serilog.EcsTextFormatter, Elastic.CommonSchema.Serilog" 22 | } 23 | } 24 | ] 25 | }, 26 | "AllowedHosts": "*", 27 | "ElasticApm": 28 | { 29 | "ServerUrl": "https://host.docker.internal:8200", 30 | "LogLevel": "Information", 31 | "VerifyServerCert": false 32 | } 33 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Dockerfile: -------------------------------------------------------------------------------- 1 | #ARG AGENT_VERSION=1.20.0 2 | 3 | FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine3.16 AS base 4 | WORKDIR /app 5 | EXPOSE 80 6 | 7 | FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine3.16 AS build 8 | #ARG AGENT_VERSION 9 | 10 | # # install zip curl 11 | # RUN apk update && apk add zip wget 12 | 13 | # pull down the zip file based on ${AGENT_VERSION} ARG and unzip 14 | # RUN wget -q https://github.com/elastic/apm-agent-dotnet/releases/download/v${AGENT_VERSION}/elastic_apm_profiler_${AGENT_VERSION}-linux-x64.zip && \ 15 | # unzip elastic_apm_profiler_${AGENT_VERSION}-linux-x64.zip -d /elastic_apm_profiler 16 | 17 | # RUN wget -q https://github.com/elastic/apm-agent-dotnet/releases/download/v${AGENT_VERSION}/ElasticApmAgent_${AGENT_VERSION}.zip && \ 18 | # unzip ElasticApmAgent_${AGENT_VERSION}.zip -d /ElasticApmAgent 19 | 20 | WORKDIR /src 21 | 22 | COPY . . 23 | 24 | RUN dotnet restore NetClient.Elastic.csproj 25 | RUN dotnet build -c Release -o /app/build 26 | 27 | FROM build AS publish 28 | 29 | RUN dotnet publish -c Release -o /app/publish 30 | 31 | FROM base AS final 32 | 33 | # WORKDIR /elastic_apm_profiler 34 | # COPY --from=publish /elastic_apm_profiler . 35 | # WORKDIR /ElasticApmAgent 36 | # COPY --from=publish /ElasticApmAgent . 37 | 38 | WORKDIR /app 39 | COPY --from=publish /app/publish . 40 | 41 | # # Configures whether profiling is enabled for the currently running process. 42 | # ENV CORECLR_ENABLE_PROFILING=1 43 | # # Specifies the GUID of the profiler to load into the currently running process. 44 | # ENV CORECLR_PROFILER={FA65FE15-F085-4681-9B20-95E04F6C03CC} 45 | # # Specifies the path to the profiler DLL to load into the currently running process (or 32-bit or 64-bit process). 46 | # ENV CORECLR_PROFILER_PATH=/elastic_apm_profiler/libelastic_apm_profiler.so 47 | 48 | # # Specifies the home directory of the profiler auto instrumentation. 49 | # ENV ELASTIC_APM_PROFILER_HOME=/elastic_apm_profiler 50 | # # Specifies the path to the integrations.yml file that determines which methods to target for auto instrumentation. 51 | # ENV ELASTIC_APM_PROFILER_INTEGRATIONS=/elastic_apm_profiler/integrations.yml 52 | # # Specifies the log level at which the profiler should log. 53 | # ENV ELASTIC_APM_PROFILER_LOG=warn 54 | 55 | # # Inject the APM agent at startup 56 | # ENV DOTNET_STARTUP_HOOKS=/ElasticApmAgent/ElasticApmAgentStartupHook.dll 57 | # # If the startup hook integration throws an exception, additional detail can be obtained by setting the Startup Hooks Logging variable. 58 | # ENV ELASTIC_APM_STARTUP_HOOKS_LOGGING=1 59 | 60 | # # Core configuration options / Specifies the service name (ElasticApm:ServiceName). 61 | # ENV ELASTIC_APM_SERVICE_NAME=NetClient-Elastic 62 | # # Core configuration options / Specifies the environment (ElasticApm:Environment) 63 | # ENV ELASTIC_APM_ENVIRONMENT=Development 64 | # # Core configuration options / Spcifies the sample rate (ElasticApm:TransactionSampleRate). 65 | # # 1.0 : Dev purpose only, should be lowered in Production to reduce overhead. 66 | # ENV ELASTIC_APM_TRANSACTION_SAMPLE_RATE=1.0 67 | 68 | # # Reporter configuration options / Specifies the URL for your APM Server (ElasticApm:ServerUrl). 69 | # ENV ELASTIC_APM_SERVER_URL=https://host.docker.internal:8200 70 | # # Reporter configuration options / Specifies if the agent should verify the SSL certificate if using HTTPS connection to the APM server (ElasticApm:VerifyServerCert). 71 | # ENV ELASTIC_APM_VERIFY_SERVER_CERT=false 72 | # # Reporter configuration options / Specifies the path to a PEM-encoded certificate used for SSL/TLS by APM server (ElasticApm:ServerCert). 73 | # # ENV ELASTIC_APM_SERVER_CERT= 74 | 75 | # # Supportability configuration options / Sets the logging level for the agent (ElasticApm:LogLevel). 76 | # ENV ELASTIC_APM_LOG_LEVEL=Debug 77 | 78 | ENTRYPOINT ["dotnet", "NetClient.Elastic.dll"] -------------------------------------------------------------------------------- /src/NetClient.Elastic/Extensions/CustomExtensions.cs: -------------------------------------------------------------------------------- 1 | using Destructurama; 2 | using Microsoft.Extensions.Diagnostics.HealthChecks; 3 | using Prometheus; 4 | using Serilog; 5 | 6 | namespace NetClient.Elastic.Extensions 7 | { 8 | public static class CustomExtensions 9 | { 10 | public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) 11 | { 12 | IHealthChecksBuilder hcBuilder = services.AddHealthChecks(); 13 | 14 | hcBuilder.AddCheck("self", () => HealthCheckResult.Healthy()); 15 | 16 | hcBuilder.ForwardToPrometheus(); 17 | 18 | return services; 19 | } 20 | 21 | public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, IConfiguration configuration) 22 | { 23 | Log.Logger = new LoggerConfiguration() 24 | .ReadFrom.Configuration(configuration) 25 | .Destructure.UsingAttributes() 26 | .CreateLogger(); 27 | 28 | builder.AddSerilog(); 29 | 30 | return builder; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Models/Person.cs: -------------------------------------------------------------------------------- 1 | namespace NetClient.Elastic.Models 2 | { 3 | public class Person 4 | { 5 | public int Id { get; set; } 6 | public string FullName { get; set; } 7 | public string Email { get; set; } 8 | public string City { get; set; } 9 | public string Country { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/NetClient.Elastic.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | NetClient.Elastic 6 | NetClient.Elastic 7 | disable 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 | Counter 4 | 5 |

Counter

6 | 7 |

Current count: @currentCount

8 | 9 | 10 | 11 | @code { 12 | private int currentCount = 0; 13 | 14 | private void IncrementCount() 15 | { 16 | currentCount++; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @inject HttpClient Http 3 | 4 | Weather forecast 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from the server.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await Http.GetFromJsonAsync("sample-data/weather.json"); 45 | } 46 | 47 | public class WeatherForecast 48 | { 49 | public DateTime Date { get; set; } 50 | 51 | public int TemperatureC { get; set; } 52 | 53 | public string Summary { get; set; } 54 | 55 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using NetClient.Elastic.Models 3 | @using NetClient.Elastic.Services 4 | @inject IPersonApiService personsService; 5 | 6 | Persons 7 | 8 |

Persons!

9 | 10 | Welcome to your new app. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | @foreach (var item in persons) 23 | { 24 | 25 | 26 | 27 | 28 | 29 | 34 | 35 | } 36 | 37 |
IdNameEmailLocationAction
@item.Id@item.FullName@item.Email@(item.City+", "+item.Country) 30 | 31 | 32 | 33 |
38 | @code { 39 | List persons = new List(); 40 | 41 | protected override async Task OnInitializedAsync() 42 | { 43 | persons = await personsService.GetPersons(); 44 | if (persons == null) 45 | { 46 | persons = new List(); 47 | } 48 | } 49 | 50 | 51 | private async Task AddPerson(Person person) 52 | { 53 | await personsService.AddPerson( 54 | new Person 55 | { 56 | Id = persons.Count + 1, 57 | FullName = person.FullName, 58 | City = "Tokyo", 59 | Country = "Japan", 60 | Email = person.Email 61 | } 62 | ); 63 | 64 | persons = await personsService.GetPersons(); 65 | } 66 | 67 | private async Task UpdatePerson(Person person) 68 | { 69 | person.FullName = "Batista"; 70 | await personsService.UpdatePerson(person.Id, person); 71 | persons = await personsService.GetPersons(); 72 | } 73 | 74 | private async Task DeletePerson(Person guest) 75 | { 76 | await personsService.RemovePerson(guest.Id); 77 | persons = await personsService.GetPersons(); 78 | } 79 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace NetClient.Elastic.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = "_Layout"; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Pages/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @namespace NetClient.Elastic.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | @RenderBody() 19 | 20 |
21 | 22 | An error has occurred. This application may no longer respond until reloaded. 23 | 24 | 25 | An unhandled exception has occurred. See browser dev tools for details. 26 | 27 | Reload 28 | 🗙 29 |
30 | 31 | 32 | 42 | 43 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Program.cs: -------------------------------------------------------------------------------- 1 | using Autofac.Extensions.DependencyInjection; 2 | using NetClient.Elastic.Extensions; 3 | using Serilog; 4 | 5 | namespace NetClient.Elastic 6 | { 7 | public class Program 8 | { 9 | public static async Task Main(string[] args) 10 | { 11 | await BuildHost(args).RunAsync(); 12 | } 13 | 14 | public static IHost BuildHost(string[] args) => 15 | Host.CreateDefaultBuilder(args) 16 | .ConfigureLogging((host, builder) => builder.ClearProviders().AddSerilog(host.Configuration)) 17 | .UseSerilog() 18 | .UseServiceProviderFactory(new AutofacServiceProviderFactory()) 19 | .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) 20 | .Build(); 21 | } 22 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/Services/IPersonApiService.cs: -------------------------------------------------------------------------------- 1 | using Refit; 2 | using NetClient.Elastic.Models; 3 | 4 | namespace NetClient.Elastic.Services 5 | { 6 | public interface IPersonApiService 7 | { 8 | [Get("/persons")] 9 | Task> GetPersons(); 10 | 11 | [Get("/persons/{id}")] 12 | Task GetPerson(int id); 13 | 14 | [Post("/persons")] 15 | Task AddPerson([Body] Person guest); 16 | 17 | [Put("/persons/{id}")] 18 | Task UpdatePerson(int id, [Body] Person guest); 19 | 20 | [Delete("/persons/{id}")] 21 | Task RemovePerson(int id); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace NetClient.Elastic 2 | { 3 | public class Settings 4 | { 5 | public int DataServiceExecutionDelay { get; set; } 6 | 7 | public string PersonApiBaseAddress { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 7 | 8 |
9 |
10 | About 11 |
12 | 13 |
14 | @Body 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  9 | 10 |
11 | 28 |
29 | 30 | @code { 31 | private bool collapseNavMenu = true; 32 | 33 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 34 | 35 | private void ToggleNavMenu() 36 | { 37 | collapseNavMenu = !collapseNavMenu; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 641px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 
2 | 3 | @Title 4 | 5 | 6 | Please take our 7 | brief survey 8 | 9 | and tell us what you think. 10 |
11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/Startup.cs: -------------------------------------------------------------------------------- 1 | using Elastic.Apm.NetCoreAll; 2 | using HealthChecks.UI.Client; 3 | using Microsoft.AspNetCore.Diagnostics.HealthChecks; 4 | using NetClient.Elastic.Extensions; 5 | using NetClient.Elastic.Services; 6 | using NetClient.Elastic.Tasks; 7 | using Prometheus; 8 | using Refit; 9 | using Serilog; 10 | 11 | namespace NetClient.Elastic 12 | { 13 | public class Startup 14 | { 15 | public Startup(IConfiguration configuration) 16 | { 17 | Configuration = configuration; 18 | } 19 | 20 | public IConfiguration Configuration { get; } 21 | 22 | public virtual void ConfigureServices(IServiceCollection services) 23 | { 24 | // Adds all custom configurations for this service. 25 | services.Configure(Configuration); 26 | services.AddOptions(); 27 | services.AddCustomHealthCheck(Configuration); 28 | 29 | services.AddRazorPages(); 30 | services.AddServerSideBlazor(); 31 | services.AddHttpClient(); 32 | 33 | services.AddHostedService(); 34 | services.AddScoped(sp => new HttpClient 35 | { 36 | BaseAddress = new Uri($"{Configuration["BaseAddress"]}") 37 | }); 38 | 39 | services.AddRefitClient().ConfigureHttpClient(x => 40 | { 41 | x.BaseAddress = new Uri($"{Configuration["PersonApiBaseAddress"]}"); 42 | }); 43 | 44 | // Suppress default metrics 45 | Metrics.SuppressDefaultMetrics(); 46 | 47 | // Defines statics labels for metrics 48 | Metrics.DefaultRegistry.SetStaticLabels(new Dictionary 49 | { 50 | { "domain", "NetClient" }, 51 | { "domain_context", "NetClient.Elastic" } 52 | }); 53 | } 54 | 55 | /// 56 | /// Configures the HTTP request pipeline. Automatically called by the runtime. 57 | /// 58 | /// The application builder. 59 | /// The host environment. 60 | public void Configure(IApplicationBuilder app, IHostEnvironment env) 61 | { 62 | app.UseAllElasticApm(Configuration); 63 | 64 | // Configure the HTTP request pipeline. 65 | if (!env.IsDevelopment()) 66 | { 67 | app.UseExceptionHandler("/Error"); 68 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 69 | app.UseHsts(); 70 | } 71 | 72 | app.UseRouting(); 73 | app.UseStaticFiles(); 74 | app.UseSerilogRequestLogging(); 75 | 76 | app.UseEndpoints(endpoints => 77 | { 78 | endpoints.MapHealthChecks("/hc", new HealthCheckOptions() 79 | { 80 | Predicate = _ => true, 81 | ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse 82 | }); 83 | 84 | endpoints.MapHealthChecks("/liveness", new HealthCheckOptions 85 | { 86 | Predicate = r => r.Name.Contains("self") 87 | }); 88 | 89 | endpoints.MapMetrics(); 90 | 91 | endpoints.MapBlazorHub(); 92 | endpoints.MapFallbackToPage("/_Host"); 93 | }); 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/Tasks/DataService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | using Prometheus; 3 | namespace NetClient.Elastic.Tasks 4 | { 5 | public class DataService : BackgroundService 6 | { 7 | private readonly ILogger _logger; 8 | private readonly Settings _settings; 9 | private readonly Random _random = new Random(); 10 | 11 | private static readonly GaugeConfiguration configuration = new GaugeConfiguration { LabelNames = new[] { "service" }}; 12 | private readonly Gauge Gauge1 = Metrics.CreateGauge("myapp_gauge1", "A simple gauge 1", configuration); 13 | private readonly Gauge Gauge2 = Metrics.CreateGauge("myapp_gauge2", "A simple gauge 2", configuration); 14 | private readonly Gauge Gauge3 = Metrics.CreateGauge("myapp_gauge3", "A simple gauge 3", configuration); 15 | private readonly Gauge Gauge4 = Metrics.CreateGauge("myapp_gauge4", "A simple gauge 4", configuration); 16 | private readonly Gauge Gauge5 = Metrics.CreateGauge("myapp_gauge5", "A simple gauge 5", configuration); 17 | private readonly Gauge Gauge6 = Metrics.CreateGauge("myapp_gauge6", "A simple gauge 6", configuration); 18 | private readonly Gauge Gauge7 = Metrics.CreateGauge("myapp_gauge7", "A simple gauge 7", configuration); 19 | private readonly Gauge Gauge8 = Metrics.CreateGauge("myapp_gauge8", "A simple gauge 8", configuration); 20 | private readonly Gauge Gauge9 = Metrics.CreateGauge("myapp_gauge9", "A simple gauge 9", configuration); 21 | 22 | public DataService(IOptions settings, ILogger logger) 23 | { 24 | _settings = settings?.Value ?? throw new ArgumentNullException(nameof(settings)); 25 | _logger = logger ?? throw new ArgumentNullException(nameof(logger)); 26 | } 27 | 28 | protected override async Task ExecuteAsync(CancellationToken cancellationToken) 29 | { 30 | _logger.LogDebug("{Source} background task is starting.", nameof(DataService)); 31 | 32 | cancellationToken.Register(() => _logger.LogDebug("{Source} background task is stopping.", nameof(DataService))); 33 | 34 | while (!cancellationToken.IsCancellationRequested) 35 | { 36 | _logger.LogDebug("{Source} background task is doing background work.", nameof(DataService)); 37 | 38 | SendData(); 39 | 40 | await Task.Delay(_settings.DataServiceExecutionDelay, cancellationToken); 41 | } 42 | 43 | _logger.LogDebug("{Source} background task is stopping.", nameof(DataService)); 44 | 45 | await Task.CompletedTask; 46 | } 47 | 48 | private void SendData() 49 | { 50 | _logger.LogDebug("{Source} is sending data.", nameof(DataService)); 51 | 52 | Gauge1.WithLabels("service1").Set(_random.Next(1000, 2000)); 53 | Gauge2.WithLabels("service1").Set(_random.Next(2000, 3000)); 54 | Gauge3.WithLabels("service1").Set(_random.Next(3000, 4000)); 55 | Gauge4.WithLabels("service2").Set(_random.Next(4000, 5000)); 56 | Gauge5.WithLabels("service2").Set(_random.Next(5000, 6000)); 57 | Gauge6.WithLabels("service2").Set(_random.Next(6000, 7000)); 58 | Gauge7.WithLabels("service3").Set(_random.Next(7000, 8000)); 59 | Gauge8.WithLabels("service3").Set(_random.Next(8000, 9000)); 60 | Gauge9.WithLabels("service3").Set(_random.Next(9000, 10000)); 61 | 62 | _logger.LogInformation("{Source} has sent some data", nameof(DataService)); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.JSInterop 8 | @using NetClient.Elastic 9 | @using NetClient.Elastic.Shared 10 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Serilog": { 4 | "MinimumLevel": { 5 | "Override": { 6 | "NetClient.Elastic": "Debug" 7 | } 8 | }, 9 | "WriteTo": [ 10 | { 11 | "Name": "Console", 12 | "Args": { 13 | "outputTemplate": "-> [{Timestamp:HH:mm:ss} {Level:u3} {ElasticApmTraceId} {ElasticApmTransactionId}] {Message:lj}{NewLine}{Exception}" 14 | } 15 | } 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Serilog": { 3 | "Using": ["Elastic.Apm.SerilogEnricher"], 4 | "MinimumLevel": { 5 | "Default": "Warning", 6 | "Override": { 7 | "Microsoft.AspnetCore": "Information", 8 | "Microsoft.Hosting": "Information", 9 | "NetClient.Elastic": "Information" 10 | } 11 | }, 12 | "Enrich": ["FromLogContext", "WithMachineName", "WithEnvironmentUserName", "WithEnvironmentName", "WithProcessId", "WithProcessName", "WithThreadId", "WithThreadName", "WithElasticApmCorrelationInfo"], 13 | "Properties": { 14 | "Domain": "NetClient", 15 | "DomainContext": "NetClient.Elastic" 16 | }, 17 | "WriteTo": [ 18 | { 19 | "Name": "Console", 20 | "Args": { 21 | "formatter": "Elastic.CommonSchema.Serilog.EcsTextFormatter, Elastic.CommonSchema.Serilog" 22 | } 23 | } 24 | ] 25 | }, 26 | "AllowedHosts": "*", 27 | "ElasticApm": 28 | { 29 | "ServerUrl": "https://host.docker.internal:8200", 30 | "LogLevel": "Information", 31 | "VerifyServerCert": false 32 | }, 33 | "DataServiceExecutionDelay": 10000, 34 | "BaseAddress": "http://host.docker.internal:8080", 35 | "PersonApiBaseAddress": "http://host.docker.internal:8090/api/v1.0" 36 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 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. -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/src/NetClient.Elastic/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | h1:focus { 8 | outline: none; 9 | } 10 | 11 | a, .btn-link { 12 | color: #0077cc; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .content { 22 | padding-top: 1.1rem; 23 | } 24 | 25 | .valid.modified:not([type=checkbox]) { 26 | outline: 1px solid #26b050; 27 | } 28 | 29 | .invalid { 30 | outline: 1px solid red; 31 | } 32 | 33 | .validation-message { 34 | color: red; 35 | } 36 | 37 | #blazor-error-ui { 38 | background: lightyellow; 39 | bottom: 0; 40 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 41 | display: none; 42 | left: 0; 43 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 44 | position: fixed; 45 | width: 100%; 46 | z-index: 1000; 47 | } 48 | 49 | #blazor-error-ui .dismiss { 50 | cursor: pointer; 51 | position: absolute; 52 | right: 0.75rem; 53 | top: 0.5rem; 54 | } 55 | 56 | .blazor-error-boundary { 57 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 58 | padding: 1rem 1rem 1rem 3.7rem; 59 | color: white; 60 | } 61 | 62 | .blazor-error-boundary::after { 63 | content: "An error has occurred." 64 | } -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/src/NetClient.Elastic/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ijardillier/netclient-elastic/6b110b969faa211adbe55c44127b556423891136/src/NetClient.Elastic/wwwroot/icon-192.png -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NetClient Elastic 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Loading...
16 | 17 |
18 | An unhandled error has occurred. 19 | Reload 20 | 🗙 21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/NetClient.Elastic/wwwroot/sample-data/weather.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "2018-05-06", 4 | "temperatureC": 1, 5 | "summary": "Freezing" 6 | }, 7 | { 8 | "date": "2018-05-07", 9 | "temperatureC": 14, 10 | "summary": "Bracing" 11 | }, 12 | { 13 | "date": "2018-05-08", 14 | "temperatureC": -13, 15 | "summary": "Freezing" 16 | }, 17 | { 18 | "date": "2018-05-09", 19 | "temperatureC": -16, 20 | "summary": "Balmy" 21 | }, 22 | { 23 | "date": "2018-05-10", 24 | "temperatureC": -2, 25 | "summary": "Chilly" 26 | } 27 | ] 28 | --------------------------------------------------------------------------------