opentelemetry-cpp: init at 1.13.0

Build with support for:

- in memory
- otlp http
- otlp grpc
- zipkin
- prometheus
- elasticsearch

Co-authored-by: tobim <tobim+github@fastmail.fm>
Co-authored-by: Nicolas Benes <nbenes.gh@xandea.de>

+174
+79
pkgs/by-name/op/opentelemetry-cpp/0001-Disable-tests-requiring-network-access.patch
···
··· 1 + diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc 2 + index 7c66d98b..62d40f49 100644 3 + --- a/ext/test/http/curl_http_test.cc 4 + +++ b/ext/test/http/curl_http_test.cc 5 + @@ -229,7 +229,7 @@ TEST_F(BasicCurlHttpTests, HttpResponse) 6 + ASSERT_EQ(count, 4); 7 + } 8 + 9 + -TEST_F(BasicCurlHttpTests, SendGetRequest) 10 + +TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequest) 11 + { 12 + received_requests_.clear(); 13 + auto session_manager = http_client::HttpClientFactory::Create(); 14 + @@ -246,7 +246,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequest) 15 + ASSERT_TRUE(handler->got_response_); 16 + } 17 + 18 + -TEST_F(BasicCurlHttpTests, SendPostRequest) 19 + +TEST_F(BasicCurlHttpTests, DISABLED_SendPostRequest) 20 + { 21 + received_requests_.clear(); 22 + auto session_manager = http_client::HttpClientFactory::Create(); 23 + @@ -325,7 +325,7 @@ TEST_F(BasicCurlHttpTests, CurlHttpOperations) 24 + delete handler; 25 + } 26 + 27 + -TEST_F(BasicCurlHttpTests, SendGetRequestSync) 28 + +TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequestSync) 29 + { 30 + received_requests_.clear(); 31 + curl::HttpClientSync http_client; 32 + @@ -336,7 +336,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestSync) 33 + EXPECT_EQ(result.GetSessionState(), http_client::SessionState::Response); 34 + } 35 + 36 + -TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout) 37 + +TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequestSyncTimeout) 38 + { 39 + received_requests_.clear(); 40 + curl::HttpClientSync http_client; 41 + @@ -350,7 +350,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout) 42 + result.GetSessionState() == http_client::SessionState::SendFailed); 43 + } 44 + 45 + -TEST_F(BasicCurlHttpTests, SendPostRequestSync) 46 + +TEST_F(BasicCurlHttpTests, DISABLED_SendPostRequestSync) 47 + { 48 + received_requests_.clear(); 49 + curl::HttpClientSync http_client; 50 + @@ -378,7 +378,7 @@ TEST_F(BasicCurlHttpTests, GetBaseUri) 51 + "http://127.0.0.1:31339/"); 52 + } 53 + 54 + -TEST_F(BasicCurlHttpTests, SendGetRequestAsync) 55 + +TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequestAsync) 56 + { 57 + curl::HttpClient http_client; 58 + 59 + @@ -452,7 +452,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestAsyncTimeout) 60 + } 61 + } 62 + 63 + -TEST_F(BasicCurlHttpTests, SendPostRequestAsync) 64 + +TEST_F(BasicCurlHttpTests, DISABLED_SendPostRequestAsync) 65 + { 66 + curl::HttpClient http_client; 67 + 68 + @@ -491,7 +491,7 @@ TEST_F(BasicCurlHttpTests, SendPostRequestAsync) 69 + } 70 + } 71 + 72 + -TEST_F(BasicCurlHttpTests, FinishInAsyncCallback) 73 + +TEST_F(BasicCurlHttpTests, DISABLED_FinishInAsyncCallback) 74 + { 75 + curl::HttpClient http_client; 76 + 77 + -- 78 + 2.40.1 79 +
+16
pkgs/by-name/op/opentelemetry-cpp/0002-Disable-segfaulting-test-on-Darwin.patch
···
··· 1 + diff --git a/api/test/singleton/singleton_test.cc b/api/test/singleton/singleton_test.cc 2 + index 187e26f..ddbe29f 100644 3 + --- a/api/test/singleton/singleton_test.cc 4 + +++ b/api/test/singleton/singleton_test.cc 5 + @@ -306,7 +306,7 @@ void cleanup_otel() 6 + trace_api::Provider::SetTracerProvider(provider); 7 + } 8 + 9 + -TEST(SingletonTest, Uniqueness) 10 + +TEST(SingletonTest, DISABLED_Uniqueness) 11 + { 12 + do_something(); 13 + 14 + -- 15 + 2.42.0 16 +
+79
pkgs/by-name/op/opentelemetry-cpp/package.nix
···
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , cmake 5 + , gtest 6 + , protobuf 7 + , curl 8 + , grpc 9 + , prometheus-cpp 10 + , nlohmann_json 11 + , nix-update-script 12 + }: 13 + 14 + let 15 + opentelemetry-proto = fetchFromGitHub { 16 + owner = "open-telemetry"; 17 + repo = "opentelemetry-proto"; 18 + rev = "v1.0.0"; 19 + hash = "sha256-1IylAZs8gElpruSX52A+ZopU8jXH/MjRE+FQV3gQ+Gk="; 20 + }; 21 + in 22 + stdenv.mkDerivation (finalAttrs: { 23 + pname = "opentelemetry-cpp"; 24 + version = "1.13.0"; 25 + 26 + src = fetchFromGitHub { 27 + owner = "open-telemetry"; 28 + repo = "opentelemetry-cpp"; 29 + rev = "v${finalAttrs.version}"; 30 + hash = "sha256-Tf1ZnmHavnwwvRb4Tes20LMld+w/2kRo5UErT8pHf3w="; 31 + }; 32 + 33 + patches = [ 34 + ./0001-Disable-tests-requiring-network-access.patch 35 + ] ++ lib.optional stdenv.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch; 36 + 37 + nativeBuildInputs = [ cmake ]; 38 + 39 + buildInputs = [ 40 + curl 41 + grpc 42 + nlohmann_json 43 + prometheus-cpp 44 + protobuf 45 + ]; 46 + 47 + doCheck = true; 48 + 49 + checkInputs = [ 50 + gtest 51 + ]; 52 + 53 + strictDeps = true; 54 + 55 + cmakeFlags = [ 56 + "-DBUILD_SHARED_LIBS=ON" 57 + "-DWITH_OTLP_HTTP=ON" 58 + "-DWITH_OTLP_GRPC=ON" 59 + "-DWITH_ABSEIL=ON" 60 + "-DWITH_PROMETHEUS=ON" 61 + "-DWITH_ELASTICSEARCH=ON" 62 + "-DWITH_ZIPKIN=ON" 63 + "-DWITH_BENCHMARK=OFF" 64 + "-DOTELCPP_PROTO_PATH=${opentelemetry-proto}" 65 + ]; 66 + 67 + outputs = [ "out" "dev" ]; 68 + 69 + passthru.updateScript = nix-update-script { }; 70 + 71 + meta = { 72 + description = "The OpenTelemetry C++ Client Library"; 73 + homepage = "https://github.com/open-telemetry/opentelemetry-cpp"; 74 + license = [ lib.licenses.asl20 ]; 75 + maintainers = with lib.maintainers; [ jfroche ]; 76 + # https://github.com/protocolbuffers/protobuf/issues/14492 77 + broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); 78 + }; 79 + })