Add slicing mode and fix operation-level reindex metrics#143415
Add slicing mode and fix operation-level reindex metrics#143415samxbr merged 16 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-distributed (Team:Distributed) |
PeteGillinElastic
left a comment
There was a problem hiding this comment.
Thanks Sam. This LGTM as it stands. But you have a merge conflict, and if that's with Szymon's change to implement relocation with slicing then I suspect that there might be some non-trivial work to be done in Reindexer to resolve it. (You already have a bunch of — unavoidably — fiddly stuff with multiply nested callbacks, and I have a nasty feeling that stuff has changed under you.) I think it's better if we hold off on approval until that's done.
Once you've dealt with the conflict, it might also be a good idea to ping Szymon and get him to look specifically at the changes to the callbacks in Reindexer as he probably knows that better than me.
modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexMetrics.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexMetrics.java
Outdated
Show resolved
Hide resolved
Yeah I did expect there will be some conflict with Szymon's PR. @szybia to have a look as well |
PeteGillinElastic
left a comment
There was a problem hiding this comment.
This LGTM, but I'd also like @szybia to weigh in.
...dex/src/internalClusterTest/java/org/elasticsearch/index/reindex/ReindexPluginMetricsIT.java
Show resolved
Hide resolved
szybia
left a comment
There was a problem hiding this comment.
initial review, haven't scanned tests yet 🚀
...t/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexRelocationIT.java
Show resolved
Hide resolved
...t/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexRelocationIT.java
Show resolved
Hide resolved
modules/reindex/src/main/java/org/elasticsearch/reindex/Reindexer.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexMetrics.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexerTests.java
Outdated
Show resolved
Hide resolved
modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexMetricsTests.java
Outdated
Show resolved
Hide resolved
szybia
left a comment
There was a problem hiding this comment.
looks great! thinking last batch of comments
modules/reindex/src/main/java/org/elasticsearch/reindex/Reindexer.java
Outdated
Show resolved
Hide resolved
...t/src/internalClusterTest/java/org/elasticsearch/reindex/management/ReindexRelocationIT.java
Show resolved
Hide resolved
| public static final String ATTRIBUTE_VALUE_SOURCE_LOCAL = "local"; | ||
| public static final String ATTRIBUTE_VALUE_SOURCE_REMOTE = "remote"; | ||
|
|
||
| public static final String ATTRIBUTE_NAME_SLICING_MODE = "es_reindex_slicing_mode"; |
There was a problem hiding this comment.
strikes me as a non-consistent name for an attribute, given the other names, look more like a metric name, thoughts?
| public static final String ATTRIBUTE_NAME_SLICING_MODE = "es_reindex_slicing_mode"; | |
| public static final String ATTRIBUTE_NAME_SLICING_MODE = "slicing_mode"; |
There was a problem hiding this comment.
Metric attribute names are validated in MetricValidator, es(_<segment>)+ is the recommended naming convention according to NAMING.md
There was a problem hiding this comment.
The validation and convention are introduced after the earlier reindex metrics, ideally we should migrate other metrics to the new convention too later
There was a problem hiding this comment.
Yeah, the es_ prefix is required now, as I discovered the hard way :-). The previous ones have been grandfathered in as exceptions in the validator, but we shouldn't add more.
We could probably drop the reindex though, as this thing is only used as an attributed to metrics with reindex in their names, i.e. es_slicing_mode?
There was a problem hiding this comment.
Always use es_ as the root segment to easily discover ES attributes. Follow with a module name, team or area of code, e.g. snapshot, repositories, indices, threadpool using existing terminology (whether singular and plural)
So according to their convention, es_reindex_slicing_mode feels a little bit better with a module/area of code prefix
There was a problem hiding this comment.
Always use es_ as the root
where is this written? (curious)
There was a problem hiding this comment.
Thanks for that quote Sam, I agree that including reindex makes sense. I wasn't going off any documentation, I was going off the exception that got thrown when I didn't have the es_ prefix and looking at the regex that was being enforced by that validation code.
There was a problem hiding this comment.
Always use es_ as the root
where is this written? (curious)
https://github.com/elastic/elasticsearch/blob/main/modules/apm/NAMING.md
modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexMetrics.java
Show resolved
Hide resolved
modules/reindex/src/test/java/org/elasticsearch/reindex/ReindexerTests.java
Outdated
Show resolved
Hide resolved
| public static final String ATTRIBUTE_VALUE_SOURCE_LOCAL = "local"; | ||
| public static final String ATTRIBUTE_VALUE_SOURCE_REMOTE = "remote"; | ||
|
|
||
| public static final String ATTRIBUTE_NAME_SLICING_MODE = "es_reindex_slicing_mode"; |
There was a problem hiding this comment.
Always use es_ as the root
where is this written? (curious)
Adds a
es_reindex_slicing_modedimension to existing reindex metrics to capture what type of slicing is being used. Also fixed the reindex metrics to be operation-level, meaning each API call to reindex will count as a single reindex metric. Reindex with multiple slices will only emit a single metric instead of one per slice.Closes #138258
Closes https://github.com/elastic/elasticsearch-team/issues/2375