New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 751231 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature
OKR

Blocking:
issue 729199



Sign in to add a comment

Work out a POC api for cloud trace in chromite

Project Member Reported by pho...@chromium.org, Aug 1 2017

Issue description

We need a libary to emit traces to the cloud trace API.
 
Blocking: 729199
Labels: -Type-Bug -Pri-2 Pri-1 Type-Feature
Project Member

Comment 3 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ace8c0ec931251e6bff02ad547c3af0131613405

commit ace8c0ec931251e6bff02ad547c3af0131613405
Author: Paul Hobbs <phobbs@google.com>
Date: Wed Aug 09 21:05:09 2017

trace: First pass at a nice cloud trace api

BUG= chromium:751231 
TEST=Added a basic unit test, manual testing with API

Change-Id: I0f2627f3787efca39402a200b48f39d773ad314d
Reviewed-on: https://chromium-review.googlesource.com/596522
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[add] https://crrev.com/ace8c0ec931251e6bff02ad547c3af0131613405/lib/cloud_trace.py
[add] https://crrev.com/ace8c0ec931251e6bff02ad547c3af0131613405/lib/cloud_trace_unittest
[add] https://crrev.com/ace8c0ec931251e6bff02ad547c3af0131613405/lib/cloud_trace_unittest.py
[add] https://crrev.com/ace8c0ec931251e6bff02ad547c3af0131613405/lib/structured.py

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/infra_virtualenv/+/6e907fc83fbf0c4aec4e07b92e35f8d65f02b38b

commit 6e907fc83fbf0c4aec4e07b92e35f8d65f02b38b
Author: Paul Hobbs <phobbs@google.com>
Date: Fri Aug 11 02:53:17 2017

Add inotify_simple wheel to pip_packages

Inotify_simple will be used by the cloud trace log consumer.

BUG= chromium:751231 
TEST=None

Change-Id: I890d8ee8af26224671d4cdc7b6f0b052c71b25c4

[add] https://crrev.com/6e907fc83fbf0c4aec4e07b92e35f8d65f02b38b/pip_packages/inotify_simple-1.1.1-py2-none-any.whl

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/82a29bab6190baa573a14fe5ea5acd8694c39825

commit 82a29bab6190baa573a14fe5ea5acd8694c39825
Author: Paul Hobbs <phobbs@google.com>
Date: Sat Aug 12 10:44:06 2017

cloud_trace: Log spans to a file

Changed SpanStack to log each span to a file after it has been performed. Uses a singleton filehandle shared by all SpanStacks within a process.

TEST=unit tests
BUG= chromium:751231 

Change-Id: I4b3729db09b590986745b6957395a1b06bf48875
Reviewed-on: https://chromium-review.googlesource.com/608574
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/82a29bab6190baa573a14fe5ea5acd8694c39825/lib/cloud_trace.py
[modify] https://crrev.com/82a29bab6190baa573a14fe5ea5acd8694c39825/lib/cloud_trace_unittest.py

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/a02ee76cf0ddec398763d3b98dd548090f6efa33

commit a02ee76cf0ddec398763d3b98dd548090f6efa33
Author: Paul Hobbs <phobbs@google.com>
Date: Tue Aug 15 03:37:48 2017

export_to_cloud_trace: A new script

export_to_cloud_trace watches the /var/log/traces directory for new
files, parses each line as a Span in JSON format, and sends the spans to the
cloud trace API.

BUG= chromium:751231 
TEST=added a unit test, and ran the script.

Change-Id: Ic916e2b812183ba0e0f18169e602357c4b4fba63
Reviewed-on: https://chromium-review.googlesource.com/611975
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[add] https://crrev.com/a02ee76cf0ddec398763d3b98dd548090f6efa33/scripts/export_to_cloud_trace.py
[modify] https://crrev.com/a02ee76cf0ddec398763d3b98dd548090f6efa33/venv/requirements.txt
[add] https://crrev.com/a02ee76cf0ddec398763d3b98dd548090f6efa33/bin/export_to_cloud_trace
[add] https://crrev.com/a02ee76cf0ddec398763d3b98dd548090f6efa33/scripts/export_to_cloud_trace_unittest.py
[add] https://crrev.com/a02ee76cf0ddec398763d3b98dd548090f6efa33/scripts/export_to_cloud_trace_unittest

Project Member

Comment 7 by bugdroid1@chromium.org, Aug 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9fbef7de3c3750777852cf91128cb5452d5dd5b1

commit 9fbef7de3c3750777852cf91128cb5452d5dd5b1
Author: Paul Hobbs <phobbs@google.com>
Date: Tue Aug 15 03:37:48 2017

cloud_trace: Log each span to a different file.

Previously, cloud_trace logged all spans from a single process to one span log.
The consumer was designed to be mostly stateless, consuming files only as they
are closed (not keeping many file handles open at once). A long-running process
which emits spans would not have its spans consumed until the process finished -
potentially days or weeks after they were first created.

This changes cloud_trace.py to log each span to a different file, which fixes
this problem.

BUG= chromium:751231 
TEST=unit tests still pass

Change-Id: I2fb00a653d2d43a898950a843cf0d3fb4bf35600
Reviewed-on: https://chromium-review.googlesource.com/612678
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>

[modify] https://crrev.com/9fbef7de3c3750777852cf91128cb5452d5dd5b1/lib/cloud_trace.py

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/192e16d6df652153e1a97a6091b27959301b89d3

commit 192e16d6df652153e1a97a6091b27959301b89d3
Author: Paul Hobbs <phobbs@google.com>
Date: Thu Aug 17 08:56:52 2017

cloud_trace: Move client-factory into script

The functions for creating the google API client belong in the
export_to_cloud_trace script.

BUG= chromium:751231 
TEST=both module's unit tests.

Change-Id: I5c354fe67d63aa89ca19ce21071a3271d3cc039b
Reviewed-on: https://chromium-review.googlesource.com/612679
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/192e16d6df652153e1a97a6091b27959301b89d3/lib/cloud_trace.py
[modify] https://crrev.com/192e16d6df652153e1a97a6091b27959301b89d3/scripts/export_to_cloud_trace.py

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/chromeos-admin/+/2265d7c9be978bc9bc7f00c446fc2a596a7a886d

commit 2265d7c9be978bc9bc7f00c446fc2a596a7a886d
Author: Paul Hobbs <phobbs@google.com>
Date: Wed Aug 23 21:32:04 2017

Project Member

Comment 10 by bugdroid1@chromium.org, Aug 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/30e9cd90cd975e2c1b2f6da984354d9b3eed7da9

commit 30e9cd90cd975e2c1b2f6da984354d9b3eed7da9
Author: Paul Hobbs <phobbs@google.com>
Date: Thu Aug 24 06:13:36 2017

cloud_trace: Env variable for context

Use an environment variable CLOUD_TRACE_CONTEXT to do the same thing that the
X-Cloud-Trace-Context header does for App Engine: propagate the trace-id and
parent-span-id across boundaries. In this case, setting the environment variable
will let the subprocesses create subspans within the same trace.

BUG= chromium:751231 
TEST=Added unit tests.

Change-Id: I0c8046ffdc733336146f2de551decae412a58780
Reviewed-on: https://chromium-review.googlesource.com/618289
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/30e9cd90cd975e2c1b2f6da984354d9b3eed7da9/lib/cloud_trace.py
[modify] https://crrev.com/30e9cd90cd975e2c1b2f6da984354d9b3eed7da9/lib/cloud_trace_unittest.py

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/6dc75de920f75a90a2878a66a0b805a470e93ffc

commit 6dc75de920f75a90a2878a66a0b805a470e93ffc
Author: Paul Hobbs <phobbs@google.com>
Date: Thu Aug 24 06:13:36 2017

cloud_trace: Record span metrics

Record a SecondsDistribution metric upon logging a span via LogSpan().

TEST=cloud trace unittests pass
BUG= chromium:751231 

Change-Id: I9cd2196b50331b7284ea070905182b84b480169b
Reviewed-on: https://chromium-review.googlesource.com/627621
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/6dc75de920f75a90a2878a66a0b805a470e93ffc/lib/cloud_trace.py

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8683b12e0af93e47d2bc108c49556f2931982762

commit 8683b12e0af93e47d2bc108c49556f2931982762
Author: Paul Hobbs <phobbs@google.com>
Date: Sat Aug 26 02:54:12 2017

export_to_cloud_trace: Add metrics

Added two metrics:
 - A SecondsDistribution metric for span durations
 - A Counter to measure batch sizes emitted to the API.

TEST=export_to_cloud_trace unittests pass
BUG= chromium:751231 

Change-Id: I5c30e591aaddabf52043cc68b831c40a39aef747
Reviewed-on: https://chromium-review.googlesource.com/629518
Commit-Ready: Paul Hobbs <phobbs@google.com>
Tested-by: Paul Hobbs <phobbs@google.com>
Reviewed-by: Paul Hobbs <phobbs@google.com>

[modify] https://crrev.com/8683b12e0af93e47d2bc108c49556f2931982762/scripts/export_to_cloud_trace.py
[modify] https://crrev.com/8683b12e0af93e47d2bc108c49556f2931982762/lib/metrics.py
[modify] https://crrev.com/8683b12e0af93e47d2bc108c49556f2931982762/scripts/export_to_cloud_trace_unittest.py

Status: Verified (was: Started)

Sign in to add a comment