Skip to content

Changed sampling type env var and updated collector help text#3302

Merged
yurishkuro merged 6 commits intojaegertracing:masterfrom
joe-elliott:adaptive-config-cleanup
Oct 4, 2021
Merged

Changed sampling type env var and updated collector help text#3302
yurishkuro merged 6 commits intojaegertracing:masterfrom
joe-elliott:adaptive-config-cleanup

Conversation

@joe-elliott
Copy link
Copy Markdown
Member

Which problem is this PR solving?

Short description of the changes

As suggested here: jaegertracing/documentation#526

This PR renamed SAMPLING_TYPE env var to SAMPLING_CONFIG_TYPE. Additionally it extends the collector help text to include information about this new env var.

New text:

$ go run ./cmd/collector env
2021/10/04 10:00:45 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined

All command line options can be provided via environment variables by converting
their names to upper case and replacing punctuation with underscores. For example:

command line option                 environment variable
------------------------------------------------------------------
--cassandra.connections-per-host    CASSANDRA_CONNECTIONS_PER_HOST
--metrics-backend                   METRICS_BACKEND

The following configuration options are only available via environment variables:

SPAN_STORAGE_TYPE string         The type of backend [cassandra, opensearch, elasticsearch, memory, kafka, badger, grpc-plugin] used for trace storage. Multiple backends can be specified as comma-separated list, e.g. "cassandra,elasticsearch" (currently only for writing spans). Note that "kafka" is only valid in jaeger-collector; it is not a replacement for a proper storage backend, and only used as a buffer for spans when Jaeger is deployed in the collector+ingester configuration.  (default "cassandra")

DEPENDENCY_STORAGE_TYPE string   The type of backend used for service dependencies storage. (default "${SPAN_STORAGE_TYPE}")

SAMPLING_CONFIG_TYPE string      The method [file, adaptive] used for determining the sampling rates served to clients configured with remote sampling enabled. "file" uses a periodically reloaded file and "adaptive" dynamically adjusts sampling rates based on current traffic.  (default "file")

Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott joe-elliott requested a review from a team as a code owner October 4, 2021 14:01
@joe-elliott joe-elliott requested a review from yurishkuro October 4, 2021 14:01
@joe-elliott joe-elliott changed the title Changed sampling type env var name and updated help text Changed sampling type env var and updated collector help text Oct 4, 2021
Signed-off-by: Joe Elliott <number101010@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 4, 2021

Codecov Report

Merging #3302 (a7b20df) into master (2b7fb73) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3302      +/-   ##
==========================================
- Coverage   96.01%   95.98%   -0.04%     
==========================================
  Files         259      259              
  Lines       15413    15434      +21     
==========================================
+ Hits        14799    14814      +15     
- Misses        522      526       +4     
- Partials       92       94       +2     
Impacted Files Coverage Δ
cmd/env/command.go 100.00% <100.00%> (ø)
plugin/sampling/strategystore/factory.go 100.00% <100.00%> (ø)
plugin/sampling/strategystore/factory_config.go 100.00% <100.00%> (ø)
cmd/query/app/static_handler.go 95.80% <0.00%> (-1.20%) ⬇️
plugin/storage/badger/spanstore/reader.go 95.50% <0.00%> (-0.71%) ⬇️
plugin/storage/integration/integration.go 78.88% <0.00%> (-0.40%) ⬇️

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 2b7fb73...a7b20df. Read the comment docs.

Signed-off-by: Joe Elliott <number101010@gmail.com>
@joe-elliott
Copy link
Copy Markdown
Member Author

Updated to accept the SAMPLING_TYPE env var as a deprecated method of setting the sampling type and static as a deprecated value.

Preferred is SAMPLING_CONFIG_TYPE and file.

$ SAMPLING_TYPE=static go run ./cmd/collector
2021/10/04 15:58:17 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
WARNING: Using deprecated 'SAMPLING_TYPE' env var. Please switch to 'SAMPLING_CONFIG_TYPE'.
WARNING: Using deprecated 'static' value for SAMPLING_CONFIG_TYPE. Please switch to 'file'.
{"level":"info","ts":1633377497.5333173,"caller":"flags/service.go:117","msg":"Mounting metrics handler on admin server","route":"/metrics"}
...

Signed-off-by: Joe Elliott <number101010@gmail.com>
strategyStoreType := getStrategyStoreTypeFromEnv(log)
if strategyStoreType != samplingTypeAdaptive &&
strategyStoreType != samplingTypeFile &&
strategyStoreType != deprecatedSamplingTypeStatic {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it might be even cleaner if you check for and override static in getStrategyStoreTypeFromEnv, because there was no release where SAMPLING_CONFIG_TYPE=static was valid.

yurishkuro
yurishkuro previously approved these changes Oct 4, 2021
Signed-off-by: Joe Elliott <number101010@gmail.com>
@yurishkuro yurishkuro enabled auto-merge (squash) October 4, 2021 20:46
@yurishkuro yurishkuro merged commit b5c451a into jaegertracing:master Oct 4, 2021
@joe-elliott joe-elliott added this to the v1.27.0 milestone Oct 6, 2021
yurishkuro added a commit that referenced this pull request Sep 9, 2023
#4735)

These were deprecated in 2021 (#3302)

---------

Signed-off-by: Yuri Shkuro <github@ysh.us>
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