diff --git a/pkgs/development/python-modules/opentelemetry-instrumentation-aiohttp-client/default.nix b/pkgs/development/python-modules/opentelemetry-instrumentation-aiohttp-client/default.nix new file mode 100644 index 000000000000..379b5a608ae3 --- /dev/null +++ b/pkgs/development/python-modules/opentelemetry-instrumentation-aiohttp-client/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, hatchling +, opentelemetry-api +, opentelemetry-instrumentation +, opentelemetry-semantic-conventions +, opentelemetry-test-utils +, opentelemetry-util-http +, wrapt +, pytestCheckHook +, aiohttp +}: +let + pname = "opentelemetry-instrumentation-aiohttp-client"; + version = "0.39b0"; +in +buildPythonPackage { + inherit pname version; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "open-telemetry"; + repo = "opentelemetry-python-contrib"; + rev = "refs/tags/v${version}"; + hash = "sha256-HFDebR3d1osFAIlNuIbs5s+uPeTTJ1xkz+BpE5BpciU="; + sparseCheckout = [ "/instrumentation/${pname}" ]; + } + "/instrumentation/${pname}"; + + format = "pyproject"; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + opentelemetry-api + opentelemetry-instrumentation + opentelemetry-semantic-conventions + opentelemetry-util-http + wrapt + aiohttp + ]; + + # missing https://github.com/ezequielramos/http-server-mock + # which looks unmaintained + doCheck = false; + + nativeCheckInputs = [ + opentelemetry-test-utils + pytestCheckHook + ]; + + pythonImportsCheck = [ "opentelemetry.instrumentation.aiohttp_client" ]; + + meta = with lib; { + homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-aiohttp-client"; + description = "OpenTelemetry Instrumentation for aiohttp-client"; + license = licenses.asl20; + maintainers = with maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9474b88f2e57..f0664597d2ac 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7406,6 +7406,8 @@ self: super: with self; { opentelemetry-instrumentation = callPackage ../development/python-modules/opentelemetry-instrumentation { }; + opentelemetry-instrumentation-aiohttp-client = callPackage ../development/python-modules/opentelemetry-instrumentation-aiohttp-client { }; + opentelemetry-instrumentation-asgi = callPackage ../development/python-modules/opentelemetry-instrumentation-asgi { }; opentelemetry-instrumentation-django = callPackage ../development/python-modules/opentelemetry-instrumentation-django { };