From 2fc4aefa3173026445b17ab7f98fc5ed2ae03ea1 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 10 Jul 2025 15:17:46 +0200 Subject: [PATCH 1/4] docs: Remove reference to asyncio only enabled with 3.7+ --- docs/reference/aiohttp-server-support.md | 4 ---- docs/reference/api-reference.md | 4 ---- docs/reference/asgi-middleware.md | 4 ---- docs/reference/instrumenting-custom-code.md | 4 ---- docs/reference/sanic-support.md | 4 ---- docs/reference/starlette-support.md | 4 ---- docs/reference/tornado-support.md | 4 ---- 7 files changed, 28 deletions(-) diff --git a/docs/reference/aiohttp-server-support.md b/docs/reference/aiohttp-server-support.md index fcde2cdab..671cc6191 100644 --- a/docs/reference/aiohttp-server-support.md +++ b/docs/reference/aiohttp-server-support.md @@ -105,8 +105,4 @@ This would ignore any requests using the `OPTIONS` method and any requests conta A list of supported [aiohttp](/reference/supported-technologies.md#supported-aiohttp) and [Python](/reference/supported-technologies.md#supported-python) versions can be found on our [Supported Technologies](/reference/supported-technologies.md) page. -::::{note} -Elastic APM only supports `asyncio` when using Python 3.7+ -:::: - diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md index 63ddbb58f..8d742a2c3 100644 --- a/docs/reference/api-reference.md +++ b/docs/reference/api-reference.md @@ -427,10 +427,6 @@ async def coffee_maker(strength): * `span_action`: (**optional**) action of the span, e.g. `query`. Defaults to `None`. * `links`: (**optional**) A list of `TraceParent` objects to which this span is causally linked. -::::{note} -`asyncio` is only supported for Python 3.7+. -:::: - ### `elasticapm.label()` [api-label] diff --git a/docs/reference/asgi-middleware.md b/docs/reference/asgi-middleware.md index 852f12565..ba004d57a 100644 --- a/docs/reference/asgi-middleware.md +++ b/docs/reference/asgi-middleware.md @@ -59,8 +59,4 @@ Currently, the agent doesn’t support automatic capturing of exceptions. You ca A list of supported [Python](/reference/supported-technologies.md#supported-python) versions can be found on our [Supported Technologies](/reference/supported-technologies.md) page. -::::{note} -Elastic APM only supports `asyncio` when using Python 3.7+ -:::: - diff --git a/docs/reference/instrumenting-custom-code.md b/docs/reference/instrumenting-custom-code.md index ad6afc8fb..9e1d5f18d 100644 --- a/docs/reference/instrumenting-custom-code.md +++ b/docs/reference/instrumenting-custom-code.md @@ -50,10 +50,6 @@ async def coffee_maker(strength): fresh_pots() ``` -::::{note} -`asyncio` support is only available in Python 3.7+. -:::: - See [the API docs](/reference/api-reference.md#api-capture-span) for more information on `capture_span`. diff --git a/docs/reference/sanic-support.md b/docs/reference/sanic-support.md index 515bf6837..b734b1b27 100644 --- a/docs/reference/sanic-support.md +++ b/docs/reference/sanic-support.md @@ -133,8 +133,4 @@ In order to enable this behavior, the APM Client middleware provides a few callb A list of supported [Sanic](/reference/supported-technologies.md#supported-sanic) and [Python](/reference/supported-technologies.md#supported-python) versions can be found on our [Supported Technologies](/reference/supported-technologies.md) page. -::::{note} -Elastic APM only supports `asyncio` when using Python 3.7+ -:::: - diff --git a/docs/reference/starlette-support.md b/docs/reference/starlette-support.md index 673ab79db..22901d911 100644 --- a/docs/reference/starlette-support.md +++ b/docs/reference/starlette-support.md @@ -120,8 +120,4 @@ This would ignore any requests using the `GET /secret` route and any requests co A list of supported [Starlette](/reference/supported-technologies.md#supported-starlette) and [Python](/reference/supported-technologies.md#supported-python) versions can be found on our [Supported Technologies](/reference/supported-technologies.md) page. -::::{note} -Elastic APM only supports `asyncio` when using Python 3.7+ -:::: - diff --git a/docs/reference/tornado-support.md b/docs/reference/tornado-support.md index bae66762b..2c93cdec0 100644 --- a/docs/reference/tornado-support.md +++ b/docs/reference/tornado-support.md @@ -101,8 +101,4 @@ This would ignore any requests using the `GET SecretHandler` route and any reque A list of supported [tornado](/reference/supported-technologies.md#supported-tornado) and [Python](/reference/supported-technologies.md#supported-python) versions can be found on our [Supported Technologies](/reference/supported-technologies.md) page. -::::{note} -Elastic APM only supports `asyncio` when using Python 3.7+ -:::: - From f455a93a76c5cd95d749190cd98b72cca5b4f1d9 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 10 Jul 2025 15:19:37 +0200 Subject: [PATCH 2/4] docs: remove Django LoggingHandler from reference --- docs/reference/django-support.md | 95 -------------------------------- 1 file changed, 95 deletions(-) diff --git a/docs/reference/django-support.md b/docs/reference/django-support.md index 37b1fe3bd..9d21d133a 100644 --- a/docs/reference/django-support.md +++ b/docs/reference/django-support.md @@ -166,101 +166,6 @@ ELASTIC_APM = { ``` -## Integrating with Python logging [django-logging] - -To easily send Python `logging` messages as "error" objects to Elasticsearch, we provide a `LoggingHandler` which you can use in your logging setup. The log messages will be enriched with a stack trace, data from the request, and more. - -::::{note} -the intended use case for this handler is to send high priority log messages (e.g. log messages with level `ERROR`) to Elasticsearch. For normal log shipping, we recommend using [filebeat](beats://reference/filebeat/index.md). -:::: - - -If you are new to how the `logging` module works together with Django, read more [in the Django documentation](https://docs.djangoproject.com/en/2.1/topics/logging/). - -An example of how your `LOGGING` setting could look: - -```python -LOGGING = { - 'version': 1, - 'disable_existing_loggers': True, - 'formatters': { - 'verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' - }, - }, - 'handlers': { - 'elasticapm': { - 'level': 'WARNING', - 'class': 'elasticapm.contrib.django.handlers.LoggingHandler', - }, - 'console': { - 'level': 'DEBUG', - 'class': 'logging.StreamHandler', - 'formatter': 'verbose' - } - }, - 'loggers': { - 'django.db.backends': { - 'level': 'ERROR', - 'handlers': ['console'], - 'propagate': False, - }, - 'mysite': { - 'level': 'WARNING', - 'handlers': ['elasticapm'], - 'propagate': False, - }, - # Log errors from the Elastic APM module to the console (recommended) - 'elasticapm.errors': { - 'level': 'ERROR', - 'handlers': ['console'], - 'propagate': False, - }, - }, -} -``` - -With this configuration, logging can be done like this in any module in the `myapp` django app: - -You can now use the logger in any module in the `myapp` Django app, for instance `myapp/views.py`: - -```python -import logging -logger = logging.getLogger('mysite') - -try: - instance = MyModel.objects.get(pk=42) -except MyModel.DoesNotExist: - logger.error( - 'Could not find instance, doing something else', - exc_info=True - ) -``` - -Note that `exc_info=True` adds the exception information to the data that gets sent to Elastic APM. Without it, only the message is sent. - - -### Extra data [django-extra-data] - -If you want to send more data than what you get with the agent by default, logging can be done like so: - -```python -import logging -logger = logging.getLogger('mysite') - -try: - instance = MyModel.objects.get(pk=42) -except MyModel.DoesNotExist: - logger.error( - 'There was some crazy error', - exc_info=True, - extra={ - 'datetime': str(datetime.now()), - } - ) -``` - - ## Celery integration [django-celery-integration] For a general guide on how to set up Django with Celery, head over to Celery’s [Django documentation](http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html#django-first-steps). From ab812378abd7a1def2acc3df2b85426d59ac7732 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 10 Jul 2025 15:20:36 +0200 Subject: [PATCH 3/4] docs/supported-technologies: drop support for Python 3.6 and 3.7 --- docs/reference/supported-technologies.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/reference/supported-technologies.md b/docs/reference/supported-technologies.md index ad768b2cb..30eaa5a9f 100644 --- a/docs/reference/supported-technologies.md +++ b/docs/reference/supported-technologies.md @@ -23,8 +23,6 @@ For other frameworks and custom Python code, the agent exposes a set of [APIs](/ The following Python versions are supported: -* 3.6 -* 3.7 * 3.8 * 3.9 * 3.10 From dba2cad0a6d3194816de9a34c355669d8fbee3f5 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 10 Jul 2025 15:38:17 +0200 Subject: [PATCH 4/4] Add notes to CONTRIBUTING for updating docs/release-notes --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 687ac5efb..348735fd8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -183,6 +183,7 @@ If you have commit access, the process is as follows: 1. Update the version in `elasticapm/version.py` according to the scale of the change. (major, minor or patch) 1. Update `CHANGELOG.asciidoc`. Rename the `Unreleased` section to the correct version (`vX.X.X`), and nest under the appropriate sub-heading, e.g., `Python Agent version 5.x`. +1. Update `docs/release-notes/`. 1. For Majors: [Create an issue](https://github.com/elastic/website-requests/issues/new) to request an update of the [EOL table](https://www.elastic.co/support/eol). 1. For Majors: Add the new major version to `conf.yaml` in the [elastic/docs](https://github.com/elastic/docs) repo. 1. Commit changes with message `update CHANGELOG and bump version to X.Y.Z`