Skip to content

Latest commit

 

History

History
82 lines (59 loc) · 2.98 KB

File metadata and controls

82 lines (59 loc) · 2.98 KB
title C++
metaTitle Learn How to Integrate and Configure C++ to Send Traces
pageTitle OpenTelemetry C++ Configuration
subTitle Ship traces from C++ to OpenSearch with OpenTelemetry
logo cpp
color #1a3b63
description Follow the steps in Logit.io's C++ source integrations to ship traces from C++ to OpenSearch with OpenTelemetry.
stackTypes apm
tags C++, Cpp, Cplusplus++, Apm, Grpc, Http

Use OpenTelemetry to easily send C++ traces to your Logit.io Stack.

## APM ### Install Integration

Getting Started

<Tabs items={["HTTPS", "gRPC"]}>

You can get help Getting Started with OpenTelemetry for C++ by referring to the [official documentation](https://opentelemetry.io/docs/instrumentation/cpp/getting-started/). You need to configure the OTLP exporter to ensure the trace data reaches your Logit.io Stack.
OTLP HTTP Exporter settings:

```cpp copy showLineNumbers /@opentelemetry.endpointAddress/ /@opentelemetry.httpsPort/ /@opentelemetry.base64encodedAuthString/
#include "opentelemetry/exporters/otlp/otlp_https_exporter_factory.h"
#include "opentelemetry/exporters/otlp/otlp_https_exporter_options.h"

namespace otlp = opentelemetry::exporter::otlp;

otlp::OtlpHttpExporterOptions opts;
opts.url = "https://@opentelemetry.endpointAddress:@opentelemetry.httpsPort";
opts.http_headers = "Authorization=Basic @opentelemetry.base64encodedAuthString";

auto exporter = otlp::OtlpHttpExporterFactory::Create(opts);
```

For more information about exporter configuration with C++ please refer to the 
[documentation](https://opentelemetry.io/docs/instrumentation/cpp/exporters/).
You can get help Getting Started with OpenTelemetry for C++ by referring to the [official documentation](https://opentelemetry.io/docs/instrumentation/cpp/getting-started/). You need to configure the OTLP exporter to ensure the trace data reaches your Logit.io Stack.
OTLP gRPC Exporter settings:

```cpp copy showLineNumbers /@opentelemetry.endpointAddress/ /@opentelemetry.grpcPort/ /@opentelemetry.base64encodedAuthString/
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h"
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h"

namespace otlp = opentelemetry::exporter::otlp;

otlp::OtlpGrpcExporterOptions opts;
opts.endpoint = "https://@opentelemetry.endpointAddress:@opentelemetry.grpcPort";
opts.metadata.insert(std::pair<std::string, std::string>(
    "authorization", "Basic @opentelemetry.base64encodedAuthString"));

auto exporter = otlp::OtlpGrpcExporterFactory::Create(opts);
```

For more information about exporter configuration with C++ please refer to the 
[documentation](https://opentelemetry.io/docs/instrumentation/cpp/exporters/).

Launch Jaeger to View Your Data

How to diagnose no data in Stack