We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
configureContextForEnvironment sets LogGroup, ServiceName and ServiceType as defaultDimension when none is set
configureContextForEnvironment
LogGroup
ServiceName
ServiceType
defaultDimension
Code to reproduce the issue
final var metricsLogger = new MetricsLogger(); metricsLogger.putMetric("ErrorMetric", 0, Unit.NONE); metricsLogger.flush();
Generated Log
{ "_aws": { "Timestamp": 1599079576076, "CloudWatchMetrics": [ { "Namespace": "Dummy", "Metrics": [ { "Name": "ErrorMetric", "Unit": "None" } ], "Dimensions": [ [ "LogGroup", "ServiceName", "ServiceType" ] ] } ] }, "traceId": "Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=1", "functionVersion": "$LATEST", "LogGroup": "test", "ServiceName": "test", "ServiceType": "AWS::Lambda::Function", "logStreamId": "2020/09/02/[$LATEST]fe81001002b19bc93650b6779072f274", "ErrorMetric": 0.0, "executionEnvironment": "AWS_Lambda_java11" }
Ended up using metricsLogger.setDimensions(); to remove the defaultDimensions as a workaround.
metricsLogger.setDimensions();
{ "_aws": { "Timestamp": 1599085078153, "CloudWatchMetrics": [ { "Namespace": "Dummy", "Metrics": [ { "Name": "ErrorMetric", "Unit": "None" } ], "Dimensions": [] } ] }, "traceId": "Root=1-dc99d00f-c079a84d433534434534ef0d;Parent=91ed514f1e5c03b2;Sampled=1", "logStreamId": "2020/09/02/[$LATEST]174dbe23d48fa649561c2941f408b34e", "ErrorMetric": 0.0, "functionVersion": "$LATEST", "executionEnvironment": "AWS_Lambda_java11" }
The Embedded Metric Format schema supports metrics with no dimensions. Can we update the lib to get this fixed?
The text was updated successfully, but these errors were encountered:
The current way to publish metrics with no dimensions is to call
logger.setDimensions()
There would be no dimensions carried over to subsequent flushes. You only need to call the setDimensions once for each.
setDimensions
Sorry, something went wrong.
No branches or pull requests
configureContextForEnvironment
setsLogGroup
,ServiceName
andServiceType
asdefaultDimension
when none is setCode to reproduce the issue
Generated Log
Ended up using
metricsLogger.setDimensions();
to remove the defaultDimensions as a workaround.The Embedded Metric Format schema supports metrics with no dimensions. Can we update the lib to get this fixed?
The text was updated successfully, but these errors were encountered: