-
Notifications
You must be signed in to change notification settings - Fork 47
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
Ingest API to return response of POST calls #120
base: master
Are you sure you want to change the base?
Conversation
Return response code to the user when posting data using ingestion sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easiest PR to approve
Please note that the response code is 200 if the request is well-formed but the backend fails to ingest the data point. See the following:
|
Hi @jmalin-signalfx As I mentioned in the example, if the token is invalid, the library doesn't return an exception when using Giving the response back would give some more visibility on the API returned codes, whatever that is. We are using this library to publish custom events from our pipelines and we would like to fail the pipeline in the event of http error code, like the 401 mentioned before. |
Custom events are different from data points. If you're getting a 401, that needs to surface to the user. I'm in favor of returning every response code we actually get back; my comment was a note that the API might not tell you that something went wrong. I don't know what the next step is, though. I can't approve the PR or merge it myself. |
related to #28 |
Folks, that PR sounds reasonable, but it would be good to have a test to back it up, however trivial that may be, to make sure this is working going forward. |
Return response code to the user when posting data using ingestion sdk.
Currently the response is not available to the user to make decisions based on the http response code.
For example, the current code will not raise an exception if the
API_TOKEN
is invalid and will give an impression that it was a successful execution.The status code is only visible as a debug message (
DEBUG: Sending to SignalFx failed (401 Unauthorized)
), which is not accessible in code.With the proposed changes, this would be possible: