Source | OpenCensus | Zipkin Exporter | Application Insights exporter |
---|---|---|---|
MyGet |
OpenCensus is a toolkit for collecting application performance and behavior data. It currently includes 3 APIs: stats, tracing and tags.
The library is in Beta stage and APIs are expected to be mostly stable. The library is expected to move to GA stage after v1.0.0 major release.
Please join gitter for help or feedback on this project.
We encourage contributions. Use tags up-for-grabs and good first issue to get started with the project. Follow CONTRIBUTING guide to report issues or submit a proposal.
Configure Zipkin exporter to see traces in Zipkin UI.
- Get Zipkin using getting started guide.
- Start
ZipkinTraceExporter
as below: - See sample for example use.
var exporter = new ZipkinTraceExporter(
new ZipkinTraceExporterOptions() {
Endpoint = new Uri("https://<zipkin-server:9411>/api/v2/spans"),
ServiceName = typeof(Program).Assembly.GetName().Name,
},
Tracing.ExportComponent);
exporter.Start();
var span = tracer
.SpanBuilder("incoming request")
.SetSampler(Samplers.AlwaysSample)
.StartSpan();
Thread.Sleep(TimeSpan.FromSeconds(1));
span.End();
Configure Prometheus exporter to have stats collected by Prometheus.
- Get Prometheus using getting started guide.
- Start
PrometheusExporter
as below. - See sample for example use.
var exporter = new PrometheusExporter(
new PrometheusExporterOptions()
{
Url = new Uri("http://localhost:9184/metrics/")
},
Stats.ViewManager);
exporter.Start();
try
{
// record metrics
statsRecorder.NewMeasureMap().Put(VideoSize, values[0] * MiB).Record();
}
finally
{
exporter.Stop();
}
- Enable Stackdriver Trace resource.
- Instantiate a new instance of
StackdriverExporter
with your Google Cloud's ProjectId - See sample for example use.
var exporter = new StackdriverExporter("YOUR-GOOGLE-PROJECT-ID", Tracing.ExportComponent);
exporter.Start();
- Create Application Insights resource.
- Set instrumentation key via telemetry configuration object
(
new TelemetryConfiguration("iKey")
). This object may be injected via dependency injection as well. - Instantiate a new instance of
ApplicationInsightsExporter
. - See sample for example use.
var config = new TelemetryConfiguration("iKey")
var exporter = new ApplicationInsightsExporter(
Tracing.ExportComponent,
Stats.ViewManager,
config); // either global or local config can be used
exporter.Start();
This library follows Semantic Versioning.
GA: Libraries defined at a GA quality level are stable, and will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority. If we were to make a backwards-incompatible changes on an API, we will first mark the existing API as deprecated and keep it for 18 months before removing it.
Beta: Libraries defined at a Beta quality level are expected to be mostly stable and we're working towards their release candidate. We will address issues and requests with a higher priority. There may be backwards incompatible changes in a minor version release, though not in a patch release. If an element is part of an API that is only meant to be used by exporters or other opencensus libraries, then there is no deprecation period. Otherwise, we will deprecate it for 18 months before removing it, if possible.