elasticsearch9 9.0.2__py3-none-any.whl → 9.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- elasticsearch9/__init__.py +3 -3
- elasticsearch9/_async/client/__init__.py +88 -244
- elasticsearch9/_async/client/async_search.py +4 -4
- elasticsearch9/_async/client/autoscaling.py +4 -4
- elasticsearch9/_async/client/cat.py +419 -51
- elasticsearch9/_async/client/ccr.py +13 -13
- elasticsearch9/_async/client/cluster.py +32 -22
- elasticsearch9/_async/client/connector.py +30 -30
- elasticsearch9/_async/client/dangling_indices.py +3 -3
- elasticsearch9/_async/client/enrich.py +5 -5
- elasticsearch9/_async/client/eql.py +14 -6
- elasticsearch9/_async/client/esql.py +125 -9
- elasticsearch9/_async/client/features.py +2 -2
- elasticsearch9/_async/client/fleet.py +3 -3
- elasticsearch9/_async/client/graph.py +1 -1
- elasticsearch9/_async/client/ilm.py +11 -11
- elasticsearch9/_async/client/indices.py +592 -113
- elasticsearch9/_async/client/inference.py +521 -44
- elasticsearch9/_async/client/ingest.py +9 -16
- elasticsearch9/_async/client/license.py +11 -11
- elasticsearch9/_async/client/logstash.py +3 -3
- elasticsearch9/_async/client/migration.py +3 -3
- elasticsearch9/_async/client/ml.py +75 -87
- elasticsearch9/_async/client/monitoring.py +1 -1
- elasticsearch9/_async/client/nodes.py +7 -7
- elasticsearch9/_async/client/query_rules.py +8 -8
- elasticsearch9/_async/client/rollup.py +9 -30
- elasticsearch9/_async/client/search_application.py +10 -10
- elasticsearch9/_async/client/searchable_snapshots.py +4 -4
- elasticsearch9/_async/client/security.py +79 -81
- elasticsearch9/_async/client/shutdown.py +3 -3
- elasticsearch9/_async/client/simulate.py +1 -1
- elasticsearch9/_async/client/slm.py +9 -9
- elasticsearch9/_async/client/snapshot.py +64 -21
- elasticsearch9/_async/client/sql.py +6 -6
- elasticsearch9/_async/client/ssl.py +1 -1
- elasticsearch9/_async/client/synonyms.py +26 -7
- elasticsearch9/_async/client/tasks.py +4 -4
- elasticsearch9/_async/client/text_structure.py +4 -4
- elasticsearch9/_async/client/transform.py +11 -11
- elasticsearch9/_async/client/watcher.py +17 -15
- elasticsearch9/_async/client/xpack.py +2 -2
- elasticsearch9/_otel.py +8 -8
- elasticsearch9/_sync/client/__init__.py +88 -244
- elasticsearch9/_sync/client/async_search.py +4 -4
- elasticsearch9/_sync/client/autoscaling.py +4 -4
- elasticsearch9/_sync/client/cat.py +419 -51
- elasticsearch9/_sync/client/ccr.py +13 -13
- elasticsearch9/_sync/client/cluster.py +32 -22
- elasticsearch9/_sync/client/connector.py +30 -30
- elasticsearch9/_sync/client/dangling_indices.py +3 -3
- elasticsearch9/_sync/client/enrich.py +5 -5
- elasticsearch9/_sync/client/eql.py +14 -6
- elasticsearch9/_sync/client/esql.py +125 -9
- elasticsearch9/_sync/client/features.py +2 -2
- elasticsearch9/_sync/client/fleet.py +3 -3
- elasticsearch9/_sync/client/graph.py +1 -1
- elasticsearch9/_sync/client/ilm.py +11 -11
- elasticsearch9/_sync/client/indices.py +592 -113
- elasticsearch9/_sync/client/inference.py +521 -44
- elasticsearch9/_sync/client/ingest.py +9 -16
- elasticsearch9/_sync/client/license.py +11 -11
- elasticsearch9/_sync/client/logstash.py +3 -3
- elasticsearch9/_sync/client/migration.py +3 -3
- elasticsearch9/_sync/client/ml.py +75 -87
- elasticsearch9/_sync/client/monitoring.py +1 -1
- elasticsearch9/_sync/client/nodes.py +7 -7
- elasticsearch9/_sync/client/query_rules.py +8 -8
- elasticsearch9/_sync/client/rollup.py +9 -30
- elasticsearch9/_sync/client/search_application.py +10 -10
- elasticsearch9/_sync/client/searchable_snapshots.py +4 -4
- elasticsearch9/_sync/client/security.py +79 -81
- elasticsearch9/_sync/client/shutdown.py +3 -3
- elasticsearch9/_sync/client/simulate.py +1 -1
- elasticsearch9/_sync/client/slm.py +9 -9
- elasticsearch9/_sync/client/snapshot.py +64 -21
- elasticsearch9/_sync/client/sql.py +6 -6
- elasticsearch9/_sync/client/ssl.py +1 -1
- elasticsearch9/_sync/client/synonyms.py +26 -7
- elasticsearch9/_sync/client/tasks.py +4 -4
- elasticsearch9/_sync/client/text_structure.py +4 -4
- elasticsearch9/_sync/client/transform.py +11 -11
- elasticsearch9/_sync/client/watcher.py +17 -15
- elasticsearch9/_sync/client/xpack.py +2 -2
- elasticsearch9/_version.py +1 -1
- elasticsearch9/compat.py +5 -0
- elasticsearch9/dsl/__init__.py +2 -1
- elasticsearch9/dsl/aggs.py +20 -0
- elasticsearch9/dsl/document_base.py +177 -17
- elasticsearch9/dsl/field.py +230 -37
- elasticsearch9/dsl/query.py +6 -3
- elasticsearch9/dsl/response/__init__.py +1 -1
- elasticsearch9/dsl/types.py +169 -11
- elasticsearch9/dsl/utils.py +1 -1
- elasticsearch9/{dsl/_sync/_sync_check → esql}/__init__.py +2 -0
- elasticsearch9/esql/esql.py +1105 -0
- elasticsearch9/esql/esql1.py1 +307 -0
- elasticsearch9/esql/functions.py +1738 -0
- {elasticsearch9-9.0.2.dist-info → elasticsearch9-9.1.0.dist-info}/METADATA +3 -4
- elasticsearch9-9.1.0.dist-info/RECORD +164 -0
- elasticsearch9/dsl/_sync/_sync_check/document.py +0 -514
- elasticsearch9/dsl/_sync/_sync_check/faceted_search.py +0 -50
- elasticsearch9/dsl/_sync/_sync_check/index.py +0 -597
- elasticsearch9/dsl/_sync/_sync_check/mapping.py +0 -49
- elasticsearch9/dsl/_sync/_sync_check/search.py +0 -230
- elasticsearch9/dsl/_sync/_sync_check/update_by_query.py +0 -45
- elasticsearch9-9.0.2.dist-info/RECORD +0 -167
- {elasticsearch9-9.0.2.dist-info → elasticsearch9-9.1.0.dist-info}/WHEEL +0 -0
- {elasticsearch9-9.0.2.dist-info → elasticsearch9-9.1.0.dist-info}/licenses/LICENSE +0 -0
- {elasticsearch9-9.0.2.dist-info → elasticsearch9-9.1.0.dist-info}/licenses/NOTICE +0 -0
|
@@ -44,7 +44,7 @@ class TransformClient(NamespacedClient):
|
|
|
44
44
|
<p>Delete a transform.</p>
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
47
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform>`_
|
|
48
48
|
|
|
49
49
|
:param transform_id: Identifier for the transform.
|
|
50
50
|
:param delete_dest_index: If this value is true, the destination index is deleted
|
|
@@ -108,7 +108,7 @@ class TransformClient(NamespacedClient):
|
|
|
108
108
|
Get configuration information for transforms.</p>
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
111
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform>`_
|
|
112
112
|
|
|
113
113
|
:param transform_id: Identifier for the transform. It can be a transform identifier
|
|
114
114
|
or a wildcard expression. You can get information for all transforms by using
|
|
@@ -181,7 +181,7 @@ class TransformClient(NamespacedClient):
|
|
|
181
181
|
<p>Get usage information for transforms.</p>
|
|
182
182
|
|
|
183
183
|
|
|
184
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
184
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform-stats>`_
|
|
185
185
|
|
|
186
186
|
:param transform_id: Identifier for the transform. It can be a transform identifier
|
|
187
187
|
or a wildcard expression. You can get information for all transforms by using
|
|
@@ -269,7 +269,7 @@ class TransformClient(NamespacedClient):
|
|
|
269
269
|
types of the source index and the transform aggregations.</p>
|
|
270
270
|
|
|
271
271
|
|
|
272
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
272
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform>`_
|
|
273
273
|
|
|
274
274
|
:param transform_id: Identifier for the transform to preview. If you specify
|
|
275
275
|
this path parameter, you cannot provide transform configuration details in
|
|
@@ -406,7 +406,7 @@ class TransformClient(NamespacedClient):
|
|
|
406
406
|
give users any privileges on <code>.data-frame-internal*</code> indices.</p>
|
|
407
407
|
|
|
408
408
|
|
|
409
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
409
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-put-transform>`_
|
|
410
410
|
|
|
411
411
|
:param transform_id: Identifier for the transform. This identifier can contain
|
|
412
412
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -512,7 +512,7 @@ class TransformClient(NamespacedClient):
|
|
|
512
512
|
If the destination index was created by the transform, it is deleted.</p>
|
|
513
513
|
|
|
514
514
|
|
|
515
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
515
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform>`_
|
|
516
516
|
|
|
517
517
|
:param transform_id: Identifier for the transform. This identifier can contain
|
|
518
518
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores.
|
|
@@ -572,7 +572,7 @@ class TransformClient(NamespacedClient):
|
|
|
572
572
|
is called again in the meantime.</p>
|
|
573
573
|
|
|
574
574
|
|
|
575
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
575
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform>`_
|
|
576
576
|
|
|
577
577
|
:param transform_id: Identifier for the transform.
|
|
578
578
|
:param timeout: Controls the time to wait for the scheduling to take place
|
|
@@ -635,7 +635,7 @@ class TransformClient(NamespacedClient):
|
|
|
635
635
|
destination indices, the transform fails when it attempts unauthorized operations.</p>
|
|
636
636
|
|
|
637
637
|
|
|
638
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
638
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform>`_
|
|
639
639
|
|
|
640
640
|
:param transform_id: Identifier for the transform.
|
|
641
641
|
:param from_: Restricts the set of transformed entities to those changed after
|
|
@@ -693,7 +693,7 @@ class TransformClient(NamespacedClient):
|
|
|
693
693
|
Stops one or more transforms.</p>
|
|
694
694
|
|
|
695
695
|
|
|
696
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
696
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform>`_
|
|
697
697
|
|
|
698
698
|
:param transform_id: Identifier for the transform. To stop multiple transforms,
|
|
699
699
|
use a comma-separated list or a wildcard expression. To stop all transforms,
|
|
@@ -795,7 +795,7 @@ class TransformClient(NamespacedClient):
|
|
|
795
795
|
time of update and runs with those privileges.</p>
|
|
796
796
|
|
|
797
797
|
|
|
798
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
798
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform>`_
|
|
799
799
|
|
|
800
800
|
:param transform_id: Identifier for the transform.
|
|
801
801
|
:param defer_validation: When true, deferrable validations are not run. This
|
|
@@ -890,7 +890,7 @@ class TransformClient(NamespacedClient):
|
|
|
890
890
|
You may want to perform a recent cluster backup prior to the upgrade.</p>
|
|
891
891
|
|
|
892
892
|
|
|
893
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
893
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-upgrade-transforms>`_
|
|
894
894
|
|
|
895
895
|
:param dry_run: When true, the request checks for updates but does not run them.
|
|
896
896
|
:param timeout: Period to wait for a response. If no response is received before
|
|
@@ -45,10 +45,11 @@ class WatcherClient(NamespacedClient):
|
|
|
45
45
|
<p>IMPORTANT: If the specified watch is currently being executed, this API will return an error
|
|
46
46
|
The reason for this behavior is to prevent overwriting the watch status from a watch execution.</p>
|
|
47
47
|
<p>Acknowledging an action throttles further executions of that action until its <code>ack.state</code> is reset to <code>awaits_successful_execution</code>.
|
|
48
|
-
This happens when the condition of the watch is not met (the condition evaluates to false)
|
|
48
|
+
This happens when the condition of the watch is not met (the condition evaluates to false).
|
|
49
|
+
To demonstrate how throttling works in practice and how it can be configured for individual actions within a watch, refer to External documentation.</p>
|
|
49
50
|
|
|
50
51
|
|
|
51
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
52
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-ack-watch>`_
|
|
52
53
|
|
|
53
54
|
:param watch_id: The watch identifier.
|
|
54
55
|
:param action_id: A comma-separated list of the action identifiers to acknowledge.
|
|
@@ -104,7 +105,7 @@ class WatcherClient(NamespacedClient):
|
|
|
104
105
|
A watch can be either active or inactive.</p>
|
|
105
106
|
|
|
106
107
|
|
|
107
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
108
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch>`_
|
|
108
109
|
|
|
109
110
|
:param watch_id: The watch identifier.
|
|
110
111
|
"""
|
|
@@ -148,7 +149,7 @@ class WatcherClient(NamespacedClient):
|
|
|
148
149
|
A watch can be either active or inactive.</p>
|
|
149
150
|
|
|
150
151
|
|
|
151
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
152
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch>`_
|
|
152
153
|
|
|
153
154
|
:param watch_id: The watch identifier.
|
|
154
155
|
"""
|
|
@@ -196,7 +197,7 @@ class WatcherClient(NamespacedClient):
|
|
|
196
197
|
When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the <code>.watches</code> index.</p>
|
|
197
198
|
|
|
198
199
|
|
|
199
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
200
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-delete-watch>`_
|
|
200
201
|
|
|
201
202
|
:param id: The watch identifier.
|
|
202
203
|
"""
|
|
@@ -274,10 +275,11 @@ class WatcherClient(NamespacedClient):
|
|
|
274
275
|
This serves as great tool for testing and debugging your watches prior to adding them to Watcher.</p>
|
|
275
276
|
<p>When Elasticsearch security features are enabled on your cluster, watches are run with the privileges of the user that stored the watches.
|
|
276
277
|
If your user is allowed to read index <code>a</code>, but not index <code>b</code>, then the exact same set of rules will apply during execution of a watch.</p>
|
|
277
|
-
<p>When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch
|
|
278
|
+
<p>When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch.
|
|
279
|
+
Refer to the external documentation for examples of watch execution requests, including existing, customized, and inline watches.</p>
|
|
278
280
|
|
|
279
281
|
|
|
280
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
282
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-execute-watch>`_
|
|
281
283
|
|
|
282
284
|
:param id: The watch identifier.
|
|
283
285
|
:param action_modes: Determines how to handle the watch actions as part of the
|
|
@@ -365,7 +367,7 @@ class WatcherClient(NamespacedClient):
|
|
|
365
367
|
Only a subset of settings are shown, for example <code>index.auto_expand_replicas</code> and <code>index.number_of_replicas</code>.</p>
|
|
366
368
|
|
|
367
369
|
|
|
368
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
370
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-settings>`_
|
|
369
371
|
|
|
370
372
|
:param master_timeout: The period to wait for a connection to the master node.
|
|
371
373
|
If no response is received before the timeout expires, the request fails
|
|
@@ -410,7 +412,7 @@ class WatcherClient(NamespacedClient):
|
|
|
410
412
|
<p>Get a watch.</p>
|
|
411
413
|
|
|
412
414
|
|
|
413
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
415
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-watch>`_
|
|
414
416
|
|
|
415
417
|
:param id: The watch identifier.
|
|
416
418
|
"""
|
|
@@ -485,7 +487,7 @@ class WatcherClient(NamespacedClient):
|
|
|
485
487
|
If the user is able to read index <code>a</code>, but not index <code>b</code>, the same will apply when the watch runs.</p>
|
|
486
488
|
|
|
487
489
|
|
|
488
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
490
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-put-watch>`_
|
|
489
491
|
|
|
490
492
|
:param id: The identifier for the watch.
|
|
491
493
|
:param actions: The list of actions that will be run if the condition matches.
|
|
@@ -598,7 +600,7 @@ class WatcherClient(NamespacedClient):
|
|
|
598
600
|
<p>Note that only the <code>_id</code> and <code>metadata.*</code> fields are queryable or sortable.</p>
|
|
599
601
|
|
|
600
602
|
|
|
601
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
603
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-query-watches>`_
|
|
602
604
|
|
|
603
605
|
:param from_: The offset from the first result to fetch. It must be non-negative.
|
|
604
606
|
:param query: A query that filters the watches to be returned.
|
|
@@ -673,7 +675,7 @@ class WatcherClient(NamespacedClient):
|
|
|
673
675
|
Start the Watcher service if it is not already running.</p>
|
|
674
676
|
|
|
675
677
|
|
|
676
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
678
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start>`_
|
|
677
679
|
|
|
678
680
|
:param master_timeout: Period to wait for a connection to the master node.
|
|
679
681
|
"""
|
|
@@ -739,7 +741,7 @@ class WatcherClient(NamespacedClient):
|
|
|
739
741
|
You retrieve more metrics by using the metric parameter.</p>
|
|
740
742
|
|
|
741
743
|
|
|
742
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
744
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stats>`_
|
|
743
745
|
|
|
744
746
|
:param metric: Defines which additional metrics are included in the response.
|
|
745
747
|
:param emit_stacktraces: Defines whether stack traces are generated for each
|
|
@@ -790,7 +792,7 @@ class WatcherClient(NamespacedClient):
|
|
|
790
792
|
Stop the Watcher service if it is running.</p>
|
|
791
793
|
|
|
792
794
|
|
|
793
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
795
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop>`_
|
|
794
796
|
|
|
795
797
|
:param master_timeout: The period to wait for the master node. If the master
|
|
796
798
|
node is not available before the timeout expires, the request fails and returns
|
|
@@ -851,7 +853,7 @@ class WatcherClient(NamespacedClient):
|
|
|
851
853
|
Watcher shards must always be in the <code>data_content</code> tier.</p>
|
|
852
854
|
|
|
853
855
|
|
|
854
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
856
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-update-settings>`_
|
|
855
857
|
|
|
856
858
|
:param index_auto_expand_replicas:
|
|
857
859
|
:param index_number_of_replicas:
|
|
@@ -54,7 +54,7 @@ class XPackClient(NamespacedClient):
|
|
|
54
54
|
</ul>
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
57
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info>`_
|
|
58
58
|
|
|
59
59
|
:param accept_enterprise: If this param is used it must be set to true
|
|
60
60
|
:param categories: A comma-separated list of the information categories to include
|
|
@@ -103,7 +103,7 @@ class XPackClient(NamespacedClient):
|
|
|
103
103
|
The API also provides some usage statistics.</p>
|
|
104
104
|
|
|
105
105
|
|
|
106
|
-
`<https://www.elastic.co/docs/api/doc/elasticsearch/
|
|
106
|
+
`<https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-xpack>`_
|
|
107
107
|
|
|
108
108
|
:param master_timeout: The period to wait for a connection to the master node.
|
|
109
109
|
If no response is received before the timeout expires, the request fails
|
elasticsearch9/_otel.py
CHANGED
|
@@ -67,7 +67,7 @@ class OpenTelemetry:
|
|
|
67
67
|
*,
|
|
68
68
|
endpoint_id: str | None,
|
|
69
69
|
path_parts: Mapping[str, str],
|
|
70
|
-
) -> Generator[OpenTelemetrySpan
|
|
70
|
+
) -> Generator[OpenTelemetrySpan]:
|
|
71
71
|
if not self.enabled or self.tracer is None:
|
|
72
72
|
yield OpenTelemetrySpan(None)
|
|
73
73
|
return
|
|
@@ -75,11 +75,11 @@ class OpenTelemetry:
|
|
|
75
75
|
span_name = endpoint_id or method
|
|
76
76
|
with self.tracer.start_as_current_span(span_name) as otel_span:
|
|
77
77
|
otel_span.set_attribute("http.request.method", method)
|
|
78
|
-
otel_span.set_attribute("db.system", "elasticsearch")
|
|
78
|
+
otel_span.set_attribute("db.system.name", "elasticsearch")
|
|
79
79
|
if endpoint_id is not None:
|
|
80
|
-
otel_span.set_attribute("db.operation", endpoint_id)
|
|
80
|
+
otel_span.set_attribute("db.operation.name", endpoint_id)
|
|
81
81
|
for key, value in path_parts.items():
|
|
82
|
-
otel_span.set_attribute(f"db.
|
|
82
|
+
otel_span.set_attribute(f"db.operation.parameter.{key}", value)
|
|
83
83
|
|
|
84
84
|
yield OpenTelemetrySpan(
|
|
85
85
|
otel_span,
|
|
@@ -88,20 +88,20 @@ class OpenTelemetry:
|
|
|
88
88
|
)
|
|
89
89
|
|
|
90
90
|
@contextlib.contextmanager
|
|
91
|
-
def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan
|
|
91
|
+
def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan]:
|
|
92
92
|
if not self.enabled or self.tracer is None:
|
|
93
93
|
yield OpenTelemetrySpan(None)
|
|
94
94
|
return
|
|
95
95
|
|
|
96
96
|
with self.tracer.start_as_current_span(span_name) as otel_span:
|
|
97
|
-
otel_span.set_attribute("db.system", "elasticsearch")
|
|
98
|
-
otel_span.set_attribute("db.operation", span_name)
|
|
97
|
+
otel_span.set_attribute("db.system.name", "elasticsearch")
|
|
98
|
+
otel_span.set_attribute("db.operation.name", span_name)
|
|
99
99
|
# Without a request method, Elastic APM does not display the traces
|
|
100
100
|
otel_span.set_attribute("http.request.method", "null")
|
|
101
101
|
yield OpenTelemetrySpan(otel_span)
|
|
102
102
|
|
|
103
103
|
@contextlib.contextmanager
|
|
104
|
-
def use_span(self, span: OpenTelemetrySpan) -> Generator[None
|
|
104
|
+
def use_span(self, span: OpenTelemetrySpan) -> Generator[None]:
|
|
105
105
|
if not self.enabled or self.tracer is None or span.otel_span is None:
|
|
106
106
|
yield
|
|
107
107
|
return
|