-
Notifications
You must be signed in to change notification settings - Fork 56
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
ElasticSearch Unified Index #288
Comments
I think that this discussion becomes even more important with #298 and #296. Right now we are exporting a flat-JSON document, which is fine for now, but should we think about revisiting this since we are adding more fields? Thoughts? |
Elasticsearch is built on top of Lucene, which stores data in an inverted index. Simply put, Lucene maps terms -> documents instead of documents -> terms. Lucene doesn't really support nesting as it only supports numeric, binary, and text fields. ES does a lot of optimizations on top of Lucene to support nesting but I'm not sure about the index/search performance of them as I've only ever used Solr. But in general I would default to not nesting given the base technology ES uses (to a point). ES has some guidelines on doc structure which is generally pretty solid. I think we should start here and look at defining the common I think of the common I think every common The counter to that is when fields may or may not exist doc to doc, or are specific to the environment/benchmark. For instance not every snafu run may be running in k8s, so cluster_name, etc. may not be collected. For those we don't necessarily want them to be flat because we want a uniform root doc structure for better readability and also indexing. Given that I think we can afford to nest somewhat. I think a good starting schema would look something like this: {
"uuid": "str",
"run_id": "str",
"start_time": "datetime",
"end_time": "datetime",
"duration": "Number",
"type": "string",
"iteration": "Number",
"kubernetes": {
"cluster_version": "str"
},
"openshift": {
"cluster_version": "str",
"cluster_name": "str",
"platform": "str",
"network_type": "str"
},
"config": {
"foo": "bar"
},
"data": {
"foo": "bar"
}
} Where |
I like that structure, and I think you have a really good point about modeling after ECS. I think it might be worth doing something like this: {
"uuid": "str",
"run_id": "str",
"start_time": "datetime",
"end_time": "datetime",
"duration": "Number",
"type": "string",
"iteration": "Number",
"environment": "flattened",
"config": "flattened",
"data": "flattened
} If we create an environment key in the root and take advantage of the flattened data type then we don't have to worry so much about the structure of the document in order to have successful searches. At least, that's my understanding but I could be wrong. |
Tracking creating a unified template for Elasticsearch indices, with proper datatypes and defaults for each of our fields. Essentially the question that we want to answer here is: how do we transform a
BenchmarkResult
dataclass into JSON?The text was updated successfully, but these errors were encountered: