{% block body %}

Kent

A fake Sentry server for debugging and integration tests

Events

There are {{ events|count }} events in memory. [Flush]

{% if events %} {% for event in events %} {% endfor %}
timestamp project: event id summary
{{ event.timestamp }} {{ event.project_id }}: {{ event.event_id }} {{ event.summary }}
{% endif %}

API

Name End point and notes
Sentry DSN

GET {{ dsn }}

Returns no payload.

If you're running this in a Docker container and the service you want sending errors to Fake Sentry is in another Docker container, then you will need to use the appropriate host for the service.

Event list

GET {{ host }}/api/eventlist/

Returns JSON payload.

events
List of event structures containing the event id, project id, and summary.

Example:

curl http://localhost:5000/api/eventlist/
{"events":[{"event_id":"1b1211bb-a113-480c-a3c9-0c7e7aea5e27","project_id":1,"summary":"test error capture"}]}
Event

GET {{ host }}/api/event/<EVENT_ID>

Returns JSON payload.

project_id
Project id as an int
event_id
Event id as a string
payload
Event payload sent by the sentry-sdk

Contrived example:

curl http://localhost:5000/api/event/1f54272a-8cd6-45c9-8cf9-a06d844ec293
{"event_id":"1f54272a-8cd6-45c9-8cf9-a06d844ec293","payload":{"body":{"breadcrumbs":{"values":[]},"contexts":{"runtime":{"build":"3.10.14 (main, May  6 2024, 10:26:19) [GCC 13.2.0]","name":"CPython","version":"3.10.14"},"trace":{"parent_span_id":null,"span_id":"bb4b07d835a10c3e","trace_id":"99ec1fa063a141e0bb514fd9bbb57c54"}},"environment":"production","event_id":"753b3e32cd2c471c9480444e7fd12897","extra":{"sys.argv":["/home/willkg/venvs/kent/bin/kent-testpost","message"]},"level":"info","message":"test error capture","modules":{"blinker":"1.8.2","certifi":"2024.2.2","charset-normalizer":"3.3.2","click":"8.1.7","flask":"3.0.3","idna":"3.7","itsdangerous":"2.2.0","jinja2":"3.1.4","kent":"1.2.0","markupsafe":"2.1.5","pip":"24.0","requests":"2.31.0","sentry-sdk":"1.45.0","setuptools":"69.5.1","urllib3":"2.2.1","werkzeug":"3.0.3","wheel":"0.43.0"},"platform":"python","release":"96ed17acbc96f2af558a2989025b5acaa994c511","sdk":{"integrations":["argv","atexit","dedupe","excepthook","flask","logging","modules","stdlib","threading"],"name":"sentry.python.flask","packages":[{"name":"pypi:sentry-sdk","version":"1.45.0"}],"version":"1.45.0"},"server_name":"saturn7","timestamp":"2024-05-19T01:02:09.184703Z","transaction_info":{}},"envelope_header":null,"header":null},"project_id":1}

The payload data depends on which version of sentry-sdk you're using and how it submitted the data.

Flush events

POST {{ host }}/api/flush/

Returns JSON payload.

HTTP 200

success
true if successful

Example:

curl -X POST http://localhost:5000/api/flush/
{"success": true}
{% endblock %}