Skip to content
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

Merged
merged 4 commits into from
Sep 1, 2018
Merged

Add trace to logentry types #5878

merged 4 commits into from
Sep 1, 2018

Conversation

salrashid123
Copy link
Contributor

Add traceID parameter for logentries:

#5505

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 1, 2018
logging/google/cloud/logging/entries.py Outdated Show resolved Hide resolved
logging/google/cloud/logging/entries.py Outdated Show resolved Hide resolved
logging/google/cloud/logging/logger.py Outdated Show resolved Hide resolved
@@ -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.

logging/google/cloud/logging/logger.py Outdated Show resolved Hide resolved
@@ -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.

@tseaver tseaver added the api: logging Issues related to the Cloud Logging API. label Sep 1, 2018
@@ -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.

This comment was marked as spam.

This comment was marked as spam.

@@ -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.

logging/google/cloud/logging/entries.py Outdated Show resolved Hide resolved
@@ -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.

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.

@@ -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.

@tseaver tseaver removed the request for review from theacodes September 1, 2018 16:27
@tseaver
Copy link
Contributor

tseaver commented Sep 1, 2018

@dpebot Please merge when green.

@dpebot
Copy link
Contributor

dpebot commented Sep 1, 2018

Okay! I'll merge when all statuses are green and all reviewers approve.

@dpebot dpebot added the automerge Merge the pull request once unit tests and other checks pass. label Sep 1, 2018
@dpebot dpebot self-assigned this Sep 1, 2018
@tseaver tseaver merged commit bc58370 into googleapis:master Sep 1, 2018
@salrashid123 salrashid123 deleted the add-logging-trace-option branch September 1, 2018 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants