11# OpenCensus .NET SDK - distributed tracing and stats collection framework
22
33[ ![ Gitter chat] [ gitter-image ]] [ gitter-url ]
4+ [ ![ Build Status] ( https://opencensus.visualstudio.com/continuous-integration/_apis/build/status/ci-myget-update.yml )] ( https://opencensus.visualstudio.com/continuous-integration/_build/latest?definitionId=3 )
5+
6+ | Source | OpenCensus | Zipkin Exporter | Application Insights exporter |
7+ | --------| ------------------------------------------------------------------| --------------------------------------------------------------------------------------------------| ------------------------------------------------------------------------------------------|
8+ | MyGet | [ ![ MyGet Nightly] [ opencensus-myget-image ]] [ opencensus-myget-url ] | [ ![ MyGet Nightly] [ opencensus-exporter-zipkin-myget-image ]] [ opencensus-exporter-zipkin-myget-url ] | [ ![ MyGet Nightly] [ opencensus-exporter-ai-myget-image ]] [ opencensus-exporter-ai-myget-url ] |
49
5- MyGet: [ ![ MyGet Nightly] [ opencensus-myget-image ]] [ opencensus-myget-url ]
610
711OpenCensus is a toolkit for collecting application performance and behavior
812data. It currently includes 3 APIs: stats, tracing and tags.
@@ -14,37 +18,56 @@ major release.
1418Please join [ gitter] ( https://gitter.im/census-instrumentation/Lobby ) for help
1519or feedback on this project.
1620
17- We encourage contributions. Use tags
18- [ up-for-grabs] ( https://github.com/census-instrumentation/opencensus-csharp/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs )
19- and [ good first
20- issue] ( https://github.com/census-instrumentation/opencensus-csharp/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 )
21- to get started with the project. Follow [ CONTRIBUTING] ( CONTRIBUTING.md ) guide
22- to report issues or submit a proposal.
21+ We encourage contributions. Use tags [ up-for-grabs] [ up-for-grabs-issues ] and
22+ [ good first issue] [ good-first-issues ] to get started with the project. Follow
23+ [ CONTRIBUTING] ( CONTRIBUTING.md ) guide to report issues or submit a proposal.
2324
2425## OpenCensus Quickstart
2526
2627### Using Zipkin exporter
2728
2829Configure Zipkin exporter to see traces in Zipkin UI.
2930
30- 1 . Get Zipkin using getting [ started
31- guide] ( https://zipkin.io/pages/quickstart.html ) .
31+ 1 . Get Zipkin using [ getting started guide] [ zipkin-get-started ] .
32322 . Start ` ZipkinTraceExporter ` as below:
33+ 3 . See [ sample] [ zipkin-sample ] for example use.
3334
3435``` csharp
3536var exporter = new ZipkinTraceExporter (
3637 new ZipkinTraceExporterOptions () {
37- Endpoint = " https://<zipkin-server:9411>/api/v2/spans" ,
38+ Endpoint = new Uri ( " https://<zipkin-server:9411>/api/v2/spans" ) ,
3839 ServiceName = typeof (Program ).Assembly .GetName ().Name ,
3940 },
4041 Tracing .ExportComponent );
4142exporter .Start ();
4243
43- var span = tracer .SpanBuilder (" incoming request" ).SetSampler (Samplers .AlwaysSample ).StartSpan ();
44+ var span = tracer
45+ .SpanBuilder (" incoming request" )
46+ .SetSampler (Samplers .AlwaysSample )
47+ .StartSpan ();
48+
4449Thread .Sleep (TimeSpan .FromSeconds (1 ));
4550span .End ();
4651```
4752
53+ ### Using Application Insights exporter
54+
55+ 1 . Create [ Application Insights] [ ai-get-started ] resource.
56+ 2 . Set instrumentation key via telemetry configuration object
57+ (` new TelemetryConfiguration("iKey") ` ). This object may be injected via
58+ dependency injection as well.
59+ 3 . Instantiate a new instance of ` ApplicationInsightsExporter ` .
60+ 4 . See [ sample] [ ai-sample ] for example use.
61+
62+ ``` csharp
63+ var config = new TelemetryConfiguration (" iKey" )
64+ var exporter = new ApplicationInsightsExporter (
65+ Tracing .ExportComponent ,
66+ Stats .ViewManager ,
67+ config ); // either global or local config can be used
68+ exporter .Start ();
69+ ```
70+
4871## Versioning
4972
5073This library follows [ Semantic Versioning] [ semver ] .
@@ -64,10 +87,17 @@ opencensus libraries, then there is no deprecation period. Otherwise, we will
6487deprecate it for 18 months before removing it, if possible.
6588
6689[ gitter-image ] : https://badges.gitter.im/census-instrumentation/lobby.svg
67- [ gitter-url] :
68- https://gitter.im/census-instrumentation/lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
69- [ opencensus-myget-image] :
70- https://img.shields.io/myget/opencensus/vpre/OpenCensus.svg
71- [ opencensus-myget-url] :
72- https://www.myget.org/feed/opencensus/package/nuget/OpenCensus [ semver] :
73- http://semver.org/
90+ [ gitter-url ] :https://gitter.im/census-instrumentation/lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
91+ [ opencensus-myget-image ] :https://img.shields.io/myget/opencensus/vpre/OpenCensus.svg
92+ [ opencensus-myget-url ] : https://www.myget.org/feed/opencensus/package/nuget/OpenCensus
93+ [ opencensus-exporter-zipkin-myget-image ] :https://img.shields.io/myget/opencensus/vpre/OpenCensus.Exporter.Zipkin.svg
94+ [ opencensus-exporter-zipkin-myget-url ] : https://www.myget.org/feed/opencensus/package/nuget/OpenCensus.Exporter.Zipkin
95+ [ opencensus-exporter-ai-myget-image ] :https://img.shields.io/myget/opencensus/vpre/OpenCensus.Exporter.ApplicationInsights.svg
96+ [ opencensus-exporter-ai-myget-url ] : https://www.myget.org/feed/opencensus/package/nuget/OpenCensus.Exporter.ApplicationInsights
97+ [ up-for-grabs-issues ] : https://github.com/census-instrumentation/opencensus-csharp/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs
98+ [ good-first-issues ] : https://github.com/census-instrumentation/opencensus-csharp/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
99+ [ zipkin-get-started ] : https://zipkin.io/pages/quickstart.html
100+ [ ai-get-started ] : https://docs.microsoft.com/azure/application-insights
101+ [ semver ] : http://semver.org/
102+ [ ai-sample ] : https://github.com/census-instrumentation/opencensus-csharp/blob/develop/src/Samples/TestApplicationInsights.cs
103+ [ zipkin-sample ] : https://github.com/census-instrumentation/opencensus-csharp/blob/develop/src/Samples/TestZipkin.cs
0 commit comments