Skip to content

Commit

Permalink
tests/system: update metricset test
Browse files Browse the repository at this point in the history
  • Loading branch information
axw committed Jun 1, 2021
1 parent b0c4307 commit 61d66c2
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 2 deletions.
63 changes: 63 additions & 0 deletions docs/data/elasticsearch/generated/metricsets.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,69 @@
"name": "logged-in-user"
}
},
{
"@timestamp": "2017-05-30T18:53:41.366Z",
"_doc_count": 6,
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"ecs": {
"version": "1.8.0"
},
"event": {
"ingested": "2020-09-08T15:57:10.396695Z"
},
"host": {
"ip": "127.0.0.1"
},
"labels": {
"tag1": "one",
"tag2": 2
},
"latency_distribution": {
"counts": [
1,
2,
3
],
"values": [
1.1,
2.2,
3.3
]
},
"metricset.name": "app",
"observer": {
"ephemeral_id": "2f30050f-81e6-491a-a54f-e7d94eec17b5",
"hostname": "simmac.net",
"id": "02f6cb38-c1ce-4382-9478-4c8b4cdbda9c",
"type": "apm-server",
"version": "8.0.0",
"version_major": 8
},
"process": {
"pid": 1234
},
"processor": {
"event": "metric",
"name": "metric"
},
"service": {
"language": {
"name": "ecmascript"
},
"name": "1234_service-12a3",
"node": {
"name": "node-1"
}
},
"user": {
"email": "[email protected]",
"id": "axb123hg",
"name": "logged-in-user"
}
},
{
"@timestamp": "2017-05-30T18:53:42.281Z",
"agent": {
Expand Down
63 changes: 63 additions & 0 deletions tests/system/metricset.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,69 @@
"name": "logged-in-user"
}
},
{
"@timestamp": "2017-05-30T18:53:41.366Z",
"_doc_count": 6,
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"ecs": {
"version": "1.8.0"
},
"event": {
"ingested": "2020-09-08T15:57:10.396695Z"
},
"host": {
"ip": "127.0.0.1"
},
"labels": {
"tag1": "one",
"tag2": 2
},
"latency_distribution": {
"counts": [
1,
2,
3
],
"values": [
1.1,
2.2,
3.3
]
},
"metricset.name": "app",
"observer": {
"ephemeral_id": "2f30050f-81e6-491a-a54f-e7d94eec17b5",
"hostname": "simmac.net",
"id": "02f6cb38-c1ce-4382-9478-4c8b4cdbda9c",
"type": "apm-server",
"version": "8.0.0",
"version_major": 8
},
"process": {
"pid": 1234
},
"processor": {
"event": "metric",
"name": "metric"
},
"service": {
"language": {
"name": "ecmascript"
},
"name": "1234_service-12a3",
"node": {
"name": "node-1"
}
},
"user": {
"email": "[email protected]",
"id": "axb123hg",
"name": "logged-in-user"
}
},
{
"@timestamp": "2017-05-30T18:53:42.281Z",
"agent": {
Expand Down
6 changes: 4 additions & 2 deletions tests/system/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ def test_load_docs_with_template_and_add_error(self):
self.check_backend_error_sourcemap(index_error, count=4)

def test_load_docs_with_template_and_add_metricset(self):
self.load_docs_with_template(self.get_metricset_payload_path(), self.intake_url, 'metric', 4)
# NOTE(axw) this test is redundant with systemtest.TestApprovedMetrics,
# but we use the output of this test for generating documentation.
self.load_docs_with_template(self.get_metricset_payload_path(), self.intake_url, 'metric', 5)
self.assert_no_logged_warnings()

# compare existing ES documents for metricsets with new ones
metricset_docs = self.wait_for_events('metric', 4, index=index_metric)
metricset_docs = self.wait_for_events('metric', 5, index=index_metric)
self.approve_docs('metricset', metricset_docs)


Expand Down

0 comments on commit 61d66c2

Please sign in to comment.