kent


Namekent JSON
Version 1.2.0 PyPI version JSON
download
home_page
SummaryFake Sentry service for debugging and integration tests
upload_time2024-01-31 14:28:07
maintainer
docs_urlNone
authorWill Kahn-Greene
requires_python>=3.8
licenseMPLv2
keywords sentry integration service test
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ====
Kent
====

Kent is a service for debugging and integration testing Sentry.

:Code:          https://github.com/willkg/kent/
:Issues:        https://github.com/willkg/kent/issues
:License:       MPL v2


Goals
=====

Goals of Kent:

1. make it possible to debug ``before_send`` and ``before_breadcrumb``
   sanitization code when using sentry-sdk
2. make it possible to debug other sentry error submission payload issues
3. make it possible to write integration tests against a fake sentry instance


Quick start
===========

Installing and running on your local machine
--------------------------------------------

1. Install Kent.

   You can install Kent from PyPI with pipx or pip or whatever::

      pipx install kent

   You can install a REVISH ("main", branch name, commit, whatever) from
   GitHub::

      pipx install https://github.com/willkg/kent/archive/refs/heads/<REVISH>.zip

   You can install from a checked out version of this repository::

      pipx install .

2. Run Kent::

      kent-server run [-h HOST] [-p PORT]
      

Running in a Docker container
-----------------------------

I'm using something like this::

    FROM python:3.11.5-slim-bookworm

    WORKDIR /app/

    ENV PYTHONUNBUFFERED=1 \
        PYTHONDONTWRITEBYTECODE=1

    RUN groupadd -r kent && useradd --no-log-init -r -g kent kent

    # NOTE(willkg): This installs Kent from main tip. If you're using Kent for
    # realzies, you probably don't want to do this because Kent could change and
    # break all your stuff. Pick a specific commit or tag.
    RUN pip install -U 'pip>=8' && \
        pip install --no-cache-dir 'kent==<VERSION>'

    USER kent

    ENTRYPOINT ["/usr/local/bin/kent-server"]
    CMD ["run"]


Make sure to replace ``<VERSION>`` with the version of Kent you want to use.
See https://pypi.org/project/kent for releases.

Then::

    $ docker build -t kent:latest .
    $ docker run --init --rm --publish 8000:8000 kent:latest run --host 0.0.0.0 --port 8000


Things to know about Kent
=========================

Kent is the fakest of fake Sentry servers. You can set up a Sentry DSN to point
to Kent and have your application send errors to it.

Kent is for testing sentry-sdk things. Kent is not for testing Relay.

Kent is a refined fake Sentry service and doesn't like fast food.

Kent will keep track of the last 100 payloads it received in memory. Nothing is
persisted to disk.

You can access the list of errors and error data with your web browser by going
to Kent's index page.

You can also access it with the API. This is most useful for integration tests
that want to assert things about errors.

``GET /api/errorlist/``
    List of all errors in memory with a unique error id.

``GET /api/error/ERRORID``
    Retrieve the payload for a specific error by id.

``POST /api/flush/``
    Flushes the error manager of all errors.

You can use multiple project ids. Kent will keep the errors separate.

If you run ``kent-server run`` with the defaults, your DSN is::

    http://public@localhost:5000/1    for project id 1
    http://public@localhost:5000/2    for project id 2
    ...


Kent definitely works with:

* Python sentry-sdk client
* Python raven client (deprecated)

I don't know about anything else. If you use Kent with another Sentry client,
add an issue with details or a pull request to update the README.


Development
===========

Install
-------

1. ``mkvirtualenv kent``
2. ``pip install -e '.[dev]'``

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "kent",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "sentry,integration service,test",
    "author": "Will Kahn-Greene",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/52/bc/ad6b41721c7d4a229b0cbe86f0fce31e5e9376b4b11928d99a9958d9eeb6/kent-1.2.0.tar.gz",
    "platform": null,
    "description": "====\nKent\n====\n\nKent is a service for debugging and integration testing Sentry.\n\n:Code:          https://github.com/willkg/kent/\n:Issues:        https://github.com/willkg/kent/issues\n:License:       MPL v2\n\n\nGoals\n=====\n\nGoals of Kent:\n\n1. make it possible to debug ``before_send`` and ``before_breadcrumb``\n   sanitization code when using sentry-sdk\n2. make it possible to debug other sentry error submission payload issues\n3. make it possible to write integration tests against a fake sentry instance\n\n\nQuick start\n===========\n\nInstalling and running on your local machine\n--------------------------------------------\n\n1. Install Kent.\n\n   You can install Kent from PyPI with pipx or pip or whatever::\n\n      pipx install kent\n\n   You can install a REVISH (\"main\", branch name, commit, whatever) from\n   GitHub::\n\n      pipx install https://github.com/willkg/kent/archive/refs/heads/<REVISH>.zip\n\n   You can install from a checked out version of this repository::\n\n      pipx install .\n\n2. Run Kent::\n\n      kent-server run [-h HOST] [-p PORT]\n      \n\nRunning in a Docker container\n-----------------------------\n\nI'm using something like this::\n\n    FROM python:3.11.5-slim-bookworm\n\n    WORKDIR /app/\n\n    ENV PYTHONUNBUFFERED=1 \\\n        PYTHONDONTWRITEBYTECODE=1\n\n    RUN groupadd -r kent && useradd --no-log-init -r -g kent kent\n\n    # NOTE(willkg): This installs Kent from main tip. If you're using Kent for\n    # realzies, you probably don't want to do this because Kent could change and\n    # break all your stuff. Pick a specific commit or tag.\n    RUN pip install -U 'pip>=8' && \\\n        pip install --no-cache-dir 'kent==<VERSION>'\n\n    USER kent\n\n    ENTRYPOINT [\"/usr/local/bin/kent-server\"]\n    CMD [\"run\"]\n\n\nMake sure to replace ``<VERSION>`` with the version of Kent you want to use.\nSee https://pypi.org/project/kent for releases.\n\nThen::\n\n    $ docker build -t kent:latest .\n    $ docker run --init --rm --publish 8000:8000 kent:latest run --host 0.0.0.0 --port 8000\n\n\nThings to know about Kent\n=========================\n\nKent is the fakest of fake Sentry servers. You can set up a Sentry DSN to point\nto Kent and have your application send errors to it.\n\nKent is for testing sentry-sdk things. Kent is not for testing Relay.\n\nKent is a refined fake Sentry service and doesn't like fast food.\n\nKent will keep track of the last 100 payloads it received in memory. Nothing is\npersisted to disk.\n\nYou can access the list of errors and error data with your web browser by going\nto Kent's index page.\n\nYou can also access it with the API. This is most useful for integration tests\nthat want to assert things about errors.\n\n``GET /api/errorlist/``\n    List of all errors in memory with a unique error id.\n\n``GET /api/error/ERRORID``\n    Retrieve the payload for a specific error by id.\n\n``POST /api/flush/``\n    Flushes the error manager of all errors.\n\nYou can use multiple project ids. Kent will keep the errors separate.\n\nIf you run ``kent-server run`` with the defaults, your DSN is::\n\n    http://public@localhost:5000/1    for project id 1\n    http://public@localhost:5000/2    for project id 2\n    ...\n\n\nKent definitely works with:\n\n* Python sentry-sdk client\n* Python raven client (deprecated)\n\nI don't know about anything else. If you use Kent with another Sentry client,\nadd an issue with details or a pull request to update the README.\n\n\nDevelopment\n===========\n\nInstall\n-------\n\n1. ``mkvirtualenv kent``\n2. ``pip install -e '.[dev]'``\n",
    "bugtrack_url": null,
    "license": "MPLv2",
    "summary": "Fake Sentry service for debugging and integration tests",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/willkg/kent/",
        "Issues": "https://github.com/willkg/kent/issues",
        "Source": "https://github.com/willkg/kent/"
    },
    "split_keywords": [
        "sentry",
        "integration service",
        "test"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c876210c73f5cef22742a7602c69bc6d9caa8bb32d13c6a8a0e8d91f008cf97e",
                "md5": "6e11b37b2826d9546db5207651802065",
                "sha256": "30e9a0e9a75e28761b138112a15c41ae30b1e3824a3366a1198b76f7d17eb2a3"
            },
            "downloads": -1,
            "filename": "kent-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6e11b37b2826d9546db5207651802065",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 27111,
            "upload_time": "2024-01-31T14:28:05",
            "upload_time_iso_8601": "2024-01-31T14:28:05.954186Z",
            "url": "https://files.pythonhosted.org/packages/c8/76/210c73f5cef22742a7602c69bc6d9caa8bb32d13c6a8a0e8d91f008cf97e/kent-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52bcad6b41721c7d4a229b0cbe86f0fce31e5e9376b4b11928d99a9958d9eeb6",
                "md5": "337d09582b1de21513f0ef49fe8514ac",
                "sha256": "36d28588372eb5aa384e785bd6072e54c5ad7ff1b8431de431e8b9ecd1c0c7a7"
            },
            "downloads": -1,
            "filename": "kent-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "337d09582b1de21513f0ef49fe8514ac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 30961,
            "upload_time": "2024-01-31T14:28:07",
            "upload_time_iso_8601": "2024-01-31T14:28:07.565866Z",
            "url": "https://files.pythonhosted.org/packages/52/bc/ad6b41721c7d4a229b0cbe86f0fce31e5e9376b4b11928d99a9958d9eeb6/kent-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 14:28:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "willkg",
    "github_project": "kent",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kent"
}
        
Elapsed time: 0.21696s