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

Projects
None yet
4 participants
@DSh3p4rd

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

This comment has been minimized.

Collaborator

ojongerius commented Nov 22, 2017

@DSh3p4rd hey there, sorry for the long wait.

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

@gwellington

This comment has been minimized.

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

This comment has been minimized.

Collaborator

ojongerius commented Nov 28, 2017

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

@bluekeyes

This comment has been minimized.

bluekeyes commented Nov 30, 2017

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

This comment has been minimized.

Collaborator

ojongerius commented Mar 11, 2018

@bluekeyes any luck verifying?

@bluekeyes

This comment has been minimized.

bluekeyes commented Mar 11, 2018

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

@ojongerius

This comment has been minimized.

Collaborator

ojongerius commented Mar 11, 2018

Thanks @bluekeyes !

@ojongerius ojongerius closed this Mar 11, 2018

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