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

[Stack Monitoring] health api support for data ingested from package #138964

Merged
merged 11 commits into from
Sep 6, 2022

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Aug 17, 2022

Summary

Closes #138864

Add support for data ingested from packages in the metrics-{product}.* patterns.

This change only fetches the data for the successfully monitored products, but we can also retrieve the errors like we do for metricbeat since an error.message may be populated on failure. This will be handled in elastic/integrations#4011

Testing

  • setup a stack with an agent - you can follow the testing steps for the logstash package in [logstash] align mappings with metricbeat integrations#3993 to start an elastic-package stack with elasticsearch and logstash data
  • connect your local kibana to the elastic-package elasticsearch - howto
  • hit localhost:5602/api/monitoring/v1/_health - a monitored cluster should show up with cluster, elasticsearch and logstash data collected with the package method

@klacabane klacabane self-assigned this Aug 17, 2022
@klacabane klacabane added release_note:enhancement Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.5.0 labels Aug 17, 2022
Comment on lines 12 to 13
getNewIndexPatterns,
getLegacyIndexPattern,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Took the opportunity to reuse the functions used to build the patterns throughout the server code

@klacabane klacabane marked this pull request as ready for review August 17, 2022 01:10
@klacabane klacabane requested a review from a team as a code owner August 17, 2022 01:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@matschaffer
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

I tried using your profile from elastic/integrations#4018 then running this branch against it. Since I don't think this branch supports metrics-* for the regular UI I then enabled internal collection, but so far I'm only seeing internal-collection data in the health api. Nothing agent based yet.

GET http://localhost:5602/ftw/api/monitoring/v1/_health
{
  "monitoredClusters": {
    "clusters": {
      "0pMSN574ShOT3UQkRDRHxg": {
        "cluster": {
          "0pMSN574ShOT3UQkRDRHxg": {
            "index_summary": {
              "internal-monitoring": {
                "index": ".monitoring-es-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:15.108Z"
              }
            },
            "index_recovery": {
              "internal-monitoring": {
                "index": ".monitoring-es-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:15.111Z"
              }
            },
            "index": {
              "internal-monitoring": {
                "index": ".monitoring-es-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:15.108Z"
              }
            },
            "cluster_stats": {
              "internal-monitoring": {
                "index": ".monitoring-es-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:15.099Z"
              }
            }
          }
        },
        "elasticsearch": {
          "6TyLurl-R3ChzhNEa2u8zw": {
            "node_stats": {
              "internal-monitoring": {
                "index": ".monitoring-es-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:15.061Z"
              }
            },
            "shard": {
              "internal-monitoring": {
                "index": ".monitoring-es-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:15.108Z"
              }
            }
          }
        },
        "kibana": {
          "71916d11-34bc-451d-b87e-f9ff2fb1137c": {
            "stats": {
              "internal-monitoring": {
                "index": ".monitoring-kibana-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:22.268Z"
              }
            }
          },
          "5b2de169-2785-441b-ae8c-186a1936b17d": {
            "stats": {
              "internal-monitoring": {
                "index": ".monitoring-kibana-7-2022.09.06",
                "lastSeen": "2022-09-06T09:13:23.866Z"
              }
            }
          }
        }
      },
      "standalone": {
        
      }
    },
    "execution": {
      "timedOut": false,
      "errors": [
        
      ]
    }
  },
  "metricbeatErrors": {
    "products": {
      
    },
    "execution": {
      "timedOut": false,
      "errors": [
        
      ]
    }
  },
  "settings": {
    "ccs": true,
    "logsIndex": "filebeat-*",
    "metricbeatIndex": "metricbeat-*",
    "hasRemoteClusterConfigured": false
  }
}

Maybe we can toss it around in our 1:1

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @klacabane

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

We paired up on this and that last commit should have things working nicely!

@klacabane klacabane merged commit ee07b1e into elastic:main Sep 6, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 6, 2022
Mpdreamz pushed a commit to Mpdreamz/kibana that referenced this pull request Sep 6, 2022
…lastic#138964)

* query for data_stream datasets

* support package collection mode

* build index with metrics pattern

* trailing comma

* use getNewIndexPatterns everywhere

* Include new stack_monitoring infix in healthcheck dataset name

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mat Schaffer <mat@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack monitoring] Add data stream patterns to monitoring health endpoint
6 participants