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

strconv.ParseInt: parsing "null": invalid syntax when calling datadog.NewClient(apiKey, appKey).GetMonitors() #135

Closed
DSh3p4rd opened this issue Nov 15, 2017 · 7 comments

Comments

@DSh3p4rd
Copy link

DSh3p4rd commented Nov 15, 2017

Sorry to be brief, I'm not getting back much insight to the problem from the error message.

I've verified the api and app keys are correct and I'm using the latest version of the library pulled via go get github.com/zorkian/go-datadog-api

@ojongerius
Copy link
Collaborator

@DSh3p4rd hey there, sorry for the long wait.

Would you be able to provide a config to reproduce this?

@gwellington
Copy link

gwellington commented Nov 27, 2017

Hey @ojongerius I seem to be running into the same issue as well. The configs that we had for a monitor were:

{
	"name": "some spiffy name",
	"type": "metric alert",
	"query": "min(last_5m):min:thisapp.health{app:someservice,type:monitor,stack:awesomestack} by {job} < 1",
	"message": "hey guys, fix this @some-team",
	"tags": [
		"app:sometag",
		"type:monitor",
		"somedashboard",
		"service:someservice",
		"service:anotherservice",
		"service:someservice.fqdn",
		"service:team"
	],
	"options": {
		"notify_audit": false,
		"locked": false,
		"timeout_h": 0,
		"new_host_delay": 300,
		"require_full_window": false,
		"notify_no_data": false,
		"renotify_interval": "0",
		"evaluation_delay": "",
		"escalation_message": "",
		"no_data_timeframe": null,
		"include_tags": false,
		"thresholds": {
			"critical": 1
		}
	}
}

The config creates fine, but we started running into this issue when I changed the message of the monitor to notify another team. Once the monitor was changed manually, the call to GetMonitors started breaking. The only way to fix it was to delete the monitor and to let our systems programmatically recreate them again.

@ojongerius
Copy link
Collaborator

Cheers @gwellington I might have some time this Friday, if anyone else is keen to pick this up, by all means go ahead 😄

@bluekeyes
Copy link

It looks like this issue was probably fixed by #129, which added a specific check for null before calling strconv.ParseInt. I'll try updating our project to use master instead of the last release and see if I can confirm.

@ojongerius
Copy link
Collaborator

@bluekeyes any luck verifying?

@bluekeyes
Copy link

Yes, updating to master back in November fixed the issue in our project, so this should be resolved in the latest releases.

@ojongerius
Copy link
Collaborator

Thanks @bluekeyes !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants