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

tests/system: update metricset test #5390

Merged
merged 1 commit into from
Jun 1, 2021
Merged
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
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