Comments (8)
👋 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.
Hey @vishnuvisnu, thanks for the PR. I can review this for you.
from datadog-lambda-js.
@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.
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.
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.
@agocs Created PR #63 to add custom timestamp.
from datadog-lambda-js.
@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.
I'm closing it since PR #63 is already merged into master. Thank you @vishnuvisnu
from datadog-lambda-js.
Related Issues (20)
- Full aws-sdk v3 support for nodejs18.x - remove v2 leftovers HOT 7
- [Feature request] Support Vault for Datadog API Key fetching HOT 3
- We are experiencing a weird issue where datadog's lambda layer is loading a module which is an optional dependency of its parent package HOT 6
- Access to trace id? HOT 2
- Path is removed by SAM CLI v1.89. HOT 4
- TypeError: Cannot read properties of undefined (reading 'then') HOT 8
- Missing KMS client dependency HOT 4
- Merge with standard W3C trace context HOT 2
- Receiving datadog: handler not initialized error HOT 1
- datadog + serverless + async_hooks not working as expected
- TypeError: handler is not a function HOT 17
- "datadog:handler not initialized" if metrics is sent after Lambda response with callbackWaitsForEmptyEventLoop = false HOT 1
- lambda layer 99 introduces intermittent postgres prepared statement error HOT 3
- Feature request: Enhanced metric for batch item failures HOT 1
- Feature request: NodeJS 20.x layer HOT 3
- Remove dependency on deprecated aws-sdk v2 HOT 4
- DNSResolvePlugin.finish throws TypeError HOT 13
- Cannot import package as ES6 module using AWS SAM CLI HOT 2
- `bind EMFILE 0.0.0.0` errors with Node 20 HOT 10
- DNSResolvePlugin.finish still throws TypeError on layer version 102 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datadog-lambda-js.