Skip to content

Commit 75e3816

Browse files
committed
WIP
1 parent b6fcc19 commit 75e3816

26 files changed

+81
-9
lines changed

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter_options.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ namespace otlp
2727
*/
2828
struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions
2929
{
30+
/** Lookup environment variables. */
3031
OtlpHttpExporterOptions();
32+
/** No defaults. */
33+
OtlpHttpExporterOptions(void * /* raw */);
3134
~OtlpHttpExporterOptions();
3235

3336
/** The endpoint to export to. */

exporters/otlp/src/otlp_http_exporter_options.cc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ OtlpHttpExporterOptions::OtlpHttpExporterOptions()
4747
compression = GetOtlpDefaultTracesCompression();
4848
}
4949

50+
OtlpHttpExporterOptions::OtlpHttpExporterOptions(void *)
51+
: json_bytes_mapping(JsonBytesMappingKind::kHexId),
52+
use_json_name(false),
53+
console_debug(false),
54+
ssl_insecure_skip_verify(false)
55+
{
56+
url = "";
57+
content_type = HttpRequestContentType::kBinary;
58+
59+
#ifdef ENABLE_ASYNC_EXPORT
60+
max_concurrent_requests = 64;
61+
max_requests_per_connection = 8;
62+
#endif /* ENABLE_ASYNC_EXPORT */
63+
64+
ssl_ca_cert_path = "";
65+
ssl_ca_cert_string = "";
66+
ssl_client_key_path = "";
67+
ssl_client_key_string = "";
68+
ssl_client_cert_path = "";
69+
ssl_client_cert_string = "";
70+
71+
ssl_min_tls = "";
72+
ssl_max_tls = "";
73+
ssl_cipher = "";
74+
ssl_cipher_suite = "";
75+
76+
compression = "";
77+
}
78+
5079
OtlpHttpExporterOptions::~OtlpHttpExporterOptions() {}
5180

5281
} // namespace otlp

exporters/otlp/src/otlp_http_span_builder.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@ void OtlpHttpSpanBuilder::Register(opentelemetry::sdk::init::Registry *registry)
2020
}
2121

2222
std::unique_ptr<opentelemetry::sdk::trace::SpanExporter> OtlpHttpSpanBuilder::Build(
23-
const opentelemetry::sdk::configuration::OtlpSpanExporterConfiguration * /* model */) const
23+
const opentelemetry::sdk::configuration::OtlpSpanExporterConfiguration *model) const
2424
{
25-
// FIXME, use model
26-
OtlpHttpExporterOptions options;
25+
OtlpHttpExporterOptions options(nullptr);
26+
options.url = model->endpoint;
27+
options.content_type = GetOtlpHttpProtocolFromString(model->protocol);
28+
options.timeout = std::chrono::duration_cast<std::chrono::system_clock::duration>(
29+
std::chrono::seconds{model->timeout});
30+
// options.http_headers = model->xxx;
31+
options.ssl_ca_cert_path = model->certificate;
32+
options.ssl_client_key_path = model->client_key;
33+
options.ssl_client_cert_path = model->client_certificate;
2734
return OtlpHttpExporterFactory::Create(options);
2835
}
2936

sdk/include/opentelemetry/sdk/configuration/attribute_limit_configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace sdk
1313
namespace configuration
1414
{
1515

16+
// REF: schema/opentelemetry_configuration.json
1617
class AttributeLimitConfiguration
1718
{
1819
public:

sdk/include/opentelemetry/sdk/configuration/batch_log_record_processor_configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace sdk
1414
namespace configuration
1515
{
1616

17+
// REF: schema/logger_provider.json
1718
class BatchLogRecordProcessorConfiguration : public LogRecordProcessorConfiguration
1819
{
1920
public:

sdk/include/opentelemetry/sdk/configuration/configuration.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace sdk
2020
namespace configuration
2121
{
2222

23+
// REF: schema/opentelemetry_configuration.json
2324
class Configuration
2425
{
2526
public:
@@ -35,6 +36,7 @@ class Configuration
3536
std::unique_ptr<PropagatorConfiguration> propagator;
3637
std::unique_ptr<TracerProviderConfiguration> tracer_provider;
3738
std::unique_ptr<ResourceConfiguration> resource;
39+
// Ignored: instrumentation
3840

3941
private:
4042
std::unique_ptr<Document> m_doc;

sdk/include/opentelemetry/sdk/configuration/console_log_record_exporter_configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace sdk
1313
namespace configuration
1414
{
1515

16+
// REF: schema/common.json, Console
1617
class ConsoleLogRecordExporterConfiguration : public LogRecordExporterConfiguration
1718
{
1819
public:

sdk/include/opentelemetry/sdk/configuration/console_push_metric_exporter_configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace sdk
1414
namespace configuration
1515
{
1616

17+
// REF: schema/common.json, Console
1718
class ConsolePushMetricExporterConfiguration : public PushMetricExporterConfiguration
1819
{
1920
public:

sdk/include/opentelemetry/sdk/configuration/extension_log_record_exporter_configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace sdk
1414
namespace configuration
1515
{
1616

17+
// REF: schema/logger_provider.json
1718
class ExtensionLogRecordExporterConfiguration : public LogRecordExporterConfiguration
1819
{
1920
public:

sdk/include/opentelemetry/sdk/configuration/extension_pull_metric_exporter_configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace sdk
1414
namespace configuration
1515
{
1616

17+
// REF: schema/meter_provider.json
1718
class ExtensionPullMetricExporterConfiguration : public PullMetricExporterConfiguration
1819
{
1920
public:

0 commit comments

Comments
 (0)