A sample demonstrating how to create traces using the ASP.NET Core and Google Cloud Stackdriver Trace.
This sample requires .NET Core 2.0 or later. That means using Visual Studio 2017, or the command line. Visual Studio 2015 users can use this older sample.
-
Follow the set-up instructions in the documentation.
-
In appsettings.json change the placeholder value of "YOUR-GOOGLE-PROJECT-ID" to be your project id.
-
From a Powershell command line, run the Trace sample:
PS C:\...\dotnet-docs-samples\trace\api> dotnet run Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down. Application is shutting down...
-
Open the running sample web app http://localhost:5000 in a web browser which will display a confirmation that trace is configured along with a link to initiate a trace like:
Trace has been configured for use with this application.
See the Stackdriver Trace dashboard in the Google Cloud Console
to view traces for your application.
•Initiate a trace
-
Click the "Initiate a trace" link to create a sample trace.
-
Go back to Powershell and Press Ctrl+C to close the web app which will still be running.
-
The sample trace is viewable on the Stackdriver Trace page in the Cloud Platform Console.
-
Install the Google Cloud SDK. The Google Cloud SDK is required to deploy .NET applications to App Engine.
-
Google Cloud Tools for Visual Studio make it easy to deploy to App Engine. Install them if you are running Visual Studio.
PS > dotnet restore
PS > dotnet publish
PS > gcloud beta app deploy .\bin\Debug\netcoreapp2.0\publish\app.yaml
-
In Solution Explorer, right-click the Trace project and choose Publish to Google Cloud.
-
Click App Engine Flex.
-
Click Publish.
- See CONTRIBUTING.md
- See LICENSE