Skip to content
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

make default maxSpans for zipkin endpoint configurable #19

Merged
merged 4 commits into from
Dec 6, 2024

Conversation

autata
Copy link
Collaborator

@autata autata commented Dec 4, 2024

Summary

This makes the default maxSpans for the zipkin API configurable and sets the default to 20k which is what it is hardcoded as right now.

To note: the param maxSpans does exist, but the grafana zipkin plugin does not support using that. So it makes sense for us to configure this default at the stack level as well.

Requirements

@autata autata force-pushed the configure-max-spans branch from 08563c0 to 1731db9 Compare December 4, 2024 21:19
@autata autata marked this pull request as ready for review December 4, 2024 21:22
Copy link

@baroquebobcat baroquebobcat left a comment

Choose a reason for hiding this comment

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

LGTM modulo a request for a test, docs and adding a validation check.

@@ -34,7 +34,7 @@ public class ZipkinServiceTest {
@BeforeEach
public void setup() throws IOException {
MockitoAnnotations.openMocks(this);
zipkinService = spy(new ZipkinService(searcher));
zipkinService = spy(new ZipkinService(searcher, 20000));

Choose a reason for hiding this comment

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

I think it'd be good to add a test of the max behavior before upstreaming. Now that it's configureable, it'd probably be easier to construct a test case with a service object that has a really small max.

@@ -50,6 +50,7 @@ queryConfig:
serverAddress: ${ASTRA_QUERY_SERVER_ADDRESS:-localhost}
requestTimeoutMs: ${ASTRA_QUERY_REQUEST_TIMEOUT_MS:-5000}
defaultQueryTimeoutMs: ${ASTRA_QUERY_DEFAULT_QUERY_TIMEOUT_MS:-3000}
zipkinDefaultMaxSpans: ${ASTRA_QUERY_ZIPKIN_DEFAULT_MAX_SPANS:-20000}

Choose a reason for hiding this comment

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

Also, adding docs for zipkinDefaultMaxSpans hereish: https://github.com/airbnb/kaldb/blob/airbnb-main/docs/topics/Config-options.md?plain=1#L315 would be good.

.withAnnotatedService(
new ZipkinService(
astraDistributedQueryService,
astraConfig.getQueryConfig().getZipkinDefaultMaxSpans()))

Choose a reason for hiding this comment

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

I think it'd be good to add a precondition for the zipkinDefaultMaxSpans value. Maybe add another checkArgument call for it in ValidateAstraConfig.validateQueryConfig?

@autata autata force-pushed the configure-max-spans branch from c69374f to 0b8a9d8 Compare December 6, 2024 18:33
@autata autata force-pushed the configure-max-spans branch from 685631d to a14240d Compare December 6, 2024 18:48
@autata autata changed the title make maxSpans for zipkin endpoint configurable make default maxSpans for zipkin endpoint configurable Dec 6, 2024
set reasonable default so checks pass
@autata autata force-pushed the configure-max-spans branch from ae420f7 to 4660563 Compare December 6, 2024 20:08
@autata autata merged commit 471edf9 into airbnb-main Dec 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants