Skip to content

Commit

Permalink
revert error handling changes (elastic#11650)
Browse files Browse the repository at this point in the history
  • Loading branch information
harnish-elastic authored Nov 28, 2024
1 parent 9a3cb85 commit 9ba56d9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions packages/mongodb_atlas/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.0.10"
changes:
- description: Fix single event object returned by evaluation error for hardware, process and disk data streams.
type: bugfix
link: https://github.com/elastic/integrations/pull/11650
- version: "0.0.9"
changes:
- description: MongoDB Atlas integration package with "disk" data stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ program: |
},
}).do_request().as(res, (res.StatusCode == 200) ?
{
"events": bytes(res.Body).decode_json().as(f,
"events": [bytes(res.Body).decode_json().as(f,
f.with(
{
"response": zip(
Expand All @@ -133,7 +133,7 @@ program: |
),
}
).drop(["measurements", "links"])
),
)],
"disk_list": (int(state.disk_next) + 1 < size(state.disk_list)) ? state.disk_list : [],
"disk_next": (int(state.disk_next) + 1 < size(state.disk_list)) ? (int(state.disk_next) + 1) : 0,
"disk_page_num": state.disk_page_num,
Expand All @@ -159,8 +159,8 @@ program: |
),
},
},
"want_more": false,
}
"want_more": false,
}
)
)
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ program: |
"Accept": ["application/vnd.atlas." + string(now.getFullYear()) + "-01-01+json"]
}
}).do_request().as(res, {
"events": bytes(res.Body).decode_json().as(f, f.with({"hardware": zip(
"events": [bytes(res.Body).decode_json().as(f, f.with({"hardware": zip(
//Combining measurement names and actual values of measurement to generate `key : value` pairs.
f.hardwareMeasurements.map(m, m.name),
f.hardwareMeasurements.map(m, m.dataPoints.map(d, d.value).as(v, size(v) == 0 ? null : v[0]))),
"status": zip(
f.statusMeasurements.map(m, m.name),
f.statusMeasurements.map(m, m.dataPoints.map(d, d.value).as(v, size(v) == 0 ? null : v[0])))}).drop(["hardwareMeasurements","statusMeasurements", "links"])),
f.statusMeasurements.map(m, m.dataPoints.map(d, d.value).as(v, size(v) == 0 ? null : v[0])))}).drop(["hardwareMeasurements","statusMeasurements", "links"]))],
"hostlist": (int(state.next)+1) < size(state.hostlist) ? state.hostlist : [],
"next": (int(state.next)+1) < size(state.hostlist) ? (int(state.next)+1) : 0,
"want_more": (int(state.next)+1) < size(state.hostlist) || state.page_num != 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ program: |
"Accept": ["application/vnd.atlas." + string(now.getFullYear()) + "-01-01+json"]
}
}).do_request().as(res, {
"events": bytes(res.Body).decode_json().as(f, f.with({"response": zip(
"events": [bytes(res.Body).decode_json().as(f, f.with({"response": zip(
//Combining measurement names and actual values of measurement to generate `key : value` pairs.
f.measurements.map(m, m.name),
f.measurements.map(m, m.dataPoints.map(d, d.value).as(v, size(v) == 0 ? null : v[0]))
)}).drop(["measurements", "links"])),
)}).drop(["measurements", "links"]))],
"hostlist": (int(state.next)+1) < size(state.hostlist) ? state.hostlist : [],
"next": (int(state.next)+1) < size(state.hostlist) ? (int(state.next)+1) : 0,
"want_more": (int(state.next)+1) < size(state.hostlist) || state.page_num != 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb_atlas/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 3.0.3
name: mongodb_atlas
title: "MongoDB Atlas"
version: 0.0.9
version: 0.0.10
source:
license: "Elastic-2.0"
description: This Elastic integration collects logs and metrics from MongoDB Atlas instance.
Expand Down

0 comments on commit 9ba56d9

Please sign in to comment.