Skip to content
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

[Metrics store] Add support for custom templates #1854

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ Metrics Records

At the end of a race, Rally stores all metrics records in its metrics store. Metrics can be kept in memory or written to a dedicated Elasticsearch cluster (not the cluster where Rally ran its benchmarks). This can be configured in the `[reporting] section <https://esrally.readthedocs.io/en/stable/configuration.html#reporting>`_.

Rally writes data to the following indices in the Elasticsearch metrics store:

* ``rally-races-*``: Contains the metadata of a benchmark. This is a subset of the metrics records but only contains the metadata of a benchmark.
* ``rally-metrics-*``: Contains all metrics records.
* ``rally-results-*``: Contains the results of a benchmark. This is a subset of the metrics records but only contains the final results of a benchmark.
* ``rally-annotations-*``: Contains annotations that can be added to a benchmark. This is a subset of the metrics records but only contains the annotations of a benchmark.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rally-annotations is a single alias of a single backing index. (ie rally-annotations -> reindexed-v7-rally-annotations ) I think we can remove the comment about the subset, as the documents itself just refer to chart names, rather than metrics themselves


Changing index settings, like number of shards and `ILM policies <https://www.elastic.co/guide/en/elasticsearch/reference/master/index-lifecycle-management.html#index-lifecycle-management>`_, can be performed by creating component templates matching the index template name with the ``@custom`` suffix. For example, to add an ILM policy named ``rally-metrics`` to ``rally-metrics-*`` indices, create a component template named ``rally-metrics@custom``:


PUT /_index_template/rally-metrics@custom
{
"template": {
"settings": {
"index.lifecycle.name": "rally-metrics"
}
}
}

Supported metrics store custom component template names:

* ``rally-races@custom``
* ``rally-metrics@custom``
* ``rally-results@custom``
* ``rally-annotations@custom``

Custom component templates with the ``@custom`` suffix will not be overwritten by Rally. Settings in custom component templates will override datastore shard settings in rally.ini.

Rally stores the metrics in the indices ``rally-metrics-*``. It will create a new index for each month. Here is a typical metrics record::


Expand Down
2 changes: 2 additions & 0 deletions esrally/resources/annotation-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"index_patterns": [
"rally-annotations"
],
"composed_of": ["rally-annotations@custom"],
"ignore_missing_component_templates": ["rally-annotations@custom"],
"template": {
"settings": {
"index": {}
Expand Down
2 changes: 2 additions & 0 deletions esrally/resources/metrics-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"index_patterns": [
"rally-metrics-*"
],
"composed_of": ["rally-metrics@custom"],
"ignore_missing_component_templates": ["rally-metrics@custom"],
"template": {
"settings": {
"index": {
Expand Down
2 changes: 2 additions & 0 deletions esrally/resources/races-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"index_patterns": [
"rally-races-*"
],
"composed_of": ["rally-races@custom"],
"ignore_missing_component_templates": ["rally-races@custom"],
"template": {
"settings": {
"index": {}
Expand Down
199 changes: 101 additions & 98 deletions esrally/resources/results-template.json
Original file line number Diff line number Diff line change
@@ -1,108 +1,111 @@
{
"index_patterns": ["rally-results-*"],
"index_patterns": [
"rally-results-*"
],
"composed_of": ["rally-results@custom"],
"ignore_missing_component_templates": ["rally-results@custom"],
"template": {
"settings": {
"index": {
}
},
"mappings": {
"date_detection": false,
"dynamic_templates": [
{
"strings": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
],
"_source": {
"enabled": true
"settings": {
"index": {}
},
"properties": {
"race-id": {
"type": "keyword"
},
"race-timestamp": {
"type": "date",
"format": "basic_date_time_no_millis",
"fields": {
"raw": {
"type": "keyword"
"mappings": {
"date_detection": false,
"dynamic_templates": [
{
"strings": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
},
"active": {
"type": "boolean"
},
"rally-version": {
"type": "keyword"
},
"rally-revision": {
"type": "keyword"
},
"environment": {
"type": "keyword"
},
"track": {
"type": "keyword"
},
"challenge": {
"type": "keyword"
},
"car": {
"type": "keyword"
},
"node-count": {
"type": "short"
},
"plugins": {
"type": "keyword"
},
"distribution-flavor": {
"type": "keyword"
},
"distribution-version": {
"type": "keyword"
},
"distribution-major-version": {
"type": "short"
},
"task": {
"type": "keyword"
},
"operation": {
"type": "keyword"
},
"job": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"value": {
"type": "object",
"properties": {
"single": {
"type": "double"
},
"min": {
"type": "double"
},
"mean": {
"type": "double"
},
"median": {
"type": "double"
},
"max": {
"type": "double"
],
"_source": {
"enabled": true
},
"properties": {
"race-id": {
"type": "keyword"
},
"race-timestamp": {
"type": "date",
"format": "basic_date_time_no_millis",
"fields": {
"raw": {
"type": "keyword"
}
}
},
"active": {
"type": "boolean"
},
"rally-version": {
"type": "keyword"
},
"rally-revision": {
"type": "keyword"
},
"environment": {
"type": "keyword"
},
"track": {
"type": "keyword"
},
"challenge": {
"type": "keyword"
},
"car": {
"type": "keyword"
},
"node-count": {
"type": "short"
},
"plugins": {
"type": "keyword"
},
"distribution-flavor": {
"type": "keyword"
},
"distribution-version": {
"type": "keyword"
},
"distribution-major-version": {
"type": "short"
},
"task": {
"type": "keyword"
},
"operation": {
"type": "keyword"
},
"job": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"value": {
"type": "object",
"properties": {
"single": {
"type": "double"
},
"min": {
"type": "double"
},
"mean": {
"type": "double"
},
"median": {
"type": "double"
},
"max": {
"type": "double"
}
}
}
}
}
}
}
}
}
Loading