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] Improve error message for getKibanaInfo #123521

Open
simianhacker opened this issue Jan 20, 2022 · 2 comments
Open

[Stack Monitoring] Improve error message for getKibanaInfo #123521

simianhacker opened this issue Jan 20, 2022 · 2 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Monitoring Stack Monitoring team

Comments

@simianhacker
Copy link
Member

The current error message from the getKibanaInfo() when Elasticsearch returns ZERO results is unhelpful; it will return this error message:

Monitoring Request Error Missing required parameter of field: timestamp: Missing required parameter of field: timestamp

This error doesn't indicate the real problem which is the query returned ZERO results. We should add a check to ensure there are results and when it fails we should return a meaningful error message like:

Monitoring Request Error: The query for Kibana state using "${clusterUuid}" cluster UUID and "${kibanaUuid}" Kibana UUID returned zero results. There needs to be at least one record returned for this query."

The offending code lives here:

const legacySource = hit?._source.kibana_stats;
const mbSource = hit?._source.kibana?.stats;
const availabilityTimestamp = hit?._source['@timestamp'] ?? legacySource?.timestamp;
if (!availabilityTimestamp) {
throw new MissingRequiredError('timestamp');
}

@simianhacker simianhacker added enhancement New value added to drive a business result Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Feature:Stack Monitoring labels Jan 20, 2022
@elasticmachine
Copy link
Contributor

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

@lucabelluccini
Copy link
Contributor

The problem affects any get_<product>_info. E.g. Logstash (

const availabilityTimestamp = mbStats?.timestamp ?? legacyStats?.timestamp;
).

The problem can be triggered by the presence of metricbeat-* indices with incorrect mappings, as Stack Monitoring queries .monitoring-*,metricbeat-* by default (monitoring.ui.metricbeat.indices allows to customize the set of Metricbeat indices to use).

To identify the problematic indices, one could run GET .monitoring-*,metricbeat-*/_mapping/field/timestamp and check if there are indices with such field and the type is not date.

@smith smith added Team:Monitoring Stack Monitoring team and removed Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Stack Monitoring Team:Monitoring Stack Monitoring team
Projects
None yet
Development

No branches or pull requests

4 participants