GithubHelp home page GithubHelp logo

Comments (4)

DarcyRaynerDD avatar DarcyRaynerDD commented on August 23, 2024

Hey @dtothefp . It looks like the error is because of some environment variables we usually read from the AWS sandbox that the serverless plugin's invoke environment doesn't provide. I think we might be able to address this at the serverless plugin level by disabling instrumentation when the invoke occurs. DataDog/serverless-plugin-datadog#63 We might be able to address both issues at once.

from datadog-lambda-js.

dtothefp avatar dtothefp commented on August 23, 2024

@DarcyRaynerDD your fix for serverless plugin fixed the problem references in that issue but I'm still seeing this on local invoke

{"status":"error","message":"datadog:api key not configured, see https://dtdg.co/sls-node-metrics"}

Do I need to update this lib as well?

from datadog-lambda-js.

sfirrin avatar sfirrin commented on August 23, 2024

Hi @dtothefp, that error message comes from this function, and is status: error if the logForwarding config flag is false, and status: debug if the flag is true. The reason for this is that the Datadog API key is not necessary if metrics are written to logs rather than sent directly to Datadog.

You should be able to enable writing the metrics to logs by setting the flushMetricsToLogs serverless plugin config variable.

from datadog-lambda-js.

dtothefp avatar dtothefp commented on August 23, 2024

@sfirrin sorry for the late reply, for some reason I'm not receiving notifications for this issue 🤷‍♂️

This solution seems difficult to do because in my mind I would have to toggle the custom flushMetricsToLogs based upon the condition of if the Lambda invocation is local invoke or not which I don't think is possible in serverless.yml. So it would be something like

custom:
  datadog:
    flushMetricsToLogs: # ternary for IS_LOCAL

from datadog-lambda-js.

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.