Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/otlp/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace otlp = opentelemetry::exporter::otlp;

namespace
{
void initTracer()
void InitTracer()
{
// Create OTLP exporter instance
auto exporter = std::unique_ptr<sdktrace::SpanExporter>(new otlp::OtlpExporter);
Expand All @@ -28,7 +28,7 @@ void initTracer()
int main()
{
// Removing this line will leave the default noop TracerProvider in place.
initTracer();
InitTracer();

foo_library();
}
27 changes: 27 additions & 0 deletions exporters/otlp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OTLP Exporter

The [OpenTelemetry Protocol](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/protocol/README.md) (OTLP) is a vendor-agnostic protocol designed as part of the OpenTelemetry project. The OTLP exporter can be used to export to any backend that supports OTLP.

The [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) is a reference implementation of an OTLP backend. The Collector can be configured to export to many other backends, such as Zipkin and Jaegar.

For a full list of backends supported by the Collector, see the [main Collector repo](https://github.com/open-telemetry/opentelemetry-collector/tree/master/exporter) and [Collector contributions](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/master/exporter).

## Configuration

The OTLP exporter offers some configuration options. To configure the exporter, create an `OtlpExporterOptions` struct (defined in [exporter.h](include/exporter.h)), set the options inside, and pass the struct to the `OtlpExporter` constructor, like so:

```
OtlpExporterOptions options;
options.endpoint = "localhost:12345";
auto exporter = std::unique_ptr<sdktrace::SpanExporter>(new otlp::OtlpExporter(options));
```

### Configuration options

| Option | Default |
| ------------ |------------------ |
| `endpoint` | `localhost:55680` |

## Example

For a complete example demonstrating how to use the OTLP exporter, see [examples/otlp](../../examples/otlp).
Comment thread
nadiaciobanu marked this conversation as resolved.