-
Notifications
You must be signed in to change notification settings - Fork 31
Add build properties file in its own namespace to carry project versi… #78
base: master
Are you sure you want to change the base?
Changes from all commits
5f08e04
84a2092
81d3722
cd3e588
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
package com.wavefront.spring.autoconfigure; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.stream.Collectors; | ||
|
||
import com.wavefront.internal.reporter.WavefrontInternalReporter; | ||
import com.wavefront.internal_reporter_java.io.dropwizard.metrics5.MetricName; | ||
import com.wavefront.sdk.appagent.jvm.reporter.WavefrontJvmReporter; | ||
import com.wavefront.sdk.common.Utils; | ||
import com.wavefront.sdk.common.WavefrontSender; | ||
import com.wavefront.sdk.common.application.ApplicationTags; | ||
import io.micrometer.core.instrument.Tag; | ||
|
@@ -31,6 +36,7 @@ | |
@Configuration(proxyBeanMethods = false) | ||
@ConditionalOnBean(WavefrontSender.class) | ||
class WavefrontMetricsConfiguration { | ||
public static final String SDK_INTERNAL_METRIC_PREFIX = "~sdk.java.wavefront_spring_boot_starter"; | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
|
@@ -43,6 +49,18 @@ WavefrontJvmReporter wavefrontJvmReporter(WavefrontSender wavefrontSender, Appli | |
return reporter; | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
WavefrontInternalReporter wavefrontInternalReporter(WavefrontSender wavefrontSender, | ||
akodali18 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
WavefrontConfig wavefrontConfig) { | ||
WavefrontInternalReporter reporter = new WavefrontInternalReporter.Builder(). | ||
prefixedWith(SDK_INTERNAL_METRIC_PREFIX).withSource(wavefrontConfig.source()). | ||
build(wavefrontSender); | ||
Double sdkVersion = Utils.getSemVerGauge("wavefront-spring-boot"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is, for example, the current version There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see. I find it odd, but since this is internal for wavefront, if it works for you all then that's your business. I do worry that in communications between the wavefront team and others, this could be confusing if someone mentions the version of the wavefront-spring-boot-starter as |
||
reporter.newGauge(new MetricName("version", Collections.EMPTY_MAP), () -> (() -> sdkVersion)); | ||
reporter.start(1, TimeUnit.MINUTES); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd have hoped the metric can be added as just yet another metric that got exported rather than having a dedicated reporter with an hard-coded reporting period. If that's registering a metric with a certain name, how about defining a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @snicoll : The goal was to have a common place to report all internal sdk metrics. At Wavefront we use the prefix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If the naming convention normalization in Micrometer isn't correct for the Wavefront registry, we should fix that in Micrometer regardless of this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What Tommy said. I don't think exposing such a bean with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If someone lets me know what the correct set of allowed characters are, I can fix the sanitization in Micrometer. Or open an issue or pull request in Micrometer directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's a new feature so I am totally fine with that. This one is parked for |
||
return reporter; | ||
} | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
@ConditionalOnClass({ WavefrontMeterRegistry.class, MeterRegistryCustomizer.class }) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
project.version=${project.version} |
Uh oh!
There was an error while loading. Please reload this page.