This repository was archived by the owner on May 15, 2025. It is now read-only.
Change default config file and verbosity of log#3
Open
stuxboulot wants to merge 2 commits intoContentSquare:masterfrom
Open
Change default config file and verbosity of log#3stuxboulot wants to merge 2 commits intoContentSquare:masterfrom
stuxboulot wants to merge 2 commits intoContentSquare:masterfrom
Conversation
Fix ContentSquare#1 and ContentSquare#2 build default config path from user.path Change message logs verbosity
change format of file
vfoucault
suggested changes
Apr 18, 2019
Contributor
vfoucault
left a comment
There was a problem hiding this comment.
I'm not sure this is working as expected.
Could you double check your PR
| if response.Id == 0 { | ||
| // no id in response | ||
| log.Fatalf("error sending annotation. Message is %v", response.Message) | ||
| log.Info("Sending annotation. Message is ", response.Message) |
Contributor
There was a problem hiding this comment.
Shouldn't we fail whenever there is no id, meaning no message ?
Author
There was a problem hiding this comment.
With my grafana (4.6.3) version i always have Id =0
[14:34:53] p096083@gcf-dev-appv3:~ $ ./grafana-annotation -config-file ~/.grafana-anotation-poster.yml -tag testjio
grafana-annotation 2019/04/18 14:35:11 [INFO] ▶ response Status:200 OK
grafana-annotation 2019/04/18 14:35:11 [INFO] ▶ response Headers:map[Content-Type:[application/json] Date:[Thu, 18 Apr 2019 12:34:59 GMT] Content-Length:[39]]
grafana-annotation 2019/04/18 14:35:11 [CRIT] ▶ error sending annotation. Message is Graphite annotation added
[14:35:11] p096083@gcf-dev-appv3:~ $ ./grafana-annotation -config-file ~/.grafana-anotation-poster.yml -tag testjio
grafana-annotation 2019/04/18 14:37:07 [INFO] ▶ response Status:200 OK
grafana-annotation 2019/04/18 14:37:07 [INFO] ▶ response Headers:map[Content-Length:[39] Content-Type:[application/json] Date:[Thu, 18 Apr 2019 12:36:55 GMT]]
grafana-annotation 2019/04/18 14:37:07 [CRIT] ▶ error sending annotation. Message is Graphite annotation added
[14:37:07] p096083@gcf-dev-appv3:~ $ ./grafana-annotation -config-file ~/.grafana-anotation-poster.yml -tag testjio
grafana-annotation 2019/04/18 14:37:11 [INFO] ▶ response Status:200 OK
grafana-annotation 2019/04/18 14:37:11 [INFO] ▶ response Headers:map[Content-Type:[application/json] Date:[Thu, 18 Apr 2019 12:36:58 GMT] Content-Length:[39]]
grafana-annotation 2019/04/18 14:37:11 [CRIT] ▶ error sending annotation. Message is Graphite annotation added
Contributor
There was a problem hiding this comment.
Hum, I must say that grafana 5+ is required for this to work properly. I'll add this requirement in the Readme
| log.Info("Sending annotation. Message is ", response.Message) | ||
| } else { | ||
| log.Info("response Body:", string(body)) | ||
| log.Fatalf("response Body:", string(body)) |
Contributor
There was a problem hiding this comment.
No way this is correct, response.Id != 0, meaning that we have a result for it. We wont fatalf here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

fix #1 and #2
Change configuration default file
Chang log format from Fatal to Info