Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

app log entries do not have request-Id metadata to associate with a request log entry #76

Open

Description

@timc13

wild guess, but could it be because the actual request header is X-Appengine-Request-Log-Id and the code looks like it's looking for X-Appengine-Request-Id?

Activity

  1. bryanmau1 commented on Apr 14, 2016

    @bryanmau1
    Contributor

    Are you referring to the logs one can see on the developers console? A code snippet or screenshot would be helpful.

  2. timc13 commented on Apr 14, 2016

    @timc13
    Author

    I'm referring to the logs i see in Google Cloud Logs. I converted an app from the standard runtime to flexible vm.

    Before the conversion, my app logs would show up grouped with the request log. After the conversion they are in a separate app log, which is fine, but there is no request-id in the metadata that I can use to correlate to any request log entries.

  3. andrewsg commented on Apr 14, 2016

    @andrewsg
    Member

    In the Cloud Logging UI, can you click on the vertical ". . ." on the right-hand side and see if there's a "see logs from same request" or similar functionality exposed? This functionality is based on the "cloud trace ID" (in the metadata of the log) and will be the focus of our log correlation efforts going forward.

  4. timc13 commented on Apr 14, 2016

    @timc13
    Author

    @andrewsg - I tried a bunch of things - and still no solution.

    If I click "Show entries from same request" on the request log - this gets put in the filter: label:appengine.googleapis.com/request_id:570dc25000ff0265238e01b5860001737e656d69737361727 92d73746167696e670001323031363034313274323334313332000100

    If I click "Show entries from same request" on the app log - this gets put in the filter:
    label:appengine.googleapis.com/thread_id:140649891129088

    I see a protoPayload.traceId in the request log, but traceId doesn't exist in any metadata in the app log. The app log doesn't even have protoPayload.

    Hope this helps...

  5. timc13 commented on Apr 15, 2016

    @timc13
    Author

    for context, this is our app constructor

    def __init__(self, *args, **kwargs):
        super(MyApplication, self).__init__(*args, **kwargs)
        self.router.set_dispatcher(self.__class__.custom_dispatcher)
    

    here's a screenshot of the app log
    app log

  6. timc13 commented on Apr 16, 2016

    @timc13
    Author

    hey just following up, are you guys able to confirm this is indeed a bug? Or is there something wrong with the way I'm doing things.

  7. andrewsg commented on Apr 18, 2016

    @andrewsg
    Member

    Not sure quite yet.

  8. theacodes commented on Apr 18, 2016

    @theacodes

    To clarify here:

    • App Engine Standard will group logs by request in the Cloud Logging UI. App Engine Standard also only shows the app/request log.
    • App Engine Flex, Compute Engine, and Container Engine will not group the logs by request, instead, it services a request log, a stderr log, and a stdout log.

    The primary reason for this difference that because there's so much variance in how things can be set up, so there currently isn't a simple way to do log to request correlation. We are investigating this, but we have not yet committed to feature parity.

    There are a few workarounds. You can always log in JSON format and log the request ID and use bigquery to analyze by request.

    I am closing this issue for the time being.

  9. 1 remaining item

  10. zeldrinn commented on Aug 2, 2016

    @zeldrinn

    @jonparrott how does one log the request ID that gets logged in request_log from within application-level logs? Currently, I'm creating my own request ID for each request that comes in and just logging that, but that doesn't help with correlating my stdout/stderr logs with request_log entries.

  11. theacodes commented on Aug 2, 2016

    @theacodes

    @kavriskive I'm not sure. Perhaps @andrewsg knows (iirc, he's working on some of this).

  12. timc13 commented on Aug 2, 2016

    @timc13
    Author

    @kavriskive I'm doing this by grabbing the header value from X-Appengine-Request-Log-Id

  13. andrewsg commented on Aug 4, 2016

    @andrewsg
    Member

    Currently this isn't done automatically because we're in the process of unifying on Cloud Trace IDs as the canonical ID for a request. UI work is ongoing to make this appear seamless; for now there's an awkward adolescence. X-Appengine-Request-Log-Id is available in the meantime although a future version may not include this and instead include only the Trace ID.

  14. czzarr commented on Feb 1, 2017

    @czzarr

    Hello,
    Is there any update on this, or at least a walkthrough on how to set use the Cloud Logging API to emulate AES behavior?
    I'm using AEF with nodejs
    Thanks

  15. duggelz commented on Feb 2, 2017

    @duggelz
    Contributor

    We know that users want this feature, and we are working on improving the logging experience across all of our compute platforms. We can't presently speak to any specific plans or dates.

  16. suhaasprasad commented on Nov 8, 2017

    @suhaasprasad

    Any update on how this can be accomplished even as a workaround? Even if it's not possible to group logs visually like with AES, there should at least be a way to view all logs for a specific request on AEF right?

  17. duggelz commented on Nov 8, 2017

    @duggelz
    Contributor

    The Google Cloud Client library for logging (https://googlecloudplatform.github.io/google-cloud-python/latest/logging/usage.html) properly labels logs for per-request aggregation. You can use that library on App Engine Flex, GKE, GCE, GCF, and non-Google platforms. Unfortunately, it is not supported on App Engine Standard yet (googleapis/google-cloud-python#1893 (comment)).

    Please note that if you are using one of the "python-compat" runtimes ("runtime: python27" for Managed VMs, "runtime: python-compat" for App Engine Flex), they have been frozen except for security updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions