-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.15](backport #40836) [metricbeat] meraki module with device_health…
… metricset (#40862) * [metricbeat] meraki module with device_health metricset (#40836) * inital meraki module and metricsets * initial refactor for single meraki metricset device_health * added tunnel support aka VPN support by Device * adding interfaces aka switch ports and switch port status * processing review comments * refactored for comments * fixing default metricset * Removing unused variables and adding text to required variables * add go module deps * fixing for loop and starting on fields yml * remove %d from loop condition * fixing review comments and loss latency * update dashboard-api lib to version with MIT licensed ratelimiter * remove unused fields in metricset struct * remove device details for now * Major refactor to improve overall readability and device status/metric associations. This commit removes a couple of data points from the original code, namely: - network appliance port settings - these settings are not defined per-device, but per-network, and as such don't fit into the current naming taxonomy. - site-to-site VPN settings - similarly to the above, these are not per-device attibutes. In addition there is a limitation included on including only a single metric bucket (as returned from the API) per metricbeat collection loop. There needs to be some better logging/config validation on this, which will come later; for now, just run with a maximum 5 minute collection interval. This commit includes the field mappings too, but it currently causes events to get dropped due to the index field limit getting hit (max 10k fields). You can get around this by setting 'setup.template.settings.index.mapping.total_fields.limit' to a higher value. We maybe can't include all these mappings in the metricbeat module, but for now they are here to allow testing with standalone metricbeat. * Add maximum collection interval check to avoid missing uplink loss and latency metrics. Remove 'percent' units, because the data does not fit the 0-1 elastic interpretation of percent. * revert accidental changes to reference config * add example in data.json * review comments: license headers, missing/incorrect mapping * result of 'go mod tidy' ... trying to unblock the CI builds * fix linter issues * update NOTICE.txt * add release tag to fields.yml, update docs * review feedback: keyword -> dat * commit results of 'make update' in x-pack metricbeat for CI * remove mappings to avoid hitting field limits in global metricbeat index template * add one field back to please the docs CI * more linter errors guarding against shared loop var pointers * fix error introduced in previous commit * add exception for golangci-lint G601 which is no longer required in go1.22+ * remove the guards against taking addresses of loop vars * i can't get the golanglint-ci config to get picked up, so i'm reverting that change and putting back the annoying index loop code * Update go.mod to match toolchain version to .go-version Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co> --------- Co-authored-by: Dan Hiebert <dan@semplicityinc.com> Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co> (cherry picked from commit ae71c67) # Conflicts: # NOTICE.txt # go.mod # go.sum # x-pack/metricbeat/metricbeat.reference.yml * fix go.mod merge conflict * fix merge errors in NOTICE.txt * fix merge errors in metricbeat.reference.yml * add result of running 'mage update' --------- Co-authored-by: Tom Myers <106530686+tommyers-elastic@users.noreply.github.com>
- Loading branch information
1 parent
16c6d9c
commit 31e3a2c
Showing
23 changed files
with
1,395 additions
and
77 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//// | ||
This file is generated! See scripts/mage/docs_collector.go | ||
//// | ||
|
||
:modulename: meraki | ||
:edit_url: https://github.com/elastic/beats/edit/main/x-pack/metricbeat/module/meraki/_meta/docs.asciidoc | ||
|
||
|
||
[[metricbeat-module-meraki]] | ||
[role="xpack"] | ||
== Cisco Meraki module | ||
|
||
beta[] | ||
|
||
This is the meraki module. | ||
|
||
|
||
|
||
:edit_url: | ||
|
||
[float] | ||
=== Example configuration | ||
|
||
The Cisco Meraki module supports the standard configuration options that are described | ||
in <<configuration-metricbeat>>. Here is an example configuration: | ||
|
||
[source,yaml] | ||
---- | ||
metricbeat.modules: | ||
- module: meraki | ||
metricsets: ["device_health"] | ||
enabled: true | ||
period: 300s | ||
apiKey: "Meraki dashboard API key" | ||
organizations: ["Meraki organization ID"] | ||
---- | ||
|
||
[float] | ||
=== Metricsets | ||
|
||
The following metricsets are available: | ||
|
||
* <<metricbeat-metricset-meraki-device_health,device_health>> | ||
|
||
include::meraki/device_health.asciidoc[] | ||
|
||
:edit_url!: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//// | ||
This file is generated! See scripts/mage/docs_collector.go | ||
//// | ||
:edit_url: https://github.com/elastic/beats/edit/main/x-pack/metricbeat/module/meraki/device_health/_meta/docs.asciidoc | ||
|
||
|
||
[[metricbeat-metricset-meraki-device_health]] | ||
[role="xpack"] | ||
=== Cisco Meraki device_health metricset | ||
|
||
beta[] | ||
|
||
include::../../../../x-pack/metricbeat/module/meraki/device_health/_meta/docs.asciidoc[] | ||
|
||
|
||
:edit_url: | ||
|
||
==== Fields | ||
|
||
For a description of each field in the metricset, see the | ||
<<exported-fields-meraki,exported fields>> section. | ||
|
||
Here is an example document generated by this metricset: | ||
|
||
[source,json] | ||
---- | ||
include::../../../../x-pack/metricbeat/module/meraki/device_health/_meta/data.json[] | ||
---- | ||
:edit_url!: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- module: meraki | ||
metricsets: ["device_health"] | ||
enabled: true | ||
period: 300s | ||
apiKey: "Meraki dashboard API key" | ||
organizations: ["Meraki organization ID"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This is the meraki module. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- key: meraki | ||
title: Cisco Meraki | ||
release: beta | ||
fields: | ||
- name: meraki | ||
type: group | ||
fields: |
Oops, something went wrong.