Skip to content

Cleanup docs for 7.0 #2350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment on lines 187 to 188
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colleenmcginnis could you please check these are still relevant?

1. Commit changes with message `update CHANGELOG and bump version to X.Y.Z`
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/aiohttp-server-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+
::::


4 changes: 0 additions & 4 deletions docs/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/asgi-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+
::::


95 changes: 0 additions & 95 deletions docs/reference/django-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/instrumenting-custom-code.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check notice on line 1 in docs/reference/instrumenting-custom-code.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/instrumenting-custom-code.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/instrumenting-custom-code.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/instrumenting-custom-code.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/instrumenting-custom-code.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/reference/instrumenting-custom-code.md

View workflow job for this annotation

GitHub Actions / docs-preview / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.
mapped_pages:
- https://www.elastic.co/guide/en/apm/agent/python/current/instrumenting-custom-code.html
---
Expand Down Expand Up @@ -50,10 +50,6 @@
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`.

Expand Down
4 changes: 0 additions & 4 deletions docs/reference/sanic-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+
::::


4 changes: 0 additions & 4 deletions docs/reference/starlette-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+
::::


2 changes: 0 additions & 2 deletions docs/reference/supported-technologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions docs/reference/tornado-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+
::::