Skip to content

Added ability to configure the url where the errors get sent#29

Merged
steren merged 1 commit intoGoogleCloudPlatform:masterfrom
trevtrich:master
Dec 12, 2017
Merged

Added ability to configure the url where the errors get sent#29
steren merged 1 commit intoGoogleCloudPlatform:masterfrom
trevtrich:master

Conversation

@trevtrich
Copy link
Copy Markdown
Contributor

  • This is primarily necessary to support web clients that would like to avoid using api keys.

@googlebot
Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

Comment thread README.md Outdated

**Q: Are private source maps supported?** A: No, see [#4](https://github.com/GoogleCloudPlatform/stackdriver-errors-js/issues/4)

**Q: Can I use this without an API key?** A: Yes, see below
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add that the custom URL must implement the report API endpoint: https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.events/report

Comment thread README.md Outdated

**Q: Are private source maps supported?** A: No, see [#4](https://github.com/GoogleCloudPlatform/stackdriver-errors-js/issues/4)

**Q: Can I use this without an API key?** A: Yes, see below
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to create a dedicated README section rather than a Q.

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@trevtrich
Copy link
Copy Markdown
Contributor Author

All great suggestions. I've updated accordingly.

One thing to bear in mind is that when I built the new tests I ran into an issue with the urls having to include the text 'clouderrorreporting'. Thus, you'll see that my new test, though a different overall url, does contain that text. It seems that there is some state lingering on all the tests due to the timeout in the beforeeach. If you drop an console printout into the filter and printout the urls, you'll see that they build up as more tests are run. I didn't want to completely rip apart the tests as part of my first commit so I went the route I did, but thought I'd pass along and potentially do this as a followup when I have time.

Comment thread README.md Outdated

## Configuring without an API key

If you are in a situation where an API key is not an option, you can configure the endpoint that errors are sent to with the following:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "you can configure the endpoint that errors are sent to". You should also explain what's the idea:
"you can forward these errors to an endpoint on your server, and report them server-side. You can can configure the endpoint that errors are sent to...."

Comment thread README.md
version: '<my-service-version>' // (optional)
});
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please detail more what's expected to be put in targetUrl: is it compatible with relative URLs or should I provide an absolute one?

Comment thread test/test.js
});

describe('Reporting errors', function () {
beforeEach(function() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of deleting this beforeEach. Can you put your new test into a new describe? For example describe('Reporting errors with custom URL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure what pattern you guys usually conformed to. Guess I chose the wrong one! Ha, is this what you were looking for or should I separate the new on out into it's own entirely?

- This is primarily necessary to support web clients that would like to avoid using api keys.
@trevtrich
Copy link
Copy Markdown
Contributor Author

I believe I've addressed all comments. Let me know if there are some further changes you'd like to see.

@steren steren merged commit ed198bb into GoogleCloudPlatform:master Dec 12, 2017
@steren
Copy link
Copy Markdown
Collaborator

steren commented Dec 12, 2017

Thanks!

@steren
Copy link
Copy Markdown
Collaborator

steren commented Dec 12, 2017

I'll wait for #30 and do a new release

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

Successfully merging this pull request may close these issues.

3 participants