Post-processing in functions - should it work?

Options
mike-k
mike-k Member
edited August 2023 in ? Working with APIs

We are implementing DataDog Logging so that we can monitor some of the API calls that we are making. I created a function to call datadog's api and send it information. It works fine. However, I'd like to run it post-process so that it happens after the call is complete. When I made this change, the events stopped posting to DD. Any ideas on why this isn't working? Is post-processing in functions supported?

Best Answer

  • MattLaro
    MattLaro Member ✭✭
    Answer ✓
    Options

    That's what I would try, yes :).
    1. Create var v_api_call = input:api_call
    2. Create var v_request_endpoint = input:request_endpoint
    3. Post processing (same stack, but using var instead of input)

Answers

  • mike-k
    mike-k Member
    Options

    Here's the function stack, if it's helpful

  • MattLaro
    MattLaro Member ✭✭
    Options

    My very first question for you : Did you include ANY input values (api_call or request_endpoint) in ANY of your postprocess components ?

    So far I see 1.1, 1.1.1 , 1.1.2 and 1.4

    Dump all of your inputs into vars first before calling post processing, then call post processing by using these vars instead of input then try your post processing again.

    I know we were suppose to be able to use input as post process values, but it never worked for me… and dumping the input into var before Post Process and using these var in Post Process worked for me everytime!

  • mike-k
    mike-k Member
    Options

    Thanks Matt! Yes, I'm directly referencing the inputs in the stack. So I need to create the variables before the post-process function and reference those?

  • mike-k
    mike-k Member
    Options

    Thanks, I will give it a try!

  • mike-k
    mike-k Member
    Options

    Following up that this worked for me. Thanks!