Skip to content

Commit c09355c

Browse files
bmorelli25beniwohli
authored andcommitted
docs: add API added in (elastic#984)
1 parent 038a66a commit c09355c

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/api.asciidoc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ as well as to mark the beginning and end of transactions.
1717
[[client-api-init]]
1818
==== Instantiation
1919

20+
[small]#Added in v1.0.0.#
21+
2022
To create a `Client` instance, import it and call its constructor:
2123

2224
[source,python]
@@ -40,6 +42,8 @@ instantiate the client automatically.
4042
[[client-api-capture-exception]]
4143
===== `Client.capture_exception()`
4244

45+
[small]#Added in v1.0.0. `handled` added in v2.0.0.#
46+
4347
Captures an exception object:
4448

4549
[source,python]
@@ -63,6 +67,8 @@ Returns the id of the error as a string.
6367
[[client-api-capture-message]]
6468
===== `Client.capture_message()`
6569

70+
[small]#Added in v1.0.0.#
71+
6672
Captures a message with optional added contextual data. Example:
6773

6874
[source,python]
@@ -105,6 +111,9 @@ NOTE: Either the `message` or the `param_message` argument is required.
105111
[float]
106112
[[client-api-begin-transaction]]
107113
===== `Client.begin_transaction()`
114+
115+
[small]#Added in v1.0.0. `trace_parent` support added in v5.6.0.#
116+
108117
Begin tracking a transaction.
109118
Should be called e.g. at the beginning of a request or when starting a background task. Example:
110119

@@ -119,6 +128,9 @@ client.begin_transaction('processors')
119128
[float]
120129
[[client-api-end-transaction]]
121130
===== `Client.end_transaction()`
131+
132+
[small]#Added in v1.0.0.#
133+
122134
End tracking the transaction.
123135
Should be called e.g. at the end of a request or when ending a background task. Example:
124136

@@ -147,6 +159,8 @@ distributed tracing.
147159
[[api-traceparent-from-string]]
148160
===== `elasticapm.trace_parent_from_string()`
149161

162+
[small]#Added in v5.6.0.#
163+
150164
Create a TraceParent object from the string representation generated by
151165
`TraceParent.to_string()`:
152166

@@ -163,6 +177,8 @@ client.begin_transaction('processors', trace_parent=parent)
163177
[[api-traceparent-from-headers]]
164178
===== `elasticapm.trace_parent_from_headers()`
165179

180+
[small]#Added in v5.6.0.#
181+
166182
Create a TraceParent object from HTTP headers (usually generated by another
167183
Elastic APM agent):
168184

@@ -178,6 +194,8 @@ client.begin_transaction('processors', trace_parent=parent)
178194
[[api-traceparent-get-header]]
179195
===== `elasticapm.get_trace_parent_header()`
180196

197+
[small]#Added in v5.10.0.#
198+
181199
Return the string representation of the current transaction TraceParent object:
182200

183201
[source,python]
@@ -193,6 +211,8 @@ elasticapm.get_trace_parent_header()
193211
[[api-elasticapm-instrument]]
194212
==== `elasticapm.instrument()`
195213

214+
[small]#Added in v1.0.0.#
215+
196216
Instruments libraries automatically.
197217
This includes a wide range of standard library and 3rd party modules.
198218
A list of instrumented modules can be found in `elasticapm.instrumentation.register`.
@@ -210,6 +230,8 @@ elasticapm.instrument()
210230
[[api-set-transaction-name]]
211231
==== `elasticapm.set_transaction_name()`
212232

233+
[small]#Added in v1.0.0.#
234+
213235
Set the name of the current transaction.
214236
For supported frameworks, the transaction name is determined automatically,
215237
and can be overridden using this function. Example:
@@ -229,6 +251,8 @@ elasticapm.set_transaction_name('myapp.billing_process')
229251
[[api-set-transaction-result]]
230252
==== `elasticapm.set_transaction_result()`
231253

254+
[small]#Added in v2.2.0.#
255+
232256
Set the result of the current transaction.
233257
For supported frameworks, the transaction result is determined automatically,
234258
and can be overridden using this function. Example:
@@ -248,6 +272,8 @@ elasticapm.set_transaction_result('SUCCESS')
248272
[[api-set-transaction-outcome]]
249273
==== `elasticapm.set_transaction_outcome()`
250274

275+
[small]#Added in v5.9.0.#
276+
251277
Sets the outcome of the transaction. The value can either be `"success"`, `"failure"` or `"unknown"`.
252278
This should only be called at the end of a transaction after the outcome is determined.
253279

@@ -298,6 +324,8 @@ elasticapm.set_transaction_outcome(OUTCOME.UNKNOWN)
298324
[[api-get-transaction-id]]
299325
==== `elasticapm.get_transaction_id()`
300326

327+
[small]#Added in v5.2.0.#
328+
301329
Get the id of the current transaction. Example:
302330

303331
[source,python]
@@ -312,6 +340,8 @@ transaction_id = elasticapm.get_transaction_id()
312340
[[api-get-trace-id]]
313341
==== `elasticapm.get_trace_id()`
314342

343+
[small]#Added in v5.2.0.#
344+
315345
Get the `trace_id` of the current transaction's trace. Example:
316346

317347
[source,python]
@@ -326,6 +356,8 @@ trace_id = elasticapm.get_trace_id()
326356
[[api-get-span-id]]
327357
==== `elasticapm.get_span_id()`
328358

359+
[small]#Added in v5.2.0.#
360+
329361
Get the id of the current span. Example:
330362

331363
[source,python]
@@ -340,6 +372,8 @@ span_id = elasticapm.get_span_id()
340372
[[api-set-custom-context]]
341373
==== `elasticapm.set_custom_context()`
342374

375+
[small]#Added in v2.0.0.#
376+
343377
Attach custom contextual data to the current transaction and errors.
344378
Supported frameworks will automatically attach information about the HTTP request and the logged in user.
345379
You can attach further data using this function.
@@ -369,6 +403,8 @@ following the `update()` semantics of Python dictionaries.
369403
[[api-set-user-context]]
370404
==== `elasticapm.set_user_context()`
371405

406+
[small]#Added in v2.0.0.#
407+
372408
Attach information about the currently logged in user to the current transaction and errors.
373409
Example:
374410

@@ -392,6 +428,8 @@ following the `update()` semantics of Python dictionaries.
392428
[[api-capture-span]]
393429
==== `elasticapm.capture_span`
394430

431+
[small]#Added in v4.1.0.#
432+
395433
Capture a custom span.
396434
This can be used either as a function decorator or as a context manager (in a `with` statement).
397435
When used as a decorator, the name of the span will be set to the name of the function.
@@ -427,6 +465,8 @@ def coffee_maker(strength):
427465
[[api-async-capture-span]]
428466
==== `elasticapm.async_capture_span`
429467

468+
[small]#Added in v5.4.0.#
469+
430470
Capture a custom async-aware span.
431471
This can be used either as a function decorator or as a context manager (in an `async with` statement).
432472
When used as a decorator, the name of the span will be set to the name of the function.
@@ -464,6 +504,8 @@ NOTE: `asyncio` is only supported for Python 3.7+.
464504
[[api-label]]
465505
==== `elasticapm.label()`
466506

507+
[small]#Added in v5.0.0.#
508+
467509
Attach labels to the the current transaction and errors.
468510

469511
TIP: Before using custom labels, ensure you understand the different types of

0 commit comments

Comments
 (0)