-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[Behavioral Analytics] Add a final_pipeline to event data streams. #95198
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
Conversation
@@ -9,7 +9,8 @@ | |||
"refresh_interval": "1s", | |||
"number_of_shards": 1, | |||
"number_of_replicas": 0, | |||
"auto_expand_replicas": "0-1" | |||
"auto_expand_replicas": "0-1", | |||
"final_pipeline": "behavioral_analytics-events-final_pipeline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Updating the template to set the pipeline (as a final_pipeline
)
@@ -0,0 +1,51 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ The pipeline that will installed automatically when the cluster start by the AnalyticsIngestPipelineRegistry
@@ -0,0 +1,201 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This class may be moved to xpack core but I preferred to keep the code in our utils for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective, it makes sense to move it to x-pack/core
from the beginning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to move it later because it will require other teams to validate which can add an additional delay to gets reviewed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with moving it later considering we're very close to FF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kderusso Being very close to FF is indeed part of my rationale here.
...main/java/org/elasticsearch/xpack/application/analytics/AnalyticsIngestPipelineRegistry.java
Outdated
Show resolved
Hide resolved
.../org/elasticsearch/xpack/entsearch/analytics/behavioral_analytics-events-final_pipeline.json
Outdated
Show resolved
Hide resolved
0945429
to
fd92bce
Compare
package org.elasticsearch.xpack.application.analytics; | ||
|
||
public class AnalyticsConstants { | ||
// Data stream related constants. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 🚀
@@ -62,16 +62,84 @@ | |||
"page": { | |||
"properties": { | |||
"url": { | |||
"ignore_above": 1024, | |||
"type": "keyword" | |||
"properties": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ URLs are now object into the mapping (previously strings).
assigning to the right team |
Hi @afoucret, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -0,0 +1,201 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am OK with moving it later considering we're very close to FF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some lang level nitpicking.
I think we would need some review from the Platform teams on the approach for the PipelineRegistry
- you probably did that already - to ensure we're not reinventing the wheel.
|
||
package org.elasticsearch.xpack.application.analytics; | ||
|
||
public class AnalyticsConstants { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a private constructor to make the class non-instantiable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
|
||
package org.elasticsearch.xpack.application.analytics; | ||
|
||
public class AnalyticsConstants { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super fond of making a specific class for holding constants that are related to different concerns in the codebase.
Can't these constants be included into already existing classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will probably refactor this in the near future to create an AnalytisEventDataStream
class with more utils methods.
I propose to keep it for now and remove it later since these constants does not clearly belong to one of the existing class.
if (ingestPipelineExists(state, newPipeline.getId())) { | ||
IngestMetadata ingestMetadata = state.metadata().custom(IngestMetadata.TYPE); | ||
PipelineConfiguration existingPipeline = ingestMetadata.getPipelines().get(newPipeline.getId()); | ||
boolean newPipelineHasVersion = Objects.isNull(newPipeline.getVersion()) == false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not a direct comparison with null
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes more sense right now because the code is
boolean newPipelineHasVersion = Objects.nonNull(newPipeline.getVersion())
It removes the need of ==
and I find it easier to read.
* @param pipelineId the pipeline that failed to be created. | ||
* @param e The exception that caused the failure. | ||
*/ | ||
protected void onPutPipelineFailure(String pipelineId, Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method meant to be overriden by subclasses? We might use other visibility otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see valid use case for overriding it.
The same is done in the template registry.
a3ba148
to
6233ed5
Compare
6233ed5
to
4d39402
Compare
## Summary Fixes #156015 Fixes #156014 Fixes #155924 Fixes #155914 The Ingest Pipelines tests were broken because of a new pipeline introduced in elastic/elasticsearch#95198 but there was a fix added in elastic/elasticsearch#95621. The last PR fixes the error where it was not possible to delete the pipeline in the tests. This PR unskips the tests since they should now work as expected.
## Summary Fixes elastic#156015 Fixes elastic#156014 Fixes elastic#155924 Fixes elastic#155914 The Ingest Pipelines tests were broken because of a new pipeline introduced in elastic/elasticsearch#95198 but there was a fix added in elastic/elasticsearch#95621. The last PR fixes the error where it was not possible to delete the pipeline in the tests. This PR unskips the tests since they should now work as expected. (cherry picked from commit 32bc5c7) # Conflicts: # x-pack/test/accessibility/apps/ingest_node_pipelines.ts # x-pack/test/functional/apps/ingest_pipelines/ingest_pipelines.ts
…157257) # Backport This will backport the following commits from `main` to `8.8`: - [[Ingest Pipelines] Unskip functional and a11y tests (#157173)](#157173) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Yulia Čech","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-09T16:08:15Z","message":"[Ingest Pipelines] Unskip functional and a11y tests (#157173)\n\n## Summary\r\nFixes https://github.com/elastic/kibana/issues/156015\r\nFixes https://github.com/elastic/kibana/issues/156014\r\nFixes #155924 \r\nFixes https://github.com/elastic/kibana/issues/155914\r\n\r\nThe Ingest Pipelines tests were broken because of a new pipeline\r\nintroduced in elastic/elasticsearch#95198 but\r\nthere was a fix added in\r\nhttps://github.com/elastic/elasticsearch/pull/95621. The last PR fixes\r\nthe error where it was not possible to delete the pipeline in the tests.\r\nThis PR unskips the tests since they should now work as expected.","sha":"32bc5c77bbe5b17215715ea56c4a13593855323c","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Deployment Management","release_note:skip","Feature:Ingest Node Pipelines","v8.8.0","v8.9.0"],"number":157173,"url":"https://github.com/elastic/kibana/pull/157173","mergeCommit":{"message":"[Ingest Pipelines] Unskip functional and a11y tests (#157173)\n\n## Summary\r\nFixes https://github.com/elastic/kibana/issues/156015\r\nFixes https://github.com/elastic/kibana/issues/156014\r\nFixes #155924 \r\nFixes https://github.com/elastic/kibana/issues/155914\r\n\r\nThe Ingest Pipelines tests were broken because of a new pipeline\r\nintroduced in elastic/elasticsearch#95198 but\r\nthere was a fix added in\r\nhttps://github.com/elastic/elasticsearch/pull/95621. The last PR fixes\r\nthe error where it was not possible to delete the pipeline in the tests.\r\nThis PR unskips the tests since they should now work as expected.","sha":"32bc5c77bbe5b17215715ea56c4a13593855323c"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157173","number":157173,"mergeCommit":{"message":"[Ingest Pipelines] Unskip functional and a11y tests (#157173)\n\n## Summary\r\nFixes https://github.com/elastic/kibana/issues/156015\r\nFixes https://github.com/elastic/kibana/issues/156014\r\nFixes #155924 \r\nFixes https://github.com/elastic/kibana/issues/155914\r\n\r\nThe Ingest Pipelines tests were broken because of a new pipeline\r\nintroduced in elastic/elasticsearch#95198 but\r\nthere was a fix added in\r\nhttps://github.com/elastic/elasticsearch/pull/95621. The last PR fixes\r\nthe error where it was not possible to delete the pipeline in the tests.\r\nThis PR unskips the tests since they should now work as expected.","sha":"32bc5c77bbe5b17215715ea56c4a13593855323c"}}]}] BACKPORT-->
Description:
page.url
,page.referrer
andsearch.results.items[*].page.url
page.url
to be an objectpage.referrer
to be an objectsearch.results.items[*].page.url
to be an objectOther:
Blocked by [Ingest Processor] Addignore_missing
param to theuri_parts
ingest processor. #95068