Skip to content

Commit

Permalink
Added link tests for windows DLL.
Browse files Browse the repository at this point in the history
Status: tentative.
  • Loading branch information
marcalff committed Nov 6, 2023
1 parent 4b3c3c9 commit 544707e
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions ext/src/dll/dllmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@
#include <opentelemetry/logs/logger_provider.h>
#include <opentelemetry/logs/provider.h>

#include <opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_options.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_options.h>
#include <opentelemetry/exporters/otlp/otlp_http_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_http_exporter_options.h>
#include <opentelemetry/exporters/otlp/otlp_http_log_record_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_http_log_record_exporter_options.h>
#include <opentelemetry/exporters/otlp/otlp_http_metric_exporter_factory.h>
#include <opentelemetry/exporters/otlp/otlp_http_metric_exporter_options.h>

extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(hInstance);
Expand All @@ -17,3 +30,57 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpRes

return TRUE;
}

extern std::unique_ptr<opentelemetry::sdk::trace::SpanExporter> test_otlp_http_trace()
{
opentelemetry::exporter::otlp::OtlpHttpExporterOptions options;
options.url = "your endpoint";

auto e = opentelemetry::exporter::otlp::OtlpHttpExporterFactory::Create(options);
return e;
}

extern std::unique_ptr<opentelemetry::sdk::metrics::PushMetricExporter> test_otlp_http_metrics()
{
opentelemetry::exporter::otlp::OtlpHttpMetricExporterOptions options;
options.url = "your endpoint";

auto e = opentelemetry::exporter::otlp::OtlpHttpMetricExporterFactory::Create(options);
return e;
}

extern std::unique_ptr<opentelemetry::sdk::logs::LogRecordExporter> test_otlp_http_logs()
{
opentelemetry::exporter::otlp::OtlpHttpLogRecordExporterOptions options;
options.url = "your endpoint";

auto e = opentelemetry::exporter::otlp::OtlpHttpLogRecordExporterFactory::Create(options);
return e;
}

extern std::unique_ptr<opentelemetry::sdk::trace::SpanExporter> test_otlp_grpc_trace()
{
opentelemetry::exporter::otlp::OtlpGrpcExporterOptions options;
options.endpoint = "your endpoint";

auto e = opentelemetry::exporter::otlp::OtlpGrpcExporterFactory::Create(options);
return e;
}

extern std::unique_ptr<opentelemetry::sdk::metrics::PushMetricExporter> test_otlp_grpc_metrics()
{
opentelemetry::exporter::otlp::OtlpGrpcMetricExporterOptions options;
options.endpoint = "your endpoint";

auto e = opentelemetry::exporter::otlp::OtlpGrpcMetricExporterFactory::Create(options);
return e;
}

extern std::unique_ptr<opentelemetry::sdk::logs::LogRecordExporter> test_otlp_grpc_logs()
{
opentelemetry::exporter::otlp::OtlpGrpcLogRecordExporterOptions options;
options.endpoint = "your endpoint";

auto e = opentelemetry::exporter::otlp::OtlpGrpcLogRecordExporterFactory::Create(options);
return e;
}

0 comments on commit 544707e

Please sign in to comment.