-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add metrics for successful/failed Spark index creation #837
Add metrics for successful/failed Spark index creation #837
Conversation
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
val result = doCreate(spark, metadata) | ||
emitIndexCreationStatusMetric(metadata, success = true) | ||
Some(result) | ||
} catch { | ||
case e: Exception => | ||
emitIndexCreationStatusMetric(metadata, success = 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.
Could you double check if this is the right place? I recall this factory is actually deserializer from Flint metadata to index class. I guess you may want to intercept API call in FlintSpark
? Also for all metrics related logic, please consider AOP style rather than insert this logic in many places.
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.
Moved the metric collection to the new location. I experimented with trying something AOP-like but it was cumbersome -- linking the existing logic in spark/refresh introduces a circular dependency, and the callable implicitly raising Exception
makes error handling awkward if trying to make a general-purpose duplicate of what exists on the Scala side.
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
f8f1624
to
7df59b8
Compare
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java
Outdated
Show resolved
Hide resolved
flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java
Show resolved
Hide resolved
flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java
Show resolved
Hide resolved
flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
flint-core/src/main/scala/org/opensearch/flint/core/storage/FlintOpenSearchClient.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Simeon Widdis <[email protected]>
* Add index creation metrics Signed-off-by: Simeon Widdis <[email protected]> * Update emit metric function location Signed-off-by: Simeon Widdis <[email protected]> * Apply scalafmt Signed-off-by: Simeon Widdis <[email protected]> * revert FlintSparkIndexFactory metrics emission Signed-off-by: Simeon Widdis <[email protected]> * Update OS client to emit metrics Signed-off-by: Simeon Widdis <[email protected]> * Fix index kind detection Signed-off-by: Simeon Widdis <[email protected]> * Remove cumbersome with() method Signed-off-by: Simeon Widdis <[email protected]> * Revert the void change Signed-off-by: Simeon Widdis <[email protected]> * Make the code branchless Signed-off-by: Simeon Widdis <[email protected]> * Add default case to switches Signed-off-by: Simeon Widdis <[email protected]> * Apply PR feedback Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]> (cherry picked from commit 6f37b2d) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add index creation metrics * Update emit metric function location * Apply scalafmt * revert FlintSparkIndexFactory metrics emission * Update OS client to emit metrics * Fix index kind detection * Remove cumbersome with() method * Revert the void change * Make the code branchless * Add default case to switches * Apply PR feedback --------- (cherry picked from commit 6f37b2d) Signed-off-by: Simeon Widdis <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#837) * Add index creation metrics Signed-off-by: Simeon Widdis <[email protected]> * Update emit metric function location Signed-off-by: Simeon Widdis <[email protected]> * Apply scalafmt Signed-off-by: Simeon Widdis <[email protected]> * revert FlintSparkIndexFactory metrics emission Signed-off-by: Simeon Widdis <[email protected]> * Update OS client to emit metrics Signed-off-by: Simeon Widdis <[email protected]> * Fix index kind detection Signed-off-by: Simeon Widdis <[email protected]> * Remove cumbersome with() method Signed-off-by: Simeon Widdis <[email protected]> * Revert the void change Signed-off-by: Simeon Widdis <[email protected]> * Make the code branchless Signed-off-by: Simeon Widdis <[email protected]> * Add default case to switches Signed-off-by: Simeon Widdis <[email protected]> * Apply PR feedback Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]>
Description
Success and failure metrics for spark index creation -- note that "failure" here means an execution failure (e.g. Spark couldn't execute the query), not validation failure (e.g. the index already exists).
E.g. success for creating a skipping index:
Related Issues
N/A
Check List
--signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.