diff --git a/pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix b/pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix new file mode 100644 index 000000000000..abeed7f05882 --- /dev/null +++ b/pkgs/development/python-modules/opentelemetry-instrumentation-grpc/default.nix @@ -0,0 +1,61 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, hatchling +, opentelemetry-api +, opentelemetry-instrumentation +, opentelemetry-sdk +, opentelemetry-semantic-conventions +, opentelemetry-test-utils +, wrapt +, pytestCheckHook +, grpcio +}: + +buildPythonPackage rec { + pname = "opentelemetry-instrumentation-grpc"; + version = "0.39b0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "open-telemetry"; + repo = "opentelemetry-python-contrib"; + rev = "refs/tags/v${version}"; + hash = "sha256-DkDAE0MsF9HdywxlFzqJaqNor4O/jpnSqINsKTuiVqU="; + sparseCheckout = [ "/instrumentation/${pname}" ]; + } + "/instrumentation/${pname}"; + + format = "pyproject"; + + nativeBuildInputs = [ + hatchling + ]; + + propagatedBuildInputs = [ + opentelemetry-api + opentelemetry-instrumentation + opentelemetry-sdk + opentelemetry-semantic-conventions + wrapt + ]; + + passthru.optional-dependencies = { + instruments = [ grpcio ]; + }; + + nativeCheckInputs = [ + opentelemetry-test-utils + grpcio + pytestCheckHook + ]; + + pythonImportsCheck = [ "opentelemetry.instrumentation.grpc" ]; + + meta = with lib; { + homepage = "https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-grpc"; + description = "OpenTelemetry Instrumentation for grpc"; + license = licenses.asl20; + maintainers = with maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0465cbe4187e..9474b88f2e57 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7410,6 +7410,8 @@ self: super: with self; { opentelemetry-instrumentation-django = callPackage ../development/python-modules/opentelemetry-instrumentation-django { }; + opentelemetry-instrumentation-grpc = callPackage ../development/python-modules/opentelemetry-instrumentation-grpc { }; + opentelemetry-instrumentation-wsgi = callPackage ../development/python-modules/opentelemetry-instrumentation-wsgi { }; opentelemetry-proto = callPackage ../development/python-modules/opentelemetry-proto { };