Updating exporter docs (#855)

* Updating exporter docs

* updating based on MDlint

* Adding prerequisite section
This commit is contained in:
Eddy Nakamura 2020-07-20 21:03:03 -03:00 committed by GitHub
parent 2892bdd072
commit 47689cea36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 48 deletions

View File

@ -43,7 +43,7 @@ namespace Samples
.MapResult(
(JaegerOptions options) => TestJaegerExporter.Run(options.Host, options.Port),
(ZipkinOptions options) => TestZipkinExporter.Run(options.Uri),
(PrometheusOptions options) => TestPrometheus.RunAsync(options.Port, options.PushIntervalInSecs, options.DurationInMins),
(PrometheusOptions options) => TestPrometheusExporter.RunAsync(options.Port, options.PushIntervalInSecs, options.DurationInMins),
(HttpClientOptions options) => TestHttpClient.Run(),
(RedisOptions options) => TestRedis.Run(options.Uri),
(ZPagesOptions options) => TestZPagesExporter.Run(),

View File

@ -1,4 +1,4 @@
// <copyright file="TestPrometheus.cs" company="OpenTelemetry Authors">
// <copyright file="TestPrometheusExporter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -26,7 +26,7 @@ using OpenTelemetry.Trace;
namespace Samples
{
internal class TestPrometheus
internal class TestPrometheusExporter
{
internal static async Task<object> RunAsync(int port, int pushIntervalInSecs, int totalDurationInMins)
{

View File

@ -15,6 +15,16 @@ environment.
dotnet add package OpenTelemetry.Exporter.Console
```
## Configuration
You can configure the `ConsoleExporter` by following the directions below:
* `DisplayAsJson`: Boolean to show data as JSON.
See the
[`TestConsoleExporter.cs`](../../samples/Exporters/Console/TestConsoleExporter.cs)
for an example of how to use the exporter.
## References
* [OpenTelemetry Project](https://opentelemetry.io/)

View File

@ -6,12 +6,28 @@
The OTLP (OpenTelemetry Protocol) exporter communicates to an OpenTelemetry
Collector through a gRPC protocol.
## Prerequisite
* [Get OpenTelemetry Collector](https://opentelemetry.io/docs/collector/about/)
## Installation
```shell
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
```
## Configuration
You can configure the `OtlpExporter` by following the directions below:
* `Endpoint`: Target to which the exporter is going to send traces or metrics.
* `Credentials`: Client-side channel credentials.
* `Headers`: Optional headers for the connection.
See the
[`TestOtlpExporter.cs`](../../samples/Exporters/Console/TestOtlpExporter.cs)
for an example of how to use the exporter.
## References
* [OpenTelemetry

View File

@ -15,31 +15,12 @@ dotnet add package OpenTelemetry.Exporter.Prometheus
## Configuration
Start `PrometheusExporter` as below.
You can configure the `PrometheusExporter` by following the directions below:
```csharp
var exporter = new PrometheusExporter(
new PrometheusExporterOptions()
{
Url = "http://+:9184/metrics/"
},
Stats.ViewManager);
exporter.Start();
try
{
// record metrics
statsRecorder.NewMeasureMap().Put(VideoSize, values[0] * MiB).Record();
}
finally
{
exporter.Stop();
}
```
* `Url`: The url to listen to. Typically it ends with `/metrics` like `http://localhost:9184/metrics/`.
See
[sample](https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/Console/TestPrometheus.cs)
[`TestPrometheusExporter.cs`](../../samples/Exporters/Console/TestPrometheusExporter.cs)
for example use.
## References

View File

@ -9,6 +9,17 @@
dotnet add package OpenTelemetry.Exporter.ZPages
```
## Configuration
You can configure the `ZPagesExporter` by following the directions below:
* `Url`: The url to listen to. Typically it ends with `/rpcz` like `http://localhost:7284/rpcz/`.
* `RetentionTime`: The retention time (in milliseconds) for the metrics.
See the
[`TestZPagesExporter.cs`](../../samples/Exporters/Console/TestZPagesExporter.cs)
for an example of how to use the exporter.
## References
* [OpenTelemetry Project](https://opentelemetry.io/)

View File

@ -15,32 +15,15 @@ dotnet add package OpenTelemetry.Exporter.Zipkin
## Configuration
Configure `ZipkinTraceExporter` as below:
You can configure the `ZipkinExporter` by following the directions below:
```csharp
using (var tracerFactory = TracerFactory.Create(builder => builder
.UseZipkin(o =>
{
o.ServiceName = "test-zipkin";
o.Endpoint = new Uri(zipkinUri);
})))
{
var tracer = tracerFactory.GetTracer("zipkin-test");
// Create a scoped span. It will end automatically when using statement ends
using (tracer.WithSpan(tracer.StartSpan("Main")))
{
Console.WriteLine("About to do a busy work");
for (var i = 0; i < 10; i++)
{
DoWork(i, tracer);
}
}
}
```
* `Endpoint`: Zipkin endpoint address.
* `TimeoutSeconds`: Timeout in seconds.
* `ServiceName`: Name of the service reporting telemetry.
* `UseShortTraceIds`: Value indicating whether short trace id should be used.
See
[sample](https://github.com/open-telemetry/opentelemetry-dotnet/blob/master/samples/Exporters/Console/TestZipkin.cs)
[`TestZipkinExporter.cs`](../../samples/Exporters/Console/TestZipkinExporter.cs)
for example use.
## References