-
Notifications
You must be signed in to change notification settings - Fork 990
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
Wavefront Proxy validation error with default uri
implementation
#3903
Comments
I tried to reproduce the issue you mentioned in a unit test, but it passes without issue. Could you please provide a unit test demonstrating how to reproduce the error you are seeing? @Test
void proxyConfigIsValid() {
WavefrontConfig config = new WavefrontConfig() {
@Override
public String get(String key) {
return null;
}
@Override
public String uri() {
return "proxy://example.com:2878";
}
};
assertThat(config.validate().isValid()).isTrue();
} |
I also tried one without overriding the default @Test
void proxyConfigIsValid() throws IOException {
Properties wavefrontProps = new Properties();
wavefrontProps.load(this.getClass().getResourceAsStream("/wavefront.properties"));
WavefrontConfig config = wavefrontProps::getProperty;
assertThat(config.validate().isValid()).isTrue();
} With the wavefront.uri=proxy://example.com:2878 |
Can you try the config below? WavefrontConfig config = new WavefrontConfig() {
@Override
public String get(String key) {
if (key.endsWith(".uri")) {
return "proxy://example.com:2878";
}
return null;
}
}; |
Hi @jonatan-ivanov @mrniko is the author of the sdk I was using. Would have to ask him but I think maybe was using an older version in his sdk but will see what he says. |
Here is the WavefrontConfig which works for all parameters except uri. WavefrontConfig config = new WavefrontConfig() {
@Override
public String uri() {
return uri;
}
@Override
public String get(String key) {
if (key.endsWith(".step")) {
return step;
}
if (key.endsWith(".batchSize")) {
return batchSize;
}
if (key.endsWith(".numThreads")) {
return numThreads;
}
if (key.endsWith(".uri")) {
return uri;
}
if (key.endsWith(".source")) {
return source;
}
if (key.endsWith(".apiToken")) {
return apiToken;
}
return null;
}
}; Does your answer mean that it's better to always return null in |
I see two issues with your example:
If I fix the compilation issues and substitute them with real values, it works for me, I don't get errors.
Did you see what @shakuzen did above in #3903 (comment)? |
The In your example, it looks like you already have everything in fields. You could override the implementation of each method to directly return the respective field. If you do that, there's no benefit to doing anything in the As Jonatan mentioned, the example you provided passes the test. In the second example, it would depend what the value of |
Sorry, my mistake. The config provided in this example won't work - #3903 (comment) if uri() method isn't overriden. Can you check that? |
I did try it, and the following test passes. Does that not pass for you? What are we missing? @Test
void proxyConfigIsValid() {
WavefrontConfig config = new WavefrontConfig() {
@Override
public String get(String key) {
if (key.endsWith(".uri")) {
return "proxy://example.com:2878";
}
return null;
}
};
assertThat(config.validate().isValid()).isTrue();
} |
Thank you for the provided test. Unfortunately, the test below will fail. WavefrontConfig config = new WavefrontConfig() {
@Override
public String get(String key) {
if (key.endsWith(".uri")) {
return "proxy://example.com:2878";
}
return null;
}
};
WavefrontMeterRegistry r = new WavefrontMeterRegistry(config, Clock.SYSTEM); |
Thanks for the complete test that reproduces it. Indeed that does not work due to the validation we're doing in the default |
uri
implementation
uri
implementationuri
implementation
Thank you! |
Using the Wavefront Proxy I keep getting a uri error
No matter how I try set up the url it reports its incorrect even though the uri is correct.
The text was updated successfully, but these errors were encountered: