-
Notifications
You must be signed in to change notification settings - Fork 1k
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 dynatrace meter registry for metrics api v2 #2406
Add dynatrace meter registry for metrics api v2 #2406
Conversation
…r meter line function
…for metric dimensions
…ingConvention Tests
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.
Thank you for the PR! :)
I haven't finished reviewing this but would you please merge master back to your branch?
There is a trivial merge conflict and there were some checkstyle changes so this will fail after the merge.
default String entityId() { return getString(this,"entityId").orElse(""); } | ||
|
||
default String apiToken() { | ||
if (this.uri().contains("localhost")) { |
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.
This is always required for V1, did V1 mandate auth while V2 does not?
import java.util.stream.Stream; | ||
import java.util.stream.StreamSupport; | ||
|
||
class Streams { |
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.
Why is this needed, would not calling StreamSupport.stream
be ok (the rest of the codebase does that)?
I think if we can agree that dropping the parallel parameter has some value that worth the change, we can do it everywhere but I would do it in a separate PR.
|
||
@SpringBootApplication(scanBasePackageClasses = PersonController.class) | ||
@EnableScheduling | ||
public class Dynatrace2Sample { |
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.
Since Spring Boot does not support it, this won't work. I would create the DynatraceMeterRegistry
@Bean
here.
# limitations under the License. | ||
# | ||
|
||
management.metrics.export.dynatrace2: |
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.
How about the deviceName
?
addCommonTags_groupName(); | ||
} | ||
|
||
private void addCommonTags_groupName() { |
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.
Could you please do camelCase?
@Override | ||
protected void publish() { | ||
NamingConvention lineProtocolNamingConvention = config().namingConvention(); | ||
MetricLineFactory metricLineFactory = new MetricLineFactory(clock, lineProtocolNamingConvention); |
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.
Why do we need a new instance every time?
List<String> metricLinesToSkip = metricLines.get(true); | ||
if (!metricLinesToSkip.isEmpty()) { | ||
logger.warn( | ||
"Dropping {} metric lines because are greater than line protocol max length limit ({}).", |
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 you sure this limit still exist? I did not see it in the docs.
*/ | ||
class LineProtocolFormatters { | ||
|
||
private static final DecimalFormat METRIC_VALUE_FORMAT = new DecimalFormat( |
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.
DecimalFormat
is not thread-safe, can it be used by multiple thread?
Closing in favor of #2581 |
Fix #2295 - Adding new implementation (dynatrace2) to make use of Dynatrace Metrics API v2