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

Influxdb: error when no data returned #23

Closed
rozetko opened this issue Sep 24, 2018 · 1 comment
Closed

Influxdb: error when no data returned #23

rozetko opened this issue Sep 24, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rozetko
Copy link
Member

rozetko commented Sep 24, 2018

Currently you get error when no data for given range is returned in InfluxdbMetric

image

Guess it would be better to do like in GraphiteMetric:

if(res.data !== undefined && res.data.length < 1) {
  console.log('datasource return empty response, no data');
  return {
    columns: ['timestamp', 'target'],
    values: []
  };
}

@amper43 @jonyrock what do you think? Should we handle it? Maybe it should be handled by lib user?

@rozetko rozetko added the bug Something isn't working label Sep 24, 2018
@rozetko rozetko self-assigned this Sep 24, 2018
@jonyrock
Copy link
Member

@rozetko I don`t like how it is made in prometheus.

if(res.data === undefined) {
  throw new Error('undefined error');
}

and then continue

Please think for a second, what you gonna do if res.data IS undefined?

@rozetko rozetko assigned amper43 and unassigned rozetko Sep 25, 2018
sblrok added a commit that referenced this issue Sep 25, 2020
sblrok added a commit that referenced this issue Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants