Code Monkey home page Code Monkey logo

Comments (9)

tillkruss avatar tillkruss commented on July 25, 2024

Yes:

'request_context' => false,

from laravel-bridge.

harmenjanssen avatar harmenjanssen commented on July 25, 2024

Hmm, alright, I have to be more specific I guess: at this point I am not getting the X-Request-ID header in my requests.
I turned request_context on, but that doesn't give me any information about the AWS request.

I'm logging all headers coming in to my controller via the request, but it's not there.
Is there a way to get at the current context either in a controller, or middleware, or somewhere in that chain?

from laravel-bridge.

MantasVaitkunas avatar MantasVaitkunas commented on July 25, 2024

I am having the same problem. @harmenjanssen can you reopen the issue as ATM it's not clear how to use this config option :/

from laravel-bridge.

tillkruss avatar tillkruss commented on July 25, 2024

Does your request object not have the X-Request-ID header?

from laravel-bridge.

harmenjanssen avatar harmenjanssen commented on July 25, 2024

Does your request object not have the X-Request-ID header?

Nope, it does not.

from laravel-bridge.

tillkruss avatar tillkruss commented on July 25, 2024

Mhhh, turns out my apps aren't actually using this anymore. @georgeboot Do we have any way to access the AWS request id?

from laravel-bridge.

georgeboot avatar georgeboot commented on July 25, 2024

Afk atm, but there should be a $_SERVER var called HTTP_X_REQUEST_ID I believe

from laravel-bridge.

MantasVaitkunas avatar MantasVaitkunas commented on July 25, 2024

As @georgeboot said, I had a look into $_SERVER and found out that $_SERVER['LAMBDA_INVOCATION_CONTEXT'] has necessary info:

$requestId = null;
if (isset($_SERVER['LAMBDA_INVOCATION_CONTEXT'])) {
    $lambdaContext = json_decode($_SERVER['LAMBDA_INVOCATION_CONTEXT']);
    $requestId = $lambdaContext?->awsRequestId;
}

from laravel-bridge.

tillkruss avatar tillkruss commented on July 25, 2024

I feel like we should expose the invocation context a little better, maybe even attach some of the data to the Request object.

from laravel-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.