Skip to content
Draft
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
6 changes: 6 additions & 0 deletions packages/rubrik/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# newer versions go on top
- version: "0.9.2"
changes:
- description: |
Fix CEL program for Tasks data stream to parse long values.
type: bugfix
link: https://github.com/elastic/integrations/pull/15909
- version: "0.9.1"
changes:
- description: |
Expand Down
83 changes: 47 additions & 36 deletions packages/rubrik/data_stream/tasks/agent/stream/cel.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -120,43 +120,54 @@ program: |-
}
}.encode_json(),
}
).do_request().as(resp, (resp.StatusCode == 200) ?
bytes(resp.Body).decode_json().as(body,
).do_request().as(resp,(resp.StatusCode == 200) ?
bytes(resp.Body).decode_json().as(body,
{
"events": body.data.reportChartData.chartData.map(chartDataNode,
chartDataNode.secondaryGroupBy.map(childNode,
childNode.with({
"numVal": (
childNode.value.has("longValue") ? childNode.value.longValue :
(childNode.value.has("intValue") ? childNode.value.intValue :
(childNode.value.has("serializedValue") ?
int(childNode.value.serializedValue) : 0
)
)
)
}).as(v,
{
"slaDomainId": v.name.serializedValue,
"slaDomainName": v.name.displayValue,
"succeededTasksValue": chartDataNode.name.serializedValue == "succeeded_tasks" ? v.numVal : null,
"failedTasksValue": chartDataNode.name.serializedValue == "failed_tasks" ? v.numVal : null,
"canceledTasksValue": chartDataNode.name.serializedValue == "canceled_tasks" ? v.numVal : null,
"missedTasksValue": chartDataNode.name.serializedValue == "missed_tasks" ? v.numVal : null,
"metricType": chartDataNode.name.serializedValue
}
)
)
).flatten().map(event, { "message": event.encode_json() }),
"want_more": int(state.index) < (size(state.queries) - 1),
"queries": state.queries,
"index": (int(state.index) + 1) % size(state.queries)
}
)
:
{
"events": body.data.reportChartData.chartData.map(chartDataNode,
chartDataNode.secondaryGroupBy.map(childNode,
{
"slaDomainId": childNode.name.serializedValue,
"slaDomainName": childNode.name.displayValue,
"succeededTasksValue": chartDataNode.name.serializedValue == "succeeded_tasks" ? childNode.value.intValue : null,
"failedTasksValue": chartDataNode.name.serializedValue == "failed_tasks" ? childNode.value.intValue : null,
"canceledTasksValue": chartDataNode.name.serializedValue == "canceled_tasks" ? childNode.value.intValue : null,
"missedTasksValue": chartDataNode.name.serializedValue == "missed_tasks" ? childNode.value.intValue : null,
"metricType": chartDataNode.name.serializedValue
}
)
).flatten().map(event, { "message": event.encode_json() }),
"want_more": int(state.index) < (size(state.queries) - 1),
"queries": state.queries,
"index": (int(state.index) + 1) % size(state.queries)
}
)
:
{
"events": {
"error": {
"code": string(resp.StatusCode),
"id": string(resp.Status),
"message": "POST:" +
(
(size(resp.Body) != 0) ?
string(resp.Body)
:
string(resp.Status) + " (" + string(resp.StatusCode) + ")"
),
"events": {
"error": {
"code": string(resp.StatusCode),
"id": string(resp.Status),
"message": "POST:" +
(
(size(resp.Body) != 0) ?
string(resp.Body)
:
string(resp.Status) + " (" + string(resp.StatusCode) + ")"
),
},
},
},
"want_more": false,
}
"want_more": false,
}
)
)
2 changes: 1 addition & 1 deletion packages/rubrik/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 3.0.2
name: rubrik
title: "Rubrik RSC Metrics"
version: 0.9.1
version: 0.9.2
source:
license: "Elastic-2.0"
description: "Collect Metrics from Rubrik RSC with Elastic Agent."
Expand Down