-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add trace to logentry types #5878
Add trace to logentry types #5878
Conversation
@@ -251,16 +261,20 @@ def log_struct(self, info, client=None, labels=None, insert_id=None, | |||
|
|||
:type timestamp: :class:`datetime.datetime` | |||
:param timestamp: (optional) timestamp of event being logged. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -189,7 +191,8 @@ def test_log_text_w_unicode_explicit_client_labels_severity_httpreq(self): | |||
labels=DEFAULT_LABELS) | |||
|
|||
logger.log_text(TEXT, client=client2, labels=LABELS, | |||
insert_id=IID, severity=SEVERITY, http_request=REQUEST) | |||
insert_id=IID, severity=SEVERITY, http_request=REQUEST, | |||
trace=TRACE) |
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.
@@ -544,6 +571,8 @@ def commit(self, client=None): | |||
info['httpRequest'] = http_req | |||
if timestamp is not None: | |||
info['timestamp'] = _datetime_to_rfc3339(timestamp) | |||
if trace is not None: | |||
info['trace'] = trace |
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.
@@ -287,18 +301,21 @@ def log_proto(self, message, client=None, labels=None, insert_id=None, | |||
:param http_request: (optional) info about HTTP request associated with | |||
the entry. | |||
|
|||
:type timestamp: :class:`datetime.datetime` | |||
:param timestamp: (optional) timestamp of event being logged. | |||
|
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.
@@ -185,15 +191,19 @@ class ProtobufEntry(_BaseEntry): | |||
|
|||
:type resource: :class:`~google.cloud.logging.resource.Resource` | |||
:param resource: (Optional) Monitored resource of the entry | |||
|
|||
:type trace: str | |||
:param trace: (optional) traceid to apply to the entry. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
logging/tests/unit/test_logger.py
Outdated
self.assertEqual(api._write_entries_called_with, | ||
(ENTRIES, None, None, None)) | ||
|
||
def test_log_text_w_unicode_explicit_client_labels_severity_httpreq_trace(self): |
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.
@@ -544,6 +571,8 @@ def commit(self, client=None): | |||
info['httpRequest'] = http_req | |||
if timestamp is not None: | |||
info['timestamp'] = _datetime_to_rfc3339(timestamp) | |||
if trace is not None: | |||
info['trace'] = trace |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@dpebot Please merge when green. |
Okay! I'll merge when all statuses are green and all reviewers approve. |
Add traceID parameter for logentries:
#5505