Add Async Background Thread transport#1942
Add Async Background Thread transport#1942tseaver merged 1 commit intogoogleapis:logging-stdlib-handler-featurefrom
Conversation
|
Actually I think I should add the Base transport class, will add that quickly first... |
d0e8da2 to
f5b9da5
Compare
|
Added base Transport class, Travis passes, review/merge at your convenience. |
docs/logging-usage.rst
Outdated
| entries on a background :class:`python.threading.Thread`. | ||
|
|
||
| 1. :class:`gcloud.logging.handlers.SyncTransport` this handler does a direct API call on each | ||
| logging statement to writ the entry. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
d6b9658 to
9e30584
Compare
|
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
|
@tseaver was waiting for review/merge, I just rebased it onto origin/master but now it thinks all those commits are mine. Not sure how to fix? |
|
CLAs look good, thanks! |
a6bc526 to
61c88a6
Compare
|
@tseaver ok i rebased it, i was trying to merge upstream but I think I did that wrong and I'll just hold off on it for now. Travis is now failing the lint but looks like origin/master is too so I'm guessing it's not related to this PR. |
|
@waprin, we've been battling with pylint and a few things. I think if you rebase again, it will fix this lint error in travis. |
|
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
0576f1d to
a62781c
Compare
| http) | ||
| logger = self.client.logger(name) | ||
| self.worker = _Worker(logger) | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@daspecster ready for another review at your convenience, just mentioned yo in another comment about the need for the class to copy the client. |
| while not self.stopping: | ||
| if len(self.batch.entries) == 0: | ||
| # branch coverage of this code extremely flaky | ||
| self._entries_condition.wait() # pragma: NO COVER |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
So where are we leaving off with this? |
|
I'm too out of the loop to comment |
|
@tseaver ping |
|
@tseaver @dhermes @daspecster Been almost a month, would like this to get merged and the feature branch to get merged into master, what's going on? |
|
@daspecster : Can you take a look? |
|
I'll merge if we're good to go? |
Refactors handlers into separate package Adds background threaded transport Adds fix to Batch commit to properly set log name
|
Had to kill shebang (since realized it's a bad thing to have in default template), but after Travis passes we can merge. This is still just into a feature branch so we can still have Tres take a final pass before merge into master. |
|
Traceback (most recent call last): 😢 |
|
Ugh. That dependency is restored on |
|
I merged |
|
... and the bulid is green. Whew! |
| @@ -0,0 +1,7 @@ | |||
| Python Logging Handler Sync Transport | |||
| ====================================== | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Thanks, will fix those issues in final commit before I aim for a master merge (fluentd handler). |
We have a couple circular imports in the library: - _mtls_helper and _agent_identity_utils both require each other - credentials and _default form a cycle This makes it difficult to import the library into google3 This PR resolved the import issues
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>

Next step: asynchronous transport using a background thread.
Some notes:
Next handler up will be fluentd.