@Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface MetricTerm
MonitoredFunction in order to use the parameter
values for generating the metric name that is instrumented.
Let's suppose we have a function foobar which is annotated with MonitoredFunction
package io.appform.functionmetrics;
public class Foo {
\\@MonitoredFunction
public void bar(int a, \\@MetricTerm String b, long c) {
\\ do some computation
return 42;
}
}
Imagine the bar function was invoked as follows: bar(10, "Blah-b1@h_ ", 131513).
Then, the metric name will be {prefix}.io.appform.functionmetrics.Foo.bar.blahbh.$domain.
Here, $domain is an enum that takes a value in SET {SUCCESS, FAILURE, ALL}.
Note how the parameter value is trimmed, lower-cased and stripped of non-alphabetic characters.
If there were multiple parameters annotated with MetricTerm in the function bar, then their string values are simply joined together by a dot.
The order of formal parameters in the method signature is maintained in generating the concatenated metric name component for parameter values.
NOTE: Formal parameters annotated with this annotation must be of type String or @code Enum, otherwise the string value of parameter is ignored
Also, formal parameter values must match this regexp ^[a-zA-Z_][a-zA-Z_0-9]*. See FunctionMetricConstants.| Modifier and Type | Optional Element and Description |
|---|---|
int |
order |
Copyright © 2018. All rights reserved.