Skip to content

Commit bb87169

Browse files
authored
[docs] Documentation restructure (#617)
1 parent c9bb751 commit bb87169

15 files changed

Lines changed: 199 additions & 100 deletions

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a placeholder file. Release notes are published in CHANGELOG.md

docs/advanced-topics.asciidoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
* <<instrumenting-custom-code>>
55
* <<sanitizing-data>>
66
* <<run-tests-locally>>
7-
* <<logging-integrations>>
8-
* <<log-correlation>>
97

108
include::./custom-instrumentation.asciidoc[Custom Instrumentation]
119
include::./sanitizing-data.asciidoc[Sanitizing Data]
10+
include::./how-the-agent-works.asciidoc[How the Agent works]
1211
include::./run-tests-locally.asciidoc[Run Tests Locally]
13-
include::./logging.asciidoc[Logging Integrations]
12+

docs/api.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[api]]
2-
== Public API
2+
== API reference
33

44
The Elastic APM Python agent has several public APIs.
55
Most of the public API functionality is not needed when using one of our <<framework-support, supported frameworks>>,

docs/configuration.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ Note however that this can have adverse effects on performance.
135135
The name of the environment this service is deployed in,
136136
e.g. "production" or "staging".
137137

138-
Environments allow you to easily filter data on a global level in the APM UI.
138+
Environments allow you to easily filter data on a global level in the APM app.
139139
It's important to be consistent when naming environments across agents.
140-
See {kibana-ref}/filters.html#environment-selector[environment selector] in the Kibana UI for more information.
140+
See {apm-app-ref}/filters.html#environment-selector[environment selector] in the APM app for more information.
141141

142-
NOTE: This feature is fully supported in the APM UI in Kibana versions >= 7.2.
142+
NOTE: This feature is fully supported in the APM app in Kibana versions >= 7.2.
143143
You must use the query bar to filter for a specific environment in versions prior to 7.2.
144144

145145
[float]
@@ -678,7 +678,7 @@ NOTE: This feature requires APM Server and Kibana >= 7.3.
678678

679679
When enabled, the agent will make periodic requests to the APM Server to fetch updated configuration.
680680

681-
See {kibana-ref}/agent-configuration.html#agent-configuration[APM Agent Configuration] for more documentation on central agent configuration.
681+
See {apm-app-ref}/agent-configuration.html#agent-configuration[APM Agent Configuration] for more documentation on central agent configuration.
682682

683683
NOTE: This feature requires APM Server and Kibana >= 7.3.
684684

docs/django.asciidoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[[django-support]]
2-
== Django Support
2+
=== Django support
33

44
Getting Elastic APM set up for your Django project is easy, and there are various ways you can tweak it to fit to your needs.
55

66
[float]
77
[[django-installation]]
8-
=== Installation
8+
==== Installation
99

1010
Install the Elastic APM agent using pip:
1111

@@ -25,7 +25,7 @@ threads].
2525

2626
[float]
2727
[[django-setup]]
28-
=== Setup
28+
==== Setup
2929

3030
Set up the Elastic APM agent in Django with these two steps:
3131

@@ -77,7 +77,7 @@ ELASTIC_APM = {
7777

7878
[float]
7979
[[django-performance-metrics]]
80-
=== Performance Metrics
80+
==== Performance metrics
8181

8282
In order to collect performance metrics,
8383
the agent automatically inserts a middleware at the top of your middleware list
@@ -95,14 +95,14 @@ You can find more information on what we instrument in the <<automatic-instrumen
9595

9696
[float]
9797
[[django-instrumenting-custom-python-code]]
98-
==== Instrumenting custom Python code
98+
===== Instrumenting custom Python code
9999

100100
To gain further insights into the performance of your code, please see
101101
<<instrumenting-custom-code, instrumenting custom code>>.
102102

103103
[float]
104104
[[django-ignoring-specific-views]]
105-
==== Ignoring specific views
105+
===== Ignoring specific views
106106

107107
You can use the `TRANSACTIONS_IGNORE_PATTERNS` configuration option to ignore specific views.
108108
The list given should be a list of regular expressions which are matched against the transaction name as seen in the Elastic APM user interface:
@@ -116,7 +116,7 @@ This example ignores any requests using the `OPTIONS` method and any requests co
116116

117117
[float]
118118
[[django-transaction-name-route]]
119-
==== Using the route as transaction name
119+
===== Using the route as transaction name
120120

121121
By default, we use the function or class name of the view as the transaction name.
122122
Starting with Django 2.2, Django makes the route (e.g. `users/<int:user_id>/`) available on the `request.resolver_match` object.
@@ -131,7 +131,7 @@ NOTE: in versions previous to Django 2.2, changing this setting will have no eff
131131

132132
[float]
133133
[[django-integrating-with-the-rum-agent]]
134-
==== Integrating with the RUM agent
134+
===== Integrating with the RUM Agent
135135

136136
To correlate performance measurement in the browser with measurements in your Django app,
137137
you can help the RUM (Real User Monitoring) agent by configuring it with the Trace ID and Span ID of the backend request.
@@ -173,7 +173,7 @@ See the {apm-rum-ref}[JavaScript RUM agent documentation] for more information.
173173

174174
[float]
175175
[[django-enabling-and-disabling-the-agent]]
176-
=== Enabling and disabling the agent
176+
==== Enabling and disabling the agent
177177

178178
The easiest way to disable the agent is to set Django’s `DEBUG` option to `True` in your development configuration.
179179
No errors or metrics will be logged to Elastic APM.
@@ -191,7 +191,7 @@ ELASTIC_APM = {
191191

192192
[float]
193193
[[django-logging]]
194-
=== Integrating with Python logging
194+
==== Integrating with Python logging
195195

196196
To easily send Python `logging` messages as "error" objects to Elasticsearch,
197197
we provide a `LoggingHandler` which you can use in your logging setup.
@@ -270,7 +270,7 @@ Without it, only the message is sent.
270270

271271
[float]
272272
[[django-extra-data]]
273-
==== Extra data
273+
===== Extra data
274274

275275
If you want to send more data than what you get with the agent by default, logging can be done like so:
276276

@@ -293,7 +293,7 @@ except MyModel.DoesNotExist:
293293

294294
[float]
295295
[[django-celery-integration]]
296-
=== Celery Integration
296+
==== Celery integration
297297

298298
For a general guide on how to set up Django with Celery, head over to
299299
Celery's http://celery.readthedocs.org/en/latest/django/first-steps-with-django.html#django-first-steps[Django
@@ -303,7 +303,7 @@ Elastic APM will automatically log errors from your celery tasks, and record per
303303

304304
[float]
305305
[[django-logging-http-404-not-found-errors]]
306-
=== Logging "HTTP 404 Not Found" Errors
306+
==== Logging "HTTP 404 Not Found" errors
307307

308308
By default, Elastic APM does not log HTTP 404 errors. If you wish to log
309309
these errors, add
@@ -325,7 +325,7 @@ setting.
325325

326326
[float]
327327
[[django-disable-agent-during-tests]]
328-
=== Disable the agent during tests
328+
==== Disable the agent during tests
329329

330330
To prevent the agent from sending any data to the APM Server during tests, set the `ELASTIC_APM_DISABLE_SEND` environment variable to `true`, e.g.:
331331

@@ -336,7 +336,7 @@ ELASTIC_APM_DISABLE_SEND=true python manage.py test
336336

337337
[float]
338338
[[django-troubleshooting]]
339-
=== Troubleshooting
339+
==== Troubleshooting
340340

341341
Elastic APM comes with a Django command that helps troubleshooting your setup. To check your configuration, run
342342

@@ -369,6 +369,6 @@ Success! We tracked the error successfully! You should be able to see it in a fe
369369

370370
[float]
371371
[[supported-django-and-python-versions]]
372-
=== Supported Django and Python versions
372+
==== Supported Django and Python versions
373373

374374
A list of supported <<supported-django,Django>> and <<supported-python,Python>> versions can be found on our <<supported-technologies,Supported Technologies>> page.

docs/flask.asciidoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[[flask-support]]
2-
== Flask support
2+
=== Flask support
33

44
Getting Elastic APM set up for your Flask project is easy,
55
and there are various ways you can tweak it to fit to your needs.
66

77
[float]
88
[[flask-installation]]
9-
=== Installation
9+
==== Installation
1010

1111
Install the Elastic APM agent using pip:
1212

@@ -25,7 +25,7 @@ threads].
2525

2626
[float]
2727
[[flask-setup]]
28-
=== Setup
28+
==== Setup
2929

3030
To set up the agent, you need to initialize it with appropriate settings.
3131

@@ -69,7 +69,7 @@ apm = ElasticAPM(app, service_name='<APP-ID>', secret_token='<SECRET-TOKEN>')
6969

7070
[float]
7171
[[flask-debug-mode]]
72-
==== Debug Mode
72+
===== Debug mode
7373

7474
Please note that errors and transactions will only be sent to the APM Server if your app is *not* in
7575
http://flask.pocoo.org/docs/0.12/quickstart/#debug-mode[debug mode].
@@ -88,7 +88,7 @@ app.config['ELASTIC_APM'] = {
8888

8989
[float]
9090
[[flask-building-applications-on-the-fly]]
91-
==== Building applications on the fly?
91+
===== Building applications on the fly?
9292

9393
You can use the agent's `init_app` hook for adding the application on the fly:
9494

@@ -105,7 +105,7 @@ def create_app():
105105

106106
[float]
107107
[[flask-usage]]
108-
=== Usage
108+
==== Usage
109109

110110
Once you have configured the agent,
111111
it will automatically track transactions and capture uncaught exceptions within Flask.
@@ -132,7 +132,7 @@ apm.capture_message('hello, world!')
132132

133133
[float]
134134
[[flask-logging]]
135-
=== Logging
135+
==== Logging
136136

137137
Passing `logging=LEVEL` to the ElasticAPM constructor will make the agent automatically log all log messages from Python's built-in `logging` module,
138138
with the given level or higher.
@@ -198,7 +198,7 @@ Without it, only the message is sent.
198198

199199
[float]
200200
[[flask-extra-data]]
201-
==== Extra data
201+
===== Extra data
202202

203203
In addition to what the agents log by default, you can send extra information:
204204

@@ -220,20 +220,20 @@ def bar():
220220

221221
[float]
222222
[[flask-celery-tasks]]
223-
==== Celery tasks
223+
===== Celery tasks
224224

225225
The Elastic APM agent will automatically send errors and performance data from your Celery tasks to the APM Server.
226226

227227
[float]
228228
[[flask-performance-metrics]]
229-
=== Performance Metrics
229+
==== Performance metrics
230230

231231
If you've followed the instructions above, the agent has already hooked
232232
into the right signals and should be reporting performance metrics.
233233

234234
[float]
235235
[[flask-ignoring-specific-views]]
236-
==== Ignoring specific routes
236+
===== Ignoring specific routes
237237

238238
You can use the `TRANSACTIONS_IGNORE_PATTERNS` configuration option to ignore specific routes.
239239
The list given should be a list of regular expressions which are matched against the transaction name:
@@ -253,7 +253,7 @@ and any requests containing `/api/`.
253253

254254
[float]
255255
[[flask-integrating-with-the-rum-agent]]
256-
==== Integrating with the RUM agent
256+
===== Integrating with the RUM Agent
257257

258258
To correlate performance measurement in the browser with measurements in your Flask app,
259259
you can help the RUM (Real User Monitoring) agent by configuring it with the Trace ID and Span ID of the backend request.
@@ -277,6 +277,6 @@ See the {apm-rum-ref}[JavaScript RUM agent documentation] for more information.
277277

278278
[float]
279279
[[supported-flask-and-python-versions]]
280-
=== Supported Flask and Python versions
280+
==== Supported Flask and Python versions
281281

282282
A list of supported <<supported-flask,Flask>> and <<supported-python,Python>> versions can be found on our <<supported-technologies,Supported Technologies>> page.

docs/getting-started.asciidoc

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
[[getting-started]]
2+
== Introduction
23

3-
ifdef::env-github[]
4-
NOTE: For the best reading experience,
5-
please view this documentation at https://www.elastic.co/guide/en/apm/agent/python/current/getting-started.html[elastic.co]
6-
endif::[]
4+
The Elastic APM Python agent sends performance metrics and error logs to the APM Server.
5+
It has built-in support for Django and Flask performance metrics and error logging, as well as generic support of other WSGI frameworks for error logging.
6+
7+
[float]
8+
[[how-it-works]]
9+
=== How does the Agent work?
710

8-
== Getting started
11+
The Python Agent instruments your application to collect APM events in a few different ways:
912

10-
Welcome to the APM Python agent docs.
13+
To collect data about incoming requests and background tasks, the Agent integrates with <<supported-technologies,supported technologies>> to make use of hooks and signals provided by the framework.
14+
These framework integrations require limited code changes in your application.
1115

12-
The Elastic APM Python agent sends performance metrics and error logs to the APM Server.
13-
It has built-in support for Django and Flask performance metrics and error logging, as well as generic support of other WSGI frameworks for error logging.
16+
To collect data from database drivers, HTTP libraries etc.,
17+
we instrument certain functions and methods in these libraries.
18+
Instrumentations are set up automatically and do not require any code changes.
19+
20+
In addition to APM and error data,
21+
the Python agent also collects system and application metrics in regular intervals.
22+
This collection happens in a background thread that is started by the agent.
23+
24+
More detailed information on how the Agent works can be found in the <<how-the-agent-works,advanced topics>>.
1425

1526
[float]
1627
[[additional-components]]
17-
=== Additional Components
28+
=== Additional components
1829

1930
APM Agents work in conjunction with the {apm-server-ref-v}/index.html[APM Server], {ref}/index.html[Elasticsearch], and {kibana-ref}/index.html[Kibana].
2031
Please view the {apm-overview-ref-v}/index.html[APM Overview] for details on how these components work together.
21-
22-
[[framework-support]]
23-
The Elastic APM Python Agent comes with support for the following frameworks:
24-
25-
* <<django-support,Django>> 1.8 - 2.1
26-
* <<flask-support,Flask>> 0.10+
27-
28-
For other frameworks and custom Python code, the agent exposes a set of <<api,APIs>> for integration.
29-
30-
NOTE: The Elastic APM Python agent does currently not support asynchronous frameworks like Twisted or Tornado.

0 commit comments

Comments
 (0)