Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
10 changes: 10 additions & 0 deletions docs/changelog/122960.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pr: 122960
summary: Deprecate Behavioral Analytics CRUD apis
area: Search
type: deprecation
issues: [ ]
deprecation:
title: Deprecate Behavioral Analytics CRUD apis
area: Search
details: Behavioral Analytics has been deprecated as of 9.0.0 and will be removed in a future release. The APIs will still work for now, but will emit warning headers that the API has been deprecated.
impact: Behavioral Analytics has been deprecated as of 9.0.0 and will be removed in a future release.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[[delete-analytics-collection]]
=== Delete Analytics Collection

deprecated:[9.0.0]
beta::[]

++++
Expand All @@ -14,15 +15,6 @@ beta::[]
For the most up-to-date API details, refer to {api-es}/group/endpoint-analytics[Behavioral analytics APIs].
--

////
[source,console]
----
PUT _application/analytics/my_analytics_collection
----
// TESTSETUP

////

Removes a <<behavioral-analytics-overview,Behavioral Analytics>> Collection and its associated data stream.

[[delete-analytics-collection-request]]
Expand Down Expand Up @@ -59,3 +51,4 @@ The following example deletes the Analytics Collection named `my_analytics_colle
----
DELETE _application/analytics/my_analytics_collection/
----
// TEST[skip:Behavioral Analytics APIs emit deprecation warnings and will not be updated]
Copy link
Member Author

Choose a reason for hiding this comment

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

There appears to be a bug in our test framework as emitting warnings during test setup can't be handled. Since we're not going to be updating these APIs my solution was to skip the tests.

1 change: 1 addition & 0 deletions docs/reference/behavioral-analytics/apis/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[[behavioral-analytics-apis]]
== Behavioral Analytics APIs

deprecated:[9.0.0]
beta::[]

++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[[list-analytics-collection]]
=== List Analytics Collections

deprecated:[9.0.0]
beta::[]

++++
Expand All @@ -14,22 +15,6 @@ beta::[]
For the most up-to-date API details, refer to {api-es}/group/endpoint-analytics[Behavioral analytics APIs].
--

////
[source,console]
----
PUT _application/analytics/my_analytics_collection
PUT _application/analytics/my_analytics_collection2
----
// TESTSETUP

[source,console]
----
DELETE _application/analytics/my_analytics_collection
DELETE _application/analytics/my_analytics_collection2
----
// TEARDOWN
////

Returns information about <<behavioral-analytics-overview,Behavioral Analytics>> Collections.

[[list-analytics-collection-request]]
Expand All @@ -46,8 +31,9 @@ Requires the `manage_behavioral_analytics` cluster privilege.
==== {api-path-parms-title}

`<criteria>`::
(optional, string)
Criteria is used to find a matching analytics collection. This could be the name of the collection or a pattern to match multiple. If not specified, will return all analytics collections.
(optional, string) Criteria is used to find a matching analytics collection.
This could be the name of the collection or a pattern to match multiple.
If not specified, will return all analytics collections.

[[list-analytics-collection-response-codes]]
==== {api-response-codes-title}
Expand All @@ -66,6 +52,7 @@ The following example lists all configured Analytics Collections:
----
GET _application/analytics/
----
// TEST[skip:Behavioral Analytics APIs emit deprecation warnings and will not be updated]

A sample response:

Expand All @@ -91,6 +78,7 @@ The following example returns the Analytics Collection that matches `my_analytic
----
GET _application/analytics/my_analytics_collection
----
// TEST[skip:Behavioral Analytics APIs emit deprecation warnings and will not be updated]

A sample response:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[[post-analytics-collection-event]]
=== Post Event to an Analytics Collection

deprecated:[9.0.0]
beta::[]

++++
Expand All @@ -14,20 +15,6 @@ beta::[]
For the most up-to-date API details, refer to {api-es}/group/endpoint-analytics[Behavioral analytics APIs].
--

////
[source,console]
----
PUT _application/analytics/my_analytics_collection
----
// TESTSETUP

[source,console]
----
DELETE _application/analytics/my_analytics_collection
----
// TEARDOWN
////

Post an event to a <<behavioral-analytics-overview,Behavioral Analytics>> Collection.

[[post-analytics-collection-event-request]]
Expand Down Expand Up @@ -105,3 +92,4 @@ POST _application/analytics/my_analytics_collection/event/search_click
}
}
----
// TEST[skip:Behavioral Analytics APIs emit deprecation warnings and will not be updated]
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[[put-analytics-collection]]
=== Put Analytics Collection

deprecated:[9.0.0]
beta::[]

++++
Expand All @@ -14,14 +15,6 @@ beta::[]
For the most up-to-date API details, refer to {api-es}/group/endpoint-analytics[Behavioral analytics APIs].
--

////
[source,console]
----
DELETE _application/analytics/my_analytics_collection
----
// TEARDOWN
////

Creates a <<behavioral-analytics-overview,Behavioral Analytics>> Collection.

[[put-analytics-collection-request]]
Expand Down Expand Up @@ -55,3 +48,4 @@ The following example creates a new Analytics Collection called `my_analytics_co
----
PUT _application/analytics/my_analytics_collection
----
// TEST[skip:Behavioral Analytics APIs emit deprecation warnings and will not be updated]
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[[behavioral-analytics-api]]
=== Behavioral Analytics API overview

++++
<titleabbrev>API overview</titleabbrev>
++++

deprecated:[9.0.0]

This page outlines all the APIs available for behavioral analytics and links to their documentation.

[discrete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<titleabbrev>Set up CORs</titleabbrev>
++++

deprecated:[9.0.0]

Behavioral Analytics sends events directly to the {es} API.
This means that the browser makes requests to the {es} API directly.
{es} supports https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS[Cross-Origin Resource Sharing (CORS)^], but this feature is disabled by default.
Expand Down Expand Up @@ -43,4 +45,4 @@ On Elastic Cloud, you can do this by {cloud}/ec-add-user-settings.html#ec-add-us
==== Proxy the request through a server that supports CORS

If you are unable to enable CORS on {es}, you can proxy the request through a server that supports CORS.
This is more complicated, but is a viable option.
This is more complicated, but is a viable option.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<titleabbrev>Events reference</titleabbrev>
++++

deprecated:[9.0.0]

Behavioral Analytics logs events using the {ecs-ref}/ecs-reference.html[Elastic Common Schema^], including a custom field set for analytics events.
Refer to <<behavioral-analytics-event-reference-examples,examples>> of the full data objects that are logged.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<titleabbrev>View events</titleabbrev>
++++

deprecated:[9.0.0]

[TIP]
====
Refer to <<behavioral-analytics-event-reference>> for a complete list of the fields logged by events.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[[behavioral-analytics-overview]]

deprecated:[9.0.0]

== Search analytics

Behavioral Analytics is an analytics event collection platform.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<titleabbrev>Get started</titleabbrev>
++++

deprecated:[9.0.0]

You can manage your analytics in the {kib} UI.
Go to *Search > Behavioral Analytics* to get started.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
},
"stability": "experimental",
"visibility": "public",
"deprecated": {
"version": "9.0.0",
"description": "Behavioral Analytics has been deprecated and will be removed in a future release."
},
"headers": {
"accept": [
"application/json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
},
"stability": "experimental",
"visibility": "public",
"deprecated": {
"version": "9.0.0",
"description": "Behavioral Analytics has been deprecated and will be removed in a future release."
},
"headers": {
"accept": [
"application/json"
Expand All @@ -24,10 +28,10 @@
"methods": [
"GET"
],
"parts":{
"name":{
"type":"list",
"description":"A comma-separated list of analytics collections to limit the returned information"
"parts": {
"name": {
"type": "list",
"description": "A comma-separated list of analytics collections to limit the returned information"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
},
"stability": "experimental",
"visibility": "public",
"deprecated": {
"version": "9.0.0",
"description": "Behavioral Analytics has been deprecated and will be removed in a future release."
},
"headers": {
"accept": [
"application/json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"description": "Creates a behavioral analytics collection."
},
"stability": "experimental",
"deprecated": {
"version": "9.0.0",
"description": "Behavioral Analytics has been deprecated and will be removed in a future release."
},
"visibility": "public",
"headers": {
"accept": [
Expand Down
54 changes: 28 additions & 26 deletions x-pack/plugin/build.gradle
Copy link
Member Author

Choose a reason for hiding this comment

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

Whitespace/auto-formatting

Original file line number Diff line number Diff line change
Expand Up @@ -84,32 +84,34 @@ tasks.named("precommit").configure {
dependsOn 'enforceYamlTestConvention', 'enforceApiSpecsConvention'
}

tasks.named("yamlRestCompatTestTransform").configure({ task ->
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry)", "The telemetry output changed. We dropped a column. That's safe.")
task.skipTest("inference/inference_crud/Test get all", "Assertions on number of inference models break due to default configs")
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry) snapshot version", "The number of functions is constantly increasing")
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry) non-snapshot version", "The number of functions is constantly increasing")
task.skipTest("esql/80_text/reverse text", "The output type changed from TEXT to KEYWORD.")
task.skipTest("esql/80_text/values function", "The output type changed from TEXT to KEYWORD.")
task.skipTest("privileges/11_builtin/Test get builtin privileges" ,"unnecessary to test compatibility")
task.skipTest("esql/61_enrich_ip/Invalid IP strings", "We switched from exceptions to null+warnings for ENRICH runtime errors")
task.skipTest("esql/180_match_operator/match with non text field", "Match operator can now be used on non-text fields")
task.skipTest("esql/180_match_operator/match with functions", "Error message changed")
task.skipTest("esql/40_unsupported_types/semantic_text declared in mapping", "The semantic text field format changed")
task.skipTest("esql/190_lookup_join/Alias as lookup index", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-repeated-alias", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-repeated-index", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-pattern-multiple", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-pattern-single", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/180_match_operator/match with disjunctions", "Disjunctions in full text functions work now")
// Expected deprecation warning to compat yaml tests:
task.addAllowedWarningRegex(".*rollup functionality will be removed in Elasticsearch.*")
task.skipTest("esql/40_tsdb/from doc with aggregate_metric_double", "TODO: support for subset of metric fields")
task.skipTest("esql/40_tsdb/stats on aggregate_metric_double", "TODO: support for subset of metric fields")
task.skipTest("esql/40_tsdb/from index pattern unsupported counter", "TODO: support for subset of metric fields")
task.skipTest("esql/40_unsupported_types/unsupported", "TODO: support for subset of metric fields")
task.skipTest("esql/40_unsupported_types/unsupported with sort", "TODO: support for subset of metric fields")
})
tasks.named("yamlRestCompatTestTransform").configure(
{ task ->
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry)", "The telemetry output changed. We dropped a column. That's safe.")
task.skipTest("inference/inference_crud/Test get all", "Assertions on number of inference models break due to default configs")
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry) snapshot version", "The number of functions is constantly increasing")
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry) non-snapshot version", "The number of functions is constantly increasing")
task.skipTest("esql/80_text/reverse text", "The output type changed from TEXT to KEYWORD.")
task.skipTest("esql/80_text/values function", "The output type changed from TEXT to KEYWORD.")
task.skipTest("privileges/11_builtin/Test get builtin privileges", "unnecessary to test compatibility")
task.skipTest("esql/61_enrich_ip/Invalid IP strings", "We switched from exceptions to null+warnings for ENRICH runtime errors")
task.skipTest("esql/180_match_operator/match with non text field", "Match operator can now be used on non-text fields")
task.skipTest("esql/180_match_operator/match with functions", "Error message changed")
task.skipTest("esql/40_unsupported_types/semantic_text declared in mapping", "The semantic text field format changed")
task.skipTest("esql/190_lookup_join/Alias as lookup index", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-repeated-alias", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-repeated-index", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-pattern-multiple", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/190_lookup_join/alias-pattern-single", "LOOKUP JOIN does not support index aliases for now")
task.skipTest("esql/180_match_operator/match with disjunctions", "Disjunctions in full text functions work now")
// Expected deprecation warning to compat yaml tests:
task.addAllowedWarningRegex(".*rollup functionality will be removed in Elasticsearch.*")
task.skipTest("esql/40_tsdb/from doc with aggregate_metric_double", "TODO: support for subset of metric fields")
task.skipTest("esql/40_tsdb/stats on aggregate_metric_double", "TODO: support for subset of metric fields")
task.skipTest("esql/40_tsdb/from index pattern unsupported counter", "TODO: support for subset of metric fields")
task.skipTest("esql/40_unsupported_types/unsupported", "TODO: support for subset of metric fields")
task.skipTest("esql/40_unsupported_types/unsupported with sort", "TODO: support for subset of metric fields")
}
)

tasks.named('yamlRestCompatTest').configure {
systemProperty 'es.queryable_built_in_roles_enabled', 'false'
Expand Down
8 changes: 8 additions & 0 deletions x-pack/plugin/ent-search/qa/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ testClusters.configureEach {
artifacts {
restXpackTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
}


tasks.named("yamlRestCompatTestTransform").configure(
{ task ->
// Behavioral Analytics is deprecated with 9.0.0.
task.addAllowedWarning("Behavioral Analytics is deprecated and will be removed in a future release.")
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ teardown:

---
"xpack usage includes Enterprise Search":
- requires:
test_runner_features: [ allowed_warnings ]

- do:
xpack.usage: { }
Expand Down Expand Up @@ -79,6 +81,8 @@ teardown:
query: "{{query_string}}"

- do:
allowed_warnings:
- "Behavioral Analytics is deprecated and will be removed in a future release."
search_application.put_behavioral_analytics:
name: test-analytics-collection

Expand Down Expand Up @@ -113,6 +117,8 @@ teardown:
}

- do:
allowed_warnings:
- "Behavioral Analytics is deprecated and will be removed in a future release."
search_application.delete_behavioral_analytics:
name: test-analytics-collection

Expand Down
Loading
Loading