Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
albertteoh committed Sep 4, 2020
1 parent 9ebf9d3 commit c7af448
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ Changes by Version
### Backend Changes

#### Breaking Changes
* Configurable ES doc count ([#2453](https://github.com/jaegertracing/jaeger/pull/2453), [@albertteoh](https://github.com/albertteoh))

The `--es.max-num-spans` flag has been deprecated in favour of `--es.max-doc-count`.
`--es.max-num-spans` is marked for removal in v1.21.0 as indicated in the flag description.

If both `--es.max-num-spans` and `--es.max-doc-count` are set, the lesser of the two will be used.

The use of `--es.max-doc-count` (which defaults to 10,000) will limit the results from all Elasticsearch
queries by the configured value, limiting counts for Jaeger UI:

* Services
* Operations
* Dependencies (edges in a dependency graph)
* Span fetch size for a trace

#### New Features

Expand Down
14 changes: 6 additions & 8 deletions plugin/storage/es/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ func addFlags(flagSet *flag.FlagSet, nsConfig *namespaceConfig) {
flagSet.Int(
nsConfig.namespace+suffixMaxNumSpans,
nsConfig.MaxDocCount,
"(deprecated, will be removed in release v1.21.0. Please use es.max-doc-count). The maximum number of spans to fetch at a time per query in Elasticsearch")
"(deprecated, will be removed in release v1.21.0. Please use es.max-doc-count). "+
"The maximum number of spans to fetch at a time per query in Elasticsearch. "+
"The lesser of es.max-num-spans and es.max-doc-count will be used if both are set.")
flagSet.Int64(
nsConfig.namespace+suffixNumShards,
nsConfig.NumShards,
Expand Down Expand Up @@ -288,15 +290,11 @@ func initFromViper(cfg *namespaceConfig, v *viper.Viper) {
cfg.CreateIndexTemplates = v.GetBool(cfg.namespace + suffixCreateIndexTemplate)
cfg.Version = uint(v.GetInt(cfg.namespace + suffixVersion))

maxNumSpans := v.GetInt(cfg.namespace + suffixMaxNumSpans)
cfg.MaxDocCount = v.GetInt(cfg.namespace + suffixMaxDocCount)

if maxNumSpans != 0 {
if cfg.MaxDocCount != 0 {
cfg.MaxDocCount = int(math.Min(float64(maxNumSpans), float64(cfg.MaxDocCount)))
} else {
cfg.MaxDocCount = maxNumSpans
}
if v.IsSet(cfg.namespace + suffixMaxNumSpans) {
maxNumSpans := v.GetInt(cfg.namespace + suffixMaxNumSpans)
cfg.MaxDocCount = int(math.Min(float64(maxNumSpans), float64(cfg.MaxDocCount)))
}

// TODO: Need to figure out a better way for do this.
Expand Down

0 comments on commit c7af448

Please sign in to comment.