Skip to content

Add Error Reporting Client#1946

Merged
daspecster merged 1 commit into
googleapis:masterfrom
waprin:error_reporting
Jul 25, 2016
Merged

Add Error Reporting Client#1946
daspecster merged 1 commit into
googleapis:masterfrom
waprin:error_reporting

Conversation

@waprin

@waprin waprin commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

This is another baby step, this time towards addressing #1881.

Once again, probably goes into a feature branch.

First of all, this just piggybacks on the Logging client by directly extending it. Error Reporting has its own API, but is still rolling out support for the most important call, which is to actually post an error.

This PR just adds a single function which reports the exception detail through Error Reporting using the Logging API.

If we want to add a system test, then we should add the functionality to actually get the details about the reported error.

https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.events/list

If we think that's necessary I'll do it.

There is some intersection between Error Reporting and Logging in that we might want a logging handler to report to Error Reporting on a logging call of severity error and we want to enable error reporting to use logging's async transports. But I'll wait till both of these branches get fleshed out more before working on that.

/cc @steren

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 30, 2016
@waprin waprin force-pushed the error_reporting branch from 6556208 to e982bf0 Compare June 30, 2016 01:24
Comment thread docs/error-reporting-usage.rst Outdated
.. doctest::

>>> from gcloud import error_reporting
>>> from

This comment was marked as spam.

This comment was marked as spam.

@tseaver

tseaver commented Jun 30, 2016

Copy link
Copy Markdown
Contributor

@waprin Should this be targeting the logging-stdlib-handler-feature branch?

@waprin waprin force-pushed the error_reporting branch 4 times, most recently from 69603fb to 1f59346 Compare June 30, 2016 20:51
@waprin

waprin commented Jun 30, 2016

Copy link
Copy Markdown
Contributor Author

@tseaver comments addressed, travis passes. I am totally fine to put this in logging-stdlib-handler-feature, it's just that branch had a specific name and this is slightly outside the scope of it. There will be a little intersection in that we want to have a handler option so that logging.error() goes to Error Reporting as well as logging. So same feature branch of new one works for me.

@tseaver

tseaver commented Jul 6, 2016

Copy link
Copy Markdown
Contributor

@waprin Would you prefer to open a separate PR targeting the logging-stdlib-handler-feature branch, or should i just merge it there manually?

@waprin

waprin commented Jul 6, 2016

Copy link
Copy Markdown
Contributor Author

I will recreate the PR if that is in fact the branch you want it in.

@tseaver

tseaver commented Jul 6, 2016

Copy link
Copy Markdown
Contributor

I will recreate the PR if that is in fact the branch you want i

Hmm, looking at it again, I'm not sure that branch is right: your changes here are pretty independent of anything directly related to logging, especially from the user's point-of-view. Will there eventually be separate API endpoints for error reporting?

@tseaver

tseaver commented Jul 6, 2016

Copy link
Copy Markdown
Contributor

Hmm, looks like there are endpoints, but they don't get mapped onto this client, and they are (confusingly) not related to reporting that an error happened, but rather on generating reports of errors. Do you see your client adding support for those endpoints?

@waprin

waprin commented Jul 6, 2016

Copy link
Copy Markdown
Contributor Author

There will be an endpoint to report an error eventually, at that point we may want to change the code here to talk directly to it rather than through logging (for quota management, etc)

Support for the other endopints is a nice-to-have but not a priority. Biggest reason to add some now is just so we can write system tests for the existing code. But yes I envision this is where that code will go. If you think in the interest of completeness or testing we add it now then I can work on it.

@steren

steren commented Jul 6, 2016

Copy link
Copy Markdown

For the other endpoints, we are talking to the Veneer team and they can probably be generated.

What really matters is an idiomatic library and method to report errors.
As @waprin said, the endpoint is coming. But not eventually: it is already in alpha and public beta release is planned within a week.

executable, job, or Google App Engine module name. This
field is expected to have a low number of values that are
relatively stable over time, as opposed to version,
which can be changed whenever new code is deployed.

This comment was marked as spam.

This comment was marked as spam.

@waprin waprin force-pushed the error_reporting branch 3 times, most recently from 513e35e to 58ef6a5 Compare July 6, 2016 23:27
@waprin

waprin commented Jul 6, 2016

Copy link
Copy Markdown
Contributor Author

vkit will generate a gRPC client but sounds like we won't be using it in the near future until other grpc complexities are resolved.

@tseaver As mentioned in comments I agree we need a client that actually takes all the available params, and the helper functions are built on top of that. I was taking baby steps to get reviews, your thoughts on where all this code should go etc but if you'd prefer I do it all in this one PR that's fine, or we can do a separate feature branch, or something else.

Also while the logging handler and this are mostly orthogonal, there is a slight overlap in that we want a handler option that reports the context of logging.error messages to Error Reporting.

Comment thread docs/error-reporting-usage.rst Outdated
>>> client = error_reporting.Client(project='my-project', credentials=creds)

Error Reporting associates errors with a service, which is an identifier for an executable,
App Engine module, or job. The default service is "python", but a default can be specified

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@waprin waprin force-pushed the error_reporting branch from 58ef6a5 to b3eba02 Compare July 8, 2016 20:13
Comment thread gcloud/error_reporting/client.py Outdated
'serviceContext': {
'service': service,
},
'message': '{0} : {1}'.format(message, traceback.format_exc())

This comment was marked as spam.

@waprin waprin force-pushed the error_reporting branch 3 times, most recently from 286c39a to 10024e3 Compare July 20, 2016 23:40
@waprin

waprin commented Jul 20, 2016

Copy link
Copy Markdown
Contributor Author

@tseaver @dhermes rebased

@waprin

waprin commented Jul 22, 2016

Copy link
Copy Markdown
Contributor Author

@tseaver @daspecster understand you guys are busy but are you planning on getting this and #1942 merged? I have more PRs on the way but nervous that I haven't been able to get anything into master yet.

@daspecster

Copy link
Copy Markdown
Contributor

LGTM but I defer to @tseaver and/or @dhermes.

@waprin

waprin commented Jul 22, 2016

Copy link
Copy Markdown
Contributor Author

@dhermes was sitting next to me a few minutes ago and had no opinion, but sure waiting for Tres makes sense. There's no big rush either just checking yall plan to merge this stuff etc

@daspecster

Copy link
Copy Markdown
Contributor

If I get a LGTM from either @dhermes or @tseaver then I push the big green button lol.
Do you have merge privileges or do we need to merge?

@tseaver

tseaver commented Jul 22, 2016

Copy link
Copy Markdown
Contributor

LGTM

@waprin

waprin commented Jul 22, 2016

Copy link
Copy Markdown
Contributor Author

cool ty, hold on let me remove accidental shebangs

@waprin waprin force-pushed the error_reporting branch from 10024e3 to 26984b2 Compare July 22, 2016 21:04
@daspecster

Copy link
Copy Markdown
Contributor

@waprin I think I broke the build somehow. It's failing on importing intersphinx. I'll check it out.

@daspecster

Copy link
Copy Markdown
Contributor

Perhaps it wasn't me, but it's strange either way.

@daspecster

Copy link
Copy Markdown
Contributor

#2019

@waprin waprin force-pushed the error_reporting branch from cc0d54b to b771f4f Compare July 22, 2016 22:18
@waprin

waprin commented Jul 22, 2016

Copy link
Copy Markdown
Contributor Author

@daspecster can merge unless you think lint stuff blocks it

@daspecster

Copy link
Copy Markdown
Contributor

I'll wait to hear back from @dhermes.

@daspecster

Copy link
Copy Markdown
Contributor

@dhermes here's the other tox.ini configuration that doesn't seem to work.
#2020

@dhermes

dhermes commented Jul 25, 2016

Copy link
Copy Markdown
Contributor

Don't block this on lint stuff

@daspecster

Copy link
Copy Markdown
Contributor

Ok I'm going to merge it then.

@daspecster daspecster merged commit dbafbe6 into googleapis:master Jul 25, 2016
This was referenced Aug 3, 2016
@dhermes dhermes added api: clouderrorreporting Issues related to the Error Reporting API. and removed api: clouderrorreporting Issues related to the Error Reporting API. labels Feb 23, 2017
parthea pushed a commit that referenced this pull request Mar 2, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v1.0.1
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
<details><summary>google-auth: 2.48.0</summary>

##
[2.48.0](googleapis/google-auth-library-python@v2.47.0...v2.48.0)
(2026-01-21)

### Features

* honor `NO_GCE_CHECK` environment variable (#1610)
([383c9827](googleapis/google-auth-library-python@383c9827))

* add configurable GCE Metadata Server retries (#1488)
([454b441b](googleapis/google-auth-library-python@454b441b))

* add cryptography as required dependency (#1929)
([52558ae2](googleapis/google-auth-library-python@52558ae2))

* Support the mTLS IAM domain for Certificate based Access (#1938)
([8dcf91a1](googleapis/google-auth-library-python@8dcf91a1))

### Bug Fixes

* resolve circular imports (#1942)
([25c1b064](googleapis/google-auth-library-python@25c1b064))

* Use `user_verification=preferred` for ReAuth WebAuthn challenge
(#1798)
([3f88a240](googleapis/google-auth-library-python@3f88a240))

* removes `content-header` from AWS IMDS get request (#1934)
([97bfea9e](googleapis/google-auth-library-python@97bfea9e))

* detect correct auth when ADC env var is set but empty (#1374)
([bfc07e10](googleapis/google-auth-library-python@bfc07e10))

* replace deprecated utcfromtimestamp (#1799)
([e431f20c](googleapis/google-auth-library-python@e431f20c))

</details>
parthea pushed a commit that referenced this pull request Mar 6, 2026
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Lingqing Gan <lingqing.gan@gmail.com>
parthea pushed a commit that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: clouderrorreporting Issues related to the Error Reporting API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants