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

[Metricbeat][Kubernetes] Extend state_node with more conditions #23905

Merged
merged 3 commits into from
Feb 16, 2021

Conversation

ioandr
Copy link
Contributor

@ioandr ioandr commented Feb 8, 2021

What does this PR do?

This PR extends the state_node module of the Metricbeat's Kubernetes module with more status conditions, such as MemoryPressure, DiskPressure, OutOfDisk and PIDPressure.

Refactor the opFilter Prometheus metric helper to allow the declaration of multiple Metricbeat fields from a single Prometheus metric, based on allowed label values.

Why is it important?

Adding more status conditions of Kubernetes nodes is useful for monitoring and alerting purposes as it allows one to use conditions like:

  • Is any node running out of memory?
  • Is any node running out of disk?
  • Is any node running out of PIDs?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Use cases

Screenshots

Logs

2021-02-08T12:34:38.470+0200    DEBUG   [processors]    processing/processors.go:203    Publish event: {                                                                                                                                      
  "@timestamp": "2021-02-08T10:34:38.307Z",                                                                                                                                                                                                   
  "@metadata": {                                                                                                                                                                                                                              
    "beat": "metricbeat",                                                                                                                                                                                                                     
    "type": "_doc",                                                                                                                                                                                                                           
    "version": "8.0.0"                                                                                                                                                                                                                        
  },                                                                                                                                                                                                                                          
  "event": {                                                                                                                                                                                                                                  
    "module": "kubernetes",                                                                                                                                                                                                                   
    "duration": 162891130,                                                                                                                                                                                                                    
    "dataset": "kubernetes.node"                                                                                                                                                                                                              
  },                                                                                                                                                                                                                                          
  "kubernetes": {                                                                                                                                                                                                                             
    "node": {                                                                                                                                                                                                                                 
      "name": "node1",                                                                                                                                                                                                                      
      "status": {                                                                                                                                                                                                                             
        "unschedulable": false,                                                                                                                                                                                                               
        "memorypressure": "false",                                                                                                                                                                                                            
        "diskpressure": "false",                                                                                                                                                                                                              
        "pidpressure": "false",                                                                                                                                                                                                               
        "ready": "true"                                                                                                                                                                                                                       
      }                                                                                                                                                                                                                                       
    }                                                                                                                                                                                                                                         
  },                                                                                                                                                                                                                                          
  "ecs": {                                                                                                                                                                                                                                    
    "version": "1.7.0"                                                                                                                                                                                                                        
  },  
...

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 8, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 8, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #23905 updated

  • Start Time: 2021-02-16T11:32:32.416+0000

  • Duration: 53 min 32 sec

  • Commit: e5019eb

Test stats 🧪

Test Results
Failed 0
Passed 8658
Skipped 2122
Total 10780

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 8658
Skipped 2122
Total 10780

@ChrsMark ChrsMark self-requested a review February 8, 2021 11:29
@ChrsMark ChrsMark removed their assignment Feb 8, 2021
@ChrsMark ChrsMark added the Team:Integrations Label for the Integrations team label Feb 8, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 8, 2021
@ChrsMark ChrsMark added needs_team Indicates that the issue/PR needs a Team:* label review labels Feb 8, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 8, 2021
@botelastic
Copy link

botelastic bot commented Feb 8, 2021

This pull request doesn't have a Team:<team> label.

@ChrsMark ChrsMark added kubernetes Enable builds in the CI for kubernetes v7.12.0 labels Feb 8, 2021
@ChrsMark
Copy link
Member

ChrsMark commented Feb 8, 2021

/test

@ioandr ioandr force-pushed the feature-state-node-conditions branch from 71482ce to 21f4b0e Compare February 8, 2021 19:44
@ioandr ioandr force-pushed the feature-state-node-conditions branch from 21f4b0e to 848efcc Compare February 8, 2021 21:08
@ioandr ioandr force-pushed the feature-state-node-conditions branch from 7cf36a7 to 3695892 Compare February 8, 2021 21:14
@ioandr ioandr force-pushed the feature-state-node-conditions branch from 3695892 to cf8a815 Compare February 8, 2021 21:17
@ioandr ioandr force-pushed the feature-state-node-conditions branch from 4017267 to 72ca845 Compare February 8, 2021 21:22
@ioandr ioandr force-pushed the feature-state-node-conditions branch from 72ca845 to f648d86 Compare February 8, 2021 21:33
@ioandr ioandr marked this pull request as ready for review February 8, 2021 21:34
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@ChrsMark
Copy link
Member

ChrsMark commented Feb 9, 2021

/test

Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this @ioandr! LGTM

@ChrsMark ChrsMark added the test-plan Add this PR to be manual test plan label Feb 9, 2021
@ChrsMark
Copy link
Member

ChrsMark commented Feb 9, 2021

@jsoriano do you want to have a look too?

@jsoriano jsoriano added the needs_backport PR is waiting to be backported to other branches. label Feb 15, 2021
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👌

@ioandr ioandr force-pushed the feature-state-node-conditions branch from f648d86 to 98cd81b Compare February 16, 2021 10:44
@jsoriano
Copy link
Member

There are some linting failures, @ioandr try to run mage update inside the metricbeat and x-pack/metricbeat directories, and commit the changes.

Signed-off-by: chrismark <[email protected]>
@ChrsMark
Copy link
Member

Did the update so as to unblock it, @ioandr no need to run it again. Let's see if CI is happy and we can merge this one.

@ChrsMark ChrsMark merged commit 125c29d into elastic:master Feb 16, 2021
ChrsMark pushed a commit to ChrsMark/beats that referenced this pull request Feb 16, 2021
@ChrsMark ChrsMark removed the needs_backport PR is waiting to be backported to other branches. label Feb 16, 2021
v1v added a commit to v1v/beats that referenced this pull request Feb 16, 2021
…-arm

* upstream/master:
  [Metricbeat][Kubernetes] Extend state_node with more conditions (elastic#23905)
  [CI] googleStorageUploadExt step (elastic#24048)
  Check fields are documented for aws metricsets (elastic#23887)
  Update go-concert to 0.1.0 (elastic#23770)
  [Libbeat][New Processor] XML Decode (elastic#23678)
  Fix: bad substitution of API key (elastic#24036)
  [Filebeat] Add Pensando DFW Module (elastic#21063)
  [Filebeat] Check if processor is supported by ES version (elastic#23763)
  Syslog system tests: be more forgiving (elastic#24021)
ChrsMark added a commit that referenced this pull request Feb 16, 2021
…) (#24057)

(cherry picked from commit 125c29d)

Co-authored-by: Ioannis Androulidakis <[email protected]>
v1v added a commit to v1v/beats that referenced this pull request Feb 17, 2021
…dows-7

* upstream/master: (332 commits)
  Use ECS v1.8.0 (elastic#24086)
  Add support for postgresql csv logs (elastic#23334)
  [Heartbeat] Refactor config system (elastic#23467)
  [CI] install docker-compose with retry (elastic#24069)
  Add nodes to filebeat-kubernetes.yaml ClusterRole - fixes elastic#24051 (elastic#24052)
  updating manifest files for filebeat threatintel module (elastic#24074)
  Add Zeek Signatures (elastic#23772)
  Update Beats to ECS 1.8.0 (elastic#23465)
  Support running Docker logging plugin on ARM64 (elastic#24034)
  Fix ec2 metricset fields.yml and add integration test (elastic#23726)
  Only build targz and zip versions of Beats if PACKAGES is set in agent (elastic#24060)
  [Filebeat] Add field definitions for known Netflow/IPFIX vendor fields (elastic#23773)
  [Elastic Agent] Enroll with Fleet Server (elastic#23865)
  [Filebeat] Convert logstash logEvent.action objects to strings (elastic#23944)
  [Ingest Management] Fix reloading of log level for services (elastic#24055)
  Add Agent standalone k8s manifest (elastic#23679)
  [Metricbeat][Kubernetes] Extend state_node with more conditions (elastic#23905)
  [CI] googleStorageUploadExt step (elastic#24048)
  Check fields are documented for aws metricsets (elastic#23887)
  Update go-concert to 0.1.0 (elastic#23770)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kubernetes Enable builds in the CI for kubernetes review Team:Integrations Label for the Integrations team test-plan Add this PR to be manual test plan v7.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metricbeat] Add support for node conditions to state_node metricset
4 participants