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

Sql Server input - improve error message with server and query #7559

Closed
Trovalo opened this issue May 21, 2020 · 3 comments
Closed

Sql Server input - improve error message with server and query #7559

Trovalo opened this issue May 21, 2020 · 3 comments

Comments

@Trovalo
Copy link
Collaborator

Trovalo commented May 21, 2020

Feature Request

The idea is to improve the error messages outputted by Telegraf.

Proposal:

It would be very handy to have two additional information in the error message (when appropriate):

  • Server (SQL Server instance) - the instance in which the error occurred
  • Query - the query that was running (the name written in the config file, ie: Schedulers, PerfCounters)

Current behavior:

In most cases when you receive an error (and you are monitoring more than one instance) you are just blind about where the error happened.

Some examples of the actual behavior:

  • permission errors, the message is something like "login failed for user xxx" but SQL server itself does not tell you in which instance it happened
  • Query related error, in those cases you just see a section of the SQL query, of course, you can search in the code for that bit, but it can be generic, and anyway, you don't know in which instance it happened.

other errors already report the SQL instance who raised them (because the info is contained in the SQL Server error itself), like connection errors and point parsing error (if they show you the point who caused the error you can look at the "sql_instance" tag value)

The current error message look like this:
_timestamp_ E! [input.sqlserver] Error in plugin: _errorMessage_
Desired message
_timestamp_ E! [input.sqlserver] Error in plugin: Error on _SqlInstance_ while executing query _queryName_ : _errorMessage_

Desired behavior:

The error message includes the Sql instance who raised the error and the query (when appropriate)

Use case:

It will make error tracking way simpler when monitoring more than one instance

@Trovalo
Copy link
Collaborator Author

Trovalo commented May 28, 2020

@danielnelson what do you think about this?

@denzilribeiro
Copy link
Contributor

denzilribeiro commented Aug 16, 2020

I have addressed part of this aka the "Collector" part ( not the instance part) in #7934 . The instance part have to think about as didn't have instance name stored anywhere so has to be extracted from connections string. I didn's see this before made the changes. I agree adding instance at some point would be good too - specially for stuff like login failed :) shich is painful to figure out if have a bunch of connection strings.

This is what would look like
[input.sqlserver] Error in plugin: CollectorName : errorMessage

@Trovalo
Copy link
Collaborator Author

Trovalo commented Oct 27, 2020

This has been partially fixed also by the query formatting. In case of errors relate to the SQL version an error is returned, which contains also the Instance name

@Trovalo Trovalo closed this as completed Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants