GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add trace_id to log payload to enable log aggregation in GAE Flex by liyanhui1228 · Pull Request #3355 · googleapis/google-cloud-python

Conversation

@liyanhui1228

@liyanhui1228 liyanhui1228 commented May 2, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Extract trace_id from HTTP request header and add it to application log. The pantheon UI will show the app logs grouped by trace_id and show them aggregated in one request.

Below is the screenshot of the aggregated log:
screenshot from 2017-05-01 17 37 44

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@liyanhui1228
Add trace_id to log payload to enable log aggregation in GAE Flex
5db8c8b
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 2, 2017
dhermes
dhermes reviewed May 2, 2017
View reviewed changes

@dhermes dhermes left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liyanhui1228 Thanks for sending this patch but I'm not sure it's something we can accept / a feature we want to support.

@waprin WDYT?

PS I started a code review, but no need to address my review comments until we decide if this should exist / where this feature should live.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread logging/google/cloud/logging/handlers/_helpers.py
else:
trace_id = None

return trace_id No newline at end of file

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/_helpers.py
flask = None

# Extract the trace_id
if flask:

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/_helpers.py
try:
import flask
except ImportError:
flask = None

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/_helpers.py
"""Parse flask request header to get trace_id.

:rtype: str
:return: trace_id get from flask header

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread logging/google/cloud/logging/handlers/_helpers.py

# Make a best effort to add the trace id.
# First try to extract the trace_id from HTTP header, only support flask framework for now.
trace_id = parse_flask_request_header()

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waprin

waprin commented May 2, 2017

Copy link
Copy Markdown
Contributor

This whole PR should get closed, we are just supposed to use the generic log handler according to @JustinBeckwith in #2997

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waprin

waprin commented May 2, 2017 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Maybe we can still get the trace ID in there but it shouldn't be via the stackdriver helper that currently exists.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 2, 2017

Copy link
Copy Markdown
Contributor

/cc @duggelz for context

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 2, 2017

Copy link
Copy Markdown
Contributor

@waprin Can we make a decision quickly and either move forward or close this thing? (i.e. just don't want it to come off our plates and sit open in limbo)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waprin

waprin commented May 2, 2017

Copy link
Copy Markdown
Contributor

I think we should close and @liyanhui1228 and @duggelz should have a quick chat about best way to do this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 2, 2017

Copy link
Copy Markdown
Contributor

OK, closing now. We can always re-open.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes dhermes closed this May 2, 2017
@duggelz

duggelz commented May 2, 2017

Copy link
Copy Markdown

This has nothing to do with #2997

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waprin

waprin commented May 2, 2017

Copy link
Copy Markdown
Contributor

It has everything to do with it because the helper method it's modifying is used to format the messages for /var/log/appengine.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 2, 2017

Copy link
Copy Markdown
Contributor

Okay - deep breath - we failed to properly support a new contributor here. We need to do better.

It's clear that while we want this feature, we're not ready to implement it. So, let's create a bug/feature request for this feature and mark all blocking bugs. If the owners of those bugs can't resolve them in a timely manner, let's see what we can do to enable @liyanhui1228 or @duggelz to address them so that this feature can be implemented.

@dhermes or @lukesneeringer, can you own this? If not, please let me know and I will do this personally.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lukesneeringer

lukesneeringer commented May 2, 2017

Copy link
Copy Markdown
Contributor

I am happy to own it if needed ("buck stops here" kind of thing), but I am not sure I am the right person. I have read over this ticket and I do not intuitively grok the issue in question.

I think the issue is that if there is an HTTP header that we can easily get at, we want to send it to Stackdriver in some way?

Best case for me is if @jonparrott owns this, but I am willing to if needed. :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes

theacodes commented May 2, 2017

Copy link
Copy Markdown
Contributor

@lukesneeringer I'm on it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@theacodes theacodes mentioned this pull request May 2, 2017
Send trace context with logs from web applications #3359
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@dhermes dhermes dhermes left review comments
@duggelz duggelz duggelz left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@liyanhui1228 @waprin @theacodes @dhermes @duggelz @lukesneeringer @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.