Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Add build properties file in its own namespace to carry project versi… #78

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

akodali18
Copy link
Contributor

…on info.

Copy link
Collaborator

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a huge fan of shipping build.properties this way and would have preferred to use the manifest as I've explained in another issue. However, it looks like that ship has sailed.

wavefront-spring-boot-bom/pom.xml Outdated Show resolved Hide resolved
wavefront-spring-boot-bom/pom.xml Show resolved Hide resolved
Copy link
Collaborator

@snicoll snicoll left a 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 update. The internal reporter makes me a bit nervous and I wonder if there isn't a less invasive way to report that information.

Also paging @shakuzen if he has recommendations about exporting such information.

wavefront-spring-boot-bom/pom.xml Show resolved Hide resolved
build(wavefrontSender);
Double sdkVersion = Utils.getSemVerGauge("wavefront-spring-boot");
reporter.newGauge(new MetricName("version", Collections.EMPTY_MAP), () -> (() -> sdkVersion));
reporter.start(1, TimeUnit.MINUTES);
Copy link
Collaborator

Choose a reason for hiding this comment

The 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 MeterBinder ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 ~ to report internal metrics. I couldn't use a MeterBinder here as micrometer sanitizes the metric prefix ~sdk.* to _sdk.*.
Hence I created a WavefrontInternalReporter bean that could be used to report all internal diagnostic metrics for the SDK and as of now, ~sdk.java.wavefront_spring_boot_starter.version is the only internal metric.
Cc: @sushantdewan123 @hanwavefront

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't use a MeterBinder here as micrometer sanitizes the metric prefix ~sdk.* to _sdk.*.

If the naming convention normalization in Micrometer isn't correct for the Wavefront registry, we should fix that in Micrometer regardless of this change.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Tommy said.

I don't think exposing such a bean with @ConditionalOnMissingBean is warranted. If we want to expose such internal metrics regardless of users customisations, the user should not have a say about it. I also question the fact there is a 1 minute hardcoded in there.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

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.
Though I suppose that would only allow this to work as expected with the next patch version of Micrometer or later.

Copy link
Collaborator

@snicoll snicoll Oct 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that would only allow this to work as expected with the next patch version of Micrometer or later.

It's a new feature so I am totally fine with that. This one is parked for 2.1.0 anyway (which I expect us to build against Spring Boot 2.4.x).

WavefrontInternalReporter reporter = new WavefrontInternalReporter.Builder().
prefixedWith(SDK_INTERNAL_METRIC_PREFIX).withSource(wavefrontConfig.source()).
build(wavefrontSender);
Double sdkVersion = Utils.getSemVerGauge("wavefront-spring-boot");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is, for example, the current version 2.0.1 represented as a Double?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The 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 2.0003 instead of 2.0.3

@snicoll snicoll added this to the 2.1.0 milestone Oct 13, 2020
@snicoll snicoll removed this from the 2.1.0 milestone Nov 25, 2020
@snicoll
Copy link
Collaborator

snicoll commented Nov 25, 2020

I've removed this one for 2.1.0 and flagged it as blocked as we need some collaboration so that a WavefrontInternalReporter isn't required.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants