-
Notifications
You must be signed in to change notification settings - Fork 931
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
Introduce ElasticSearch event logger for server events #5488
base: master
Are you sure you want to change the base?
Conversation
@wForget has made similar contributions in #1689, and we have several questions regarding the Elasticsearch license, see #1689 (comment). |
Oh, thanks for raising this. Sounds like more investigation is required in the scope of licence to clarify the impact for high/low-level client and the runtime usage of ES server for testing. |
Hi @tisonkun, may I have your opinion on these licence concerns? |
@bowenliang123 Thanks for reaching out to me. I'm sure that elasticsearch-rest-client can be used under Apache License 2.0. For elasticsearch-java you referred, Elastic released it under Apache License 2.0. From the dependencies it includes, the final JAR should be compatible with Apache License 2.0 to use and convey. |
FYI Pulsar Elastic connector uses this API client - apache/pulsar#14805. Although, you may check the dependencies doesn't include any ELv2 licensed code with a certain version. |
Currently, the PR only considers ES 8, right? Actually, bunches of vendors are sticky on ES 7.10 (the last version released under AL2) or older versions, I think we should at least support ES 7 too. |
Sure. This PR can be changed to base on ES 7 client and testing. |
602cd77
to
a7c9932
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5488 +/- ##
=======================================
Coverage 0.00% 0.00%
=======================================
Files 677 679 +2
Lines 41902 42010 +108
Branches 5721 5730 +9
=======================================
- Misses 41902 42010 +108 ☔ View full report in Codecov by Sentry. |
09b5fb2
to
39adfff
Compare
Tested with ElasticSearch server 7.x and 8.x. Now use the |
ed65bd3
to
8ead671
Compare
private val objectMapper = new ObjectMapper().registerModule(DefaultScalaModule) | ||
|
||
override def apply(event: KyuubiEvent): Unit = { | ||
val fields = { |
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 does not seem to be a good solution that serializes the event into a json string and then deserializes it again into a map. elastic4s
provides the indexInto(indexId).doc(XXX)
method to directly index json string.
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.
Tried, but not working. Due to the nested fields that I have to serialize-deserialize-map again. Tried to implement a method for generating flat json, but not serializing properly.
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.
but not serializing properly.
Are there any specific errors?
...vents/src/main/scala/org/apache/kyuubi/events/handler/ElasticSearchLoggingEventHandler.scala
Outdated
Show resolved
Hide resolved
...vents/src/main/scala/org/apache/kyuubi/events/handler/ElasticSearchLoggingEventHandler.scala
Show resolved
Hide resolved
...vents/src/main/scala/org/apache/kyuubi/events/handler/ElasticSearchLoggingEventHandler.scala
Outdated
Show resolved
Hide resolved
...vents/src/main/scala/org/apache/kyuubi/events/handler/ElasticSearchLoggingEventHandler.scala
Outdated
Show resolved
Hide resolved
2dad5a3
to
2c2ae23
Compare
2c2ae23
to
5c01675
Compare
956219c
to
dbb5bb1
Compare
|
||
class ServerElasticSearchLoggingEventHandlerSuiteForEs7 | ||
extends ServerElasticSearchLoggingEventHandlerSuite { | ||
override val imageTag = "7.17.14" |
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.
does it support ES 6?
a survey from another team in my company shows that we have bunches of customers still using ES 6
Why are the changes needed?
ELASTICSEARCH
for serverelastic4s
8.9.1 as ElasticSearch client for Scala, which depends on the ElasticSearch Java Clientelasticsearch-rest-client
8.9.x.elastic4s
andelasticsearch-rest-client
released with Apache Licence 2.0.elasticsearch-rest-client
does not depends on the ElasticSearch server library.How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request
Was this patch authored or co-authored using generative AI tooling?
No.