-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lambda embedded metrics plugin #53
Conversation
tags?: Record<string, string> | undefined, | ||
context?: Record<string, string> | undefined | ||
): Promise<void> { | ||
await this.sendMetric(name, Unit.Seconds, value, tags, context, StorageResolution.High); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are u sure its seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@korengal You're right, its MS, I'll fix that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think It will be easier to use this package:
https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/metrics/#getting-started
- It writes to console in a format that AWS knows how to take it without async calls.
- The api is easier
const metrics = new Metrics({
namespace: METRICS_NAMESPACE,
serviceName: process.env.AWS_LAMBDA_FUNCTION_NAME || '',
defaultDimensions: labels
});
metrics.addMetric(metricName, unit, value);
metrics.publishStoredMetrics();
In addition, I would call the plugin CloudwatchPlugin
Which issues does it affect?
What it does
This feature adds a support for lambda EMF custom metrics