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

Expose tunning options via expvar #2496

Merged
merged 12 commits into from
Oct 5, 2020

Conversation

dstdfx
Copy link
Contributor

@dstdfx dstdfx commented Sep 21, 2020

Which problem is this PR solving?

Short description of the changes

  • Mounts expvar handler (/debug/vars) on the admin port regardless of --metrics-backend
  • Stores the following collector's options in expvar:
    • collector.num-workers
    • collector.queue-size
  • Store the following agent's options in expvar:
    • processor.*.server-max-packet-size
    • processor.*.server-queue-size
    • processor.*.workers
  • Store the following storage-related options in expvar:
    • memory.max-traces
    • downsampling.ratio
    • span-storage.type

@dstdfx dstdfx requested a review from a team as a code owner September 21, 2020 06:50
@jpkrohling jpkrohling self-assigned this Sep 21, 2020
@dstdfx
Copy link
Contributor Author

dstdfx commented Sep 21, 2020

@jpkrohling
Copy link
Contributor

This test has indeed been flaky...

@codecov
Copy link

codecov bot commented Sep 21, 2020

Codecov Report

Merging #2496 into master will decrease coverage by 0.03%.
The diff coverage is 89.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2496      +/-   ##
==========================================
- Coverage   95.36%   95.33%   -0.04%     
==========================================
  Files         208      208              
  Lines        9222     9248      +26     
==========================================
+ Hits         8795     8817      +22     
- Misses        350      354       +4     
  Partials       77       77              
Impacted Files Coverage Δ
cmd/collector/app/builder_flags.go 100.00% <ø> (ø)
cmd/flags/service.go 0.00% <0.00%> (ø)
cmd/agent/app/builder.go 95.89% <100.00%> (+0.57%) ⬆️
cmd/agent/app/flags.go 91.66% <100.00%> (ø)
cmd/collector/app/collector.go 69.44% <100.00%> (+1.79%) ⬆️
plugin/storage/factory.go 98.07% <100.00%> (+0.11%) ⬆️
plugin/storage/memory/factory.go 100.00% <100.00%> (ø)
...lugin/sampling/strategystore/adaptive/processor.go 99.07% <0.00%> (-0.93%) ⬇️
plugin/storage/integration/integration.go 77.90% <0.00%> (+0.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f3b832...e877351. Read the comment docs.

@jpkrohling
Copy link
Contributor

Tests are passing now :-)

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

I like the base idea, but I think the actual registration with expvar could be closer to where the values are used or defined.

I would also love to see other values, although they might come in a later PR:

--memory.max-traces
--span-storage.type (not sure the storate type is actually stored there)
--downsampling.ratio

cmd/agent/app/flags_test.go Outdated Show resolved Hide resolved
cmd/agent/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Looks good to me. One thing that we might want to add is the storage type. What do you think?

@dstdfx
Copy link
Contributor Author

dstdfx commented Sep 22, 2020

Sure, wilco

@dstdfx
Copy link
Contributor Author

dstdfx commented Sep 22, 2020

@jpkrohling
Copy link
Contributor

Doesn't sound like it, looks like it's a real problem with the new test:

github.com/jaegertracing/jaeger/plugin/storage.TestSetExpvarOptions(0xc000229080)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/plugin/storage/factory_test.go:364 +0x337

@dstdfx
Copy link
Contributor Author

dstdfx commented Sep 22, 2020

Doesn't sound like it, looks like it's a real problem with the new test:

github.com/jaegertracing/jaeger/plugin/storage.TestSetExpvarOptions(0xc000229080)
	/home/travis/gopath/src/github.com/jaegertracing/jaeger/plugin/storage/factory_test.go:364 +0x337

My bad, didn't notice...

cmd/agent/main.go Outdated Show resolved Hide resolved
cmd/agent/main.go Outdated Show resolved Hide resolved
Always mount expvar /debug/vars handler
regardless of chosen metrics backend.

Store the following collector's options in expvar:
- collector.num-workers
- collector.queue-size

Store the following agent's options in expvar:
- processor.*.server-max-packet-size
- processor.*.server-queue-size
- processor.*.workers

Signed-off-by: Daniil Rutskiy <[email protected]>
Signed-off-by: Daniil Rutskiy <[email protected]>
Put expvar logic into private funcs of builders.

Use different values in tests.

Signed-off-by: Daniil Rutskiy <[email protected]>
Store following storage-related options in expvar:
- memory.max-traces
- downsampling.ratio

Signed-off-by: Daniil Rutskiy <[email protected]>
Signed-off-by: Daniil Rutskiy <[email protected]>
Signed-off-by: Daniil Rutskiy <[email protected]>
Signed-off-by: Daniil Rutskiy <[email protected]>
Delete direct expvar calls.

Vendor latest jaeger-lib.

Signed-off-by: Daniil Rutskiy <[email protected]>
Signed-off-by: Daniil Rutskiy <[email protected]>
Signed-off-by: Daniil Rutskiy <[email protected]>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Looks great! The only question is about otel/go.mod

cmd/opentelemetry/go.mod Show resolved Hide resolved
@yurishkuro
Copy link
Member

I am going to merge it, please put another PR for otel/go.mod

@yurishkuro yurishkuro merged commit fe84288 into jaegertracing:master Oct 5, 2020
@dstdfx dstdfx deleted the expose-opts-via-expvar branch October 5, 2020 19:45
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.

Expose the tuning options via expvar
3 participants