GithubHelp home page GithubHelp logo

Comments (8)

agocs avatar agocs commented on August 23, 2024 3

👋 Hi, I've added this to a list of feature requests. Custom timestamps in this library make sense. We already allow them in Ruby, Python, and Go.

from datadog-lambda-js.

DarcyRaynerDD avatar DarcyRaynerDD commented on August 23, 2024 1

Hey @vishnuvisnu, thanks for the PR. I can review this for you.

from datadog-lambda-js.

PatrykMilewski avatar PatrykMilewski commented on August 23, 2024

@agocs Could you specify the header of the function, that would have this feature? I'm not sure how you are planning your API for this package, but if you guys would give me some hints, then I could implement it myself and create PR.

from datadog-lambda-js.

agocs avatar agocs commented on August 23, 2024

Hey @PatrykMilewski , I definitely appreciate the offer. I think the new function would take the signature

export function sendDistributionMetricWithDate(name: string, value: number, date: Date, ...tags: string[])

It would, unfortunately, require refactoring listener.sendDistrobutionMetric and a few other functions to accept the custom date.

from datadog-lambda-js.

vishnuvisnu avatar vishnuvisnu commented on August 23, 2024
public sendDistributionMetricWithDate(name: string, value: number, date: Date, ...tags: string[])  {

   if (this.config.logForwarding) {
     writeMetricToStdout(name, value, tags);
     return;
   }
   const dist = new Distribution(name, [{ timestamp: date, value }], ...tags);
   if (this.currentProcessor !== undefined) {
     this.currentProcessor.then((processor) => {
       processor.addMetric(dist);
     });
   } else {
     logError("can't send metrics, datadog lambda handler not set up.");
   }
}
public sendDistributionMetric(name: string, value: number, ...tags: string[]) {
 sendDistributionMetricWithDate(name, value, new Date(), tags);
}

These changes to MetricListener in listener.ts along with new function sendDistributionMetricWithDate in index.ts should work, right?

from datadog-lambda-js.

vishnuvisnu avatar vishnuvisnu commented on August 23, 2024

@agocs Created PR #63 to add custom timestamp.

from datadog-lambda-js.

vishnuvisnu avatar vishnuvisnu commented on August 23, 2024

@agocs Could you please expedite PR? We are currently using in datadog in production and using the datadog metrics from cloudwatch logs (that were published from the segment) that are in forming like MONITORING|..|..|..|.. but there is significant delay in getting metrics in datadog. This is the current ticket with the datadog team https://help.datadoghq.com/hc/en-us/requests/322610?flash_digest=9f923b6f7becc24b49af9543c88c5faa51c3a52c.

Thanks.

from datadog-lambda-js.

PatrykMilewski avatar PatrykMilewski commented on August 23, 2024

I'm closing it since PR #63 is already merged into master. Thank you @vishnuvisnu

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.