@@ -62,6 +62,7 @@ private String serviceNameWithFallback(FlushMetrics metrics) {
6262 @ SuppressWarnings ({ "EmptyMethod" })
6363 @ Pointcut ("@annotation(metrics)" )
6464 public void callAt (FlushMetrics metrics ) {
65+ // AspectJ point cut referenced in around() method
6566 }
6667
6768 @ Around (value = "callAt(metrics) && execution(@FlushMetrics * *.*(..))" , argNames = "pjp,metrics" )
@@ -81,8 +82,9 @@ public Object around(ProceedingJoinPoint pjp,
8182
8283 // We only overwrite the default dimensions if the user didn't overwrite them previously. This means that
8384 // they are either empty or only contain the default "Service" dimension.
84- if (!"" .equals (metrics .service ().trim ()) && (metricsInstance .getDefaultDimensions ().getDimensionKeys ().size () <= 1
85- || metricsInstance .getDefaultDimensions ().getDimensionKeys ().contains (SERVICE_DIMENSION ))) {
85+ if (!"" .equals (metrics .service ().trim ())
86+ && (metricsInstance .getDefaultDimensions ().getDimensionKeys ().size () <= 1
87+ || metricsInstance .getDefaultDimensions ().getDimensionKeys ().contains (SERVICE_DIMENSION ))) {
8688 metricsInstance .setDefaultDimensions (DimensionSet .of (SERVICE_DIMENSION , metrics .service ()));
8789 }
8890
@@ -105,7 +107,8 @@ public Object around(ProceedingJoinPoint pjp,
105107 DimensionSet coldStartDimensions = new DimensionSet ();
106108
107109 // Get service name from metrics instance default dimensions or fallback
108- String serviceName = metricsInstance .getDefaultDimensions ().getDimensions ().getOrDefault (SERVICE_DIMENSION ,
110+ String serviceName = metricsInstance .getDefaultDimensions ().getDimensions ().getOrDefault (
111+ SERVICE_DIMENSION ,
109112 serviceNameWithFallback (metrics ));
110113
111114 // Only add service if it is not undefined
0 commit comments