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

[Metrics UI] Move source API metrics routes source to HTTP #53138

Closed
simianhacker opened this issue Dec 16, 2019 · 7 comments
Closed

[Metrics UI] Move source API metrics routes source to HTTP #53138

simianhacker opened this issue Dec 16, 2019 · 7 comments
Labels
Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@simianhacker
Copy link
Member

simianhacker commented Dec 16, 2019

Currently the source API queries too much data because of how the fields filtering works. We should create a new API just for the fields that also takes into account the date range of the page.

We should separate the queries between static source configuration vs. field metadata and move the API out of GraphQL to HTTP instead.

Notes:

  • We can separate this into two tickets if necessary, but if it's simple enough let's do it in one
  • We can also defer this lookup so that it doesn't happen on initial load.
@simianhacker simianhacker added Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Dec 16, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@simianhacker
Copy link
Member Author

I think we should do both phase 1 and phase 2 at the same time. This API is the last thing to be migrated for the Metrics UI. It makes sense for the same engineer to tackle this all at once.

@weltenwort
Copy link
Member

I would be interested in taking this on.

@simianhacker simianhacker removed their assignment Feb 3, 2020
@simianhacker
Copy link
Member Author

@weltenwort I removed myself from the assignees, it's all yours.

@cpmoore
Copy link

cpmoore commented Feb 25, 2020

Is this on the road map for 7.7 or 8.0?
There seems to have been a change in 7.6.0 that dramatically increases the time the current version of the fields request takes, in addition to maxing out the cpu on my data nodes while the request in processing.

This is part of the output from _nodes/hot_threads it looks like a fields request to me

::: {eswk01.log1.corp.fin}{qqb3aC2bSnqT9vECUZfVXw}{2Px4cyprSciAxo2X1be__g}{eswk01.log1.corp.fin}{10.239.75.33:9300}{di}{xpack.installed=true}
   Hot threads at 2020-02-25T14:34:14.261Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:

   100.7% (503.6ms out of 500ms) cpu usage by thread 'elasticsearch[eswk01.log1.corp.fin][search][T#22]'
     2/10 snapshots sharing following 48 elements
       app//org.apache.lucene.codecs.lucene80.Lucene80DocValuesProducer.getSortedSet(Lucene80DocValuesProducer.java:1248)
       app//org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat$FieldsReader.getSortedSet(PerFieldDocValuesFormat.java:341)
       app//org.apache.lucene.index.CodecReader.getSortedSetDocValues(CodecReader.java:178)
       app//org.apache.lucene.index.FilterLeafReader.getSortedSetDocValues(FilterLeafReader.java:404)
       app//org.apache.lucene.index.DocValues.getSortedSet(DocValues.java:406)
       app//org.elasticsearch.index.fielddata.plain.SortedSetDVBytesAtomicFieldData.getOrdinalsValues(SortedSetDVBytesAtomicFieldData.java:52)
       app//org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalsIndexFieldData$Consumer.getOrLoadTermsEnums(GlobalOrdinalsIndexFieldData.java:155)
       app//org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalsIndexFieldData$Consumer.access$500(GlobalOrdinalsIndexFieldData.java:138)
       app//org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalsIndexFieldData$Consumer$1.getOrdinalsValues(GlobalOrdinalsIndexFieldData.java:213)
       app//org.elasticsearch.search.aggregations.support.ValuesSource$Bytes$WithOrdinals$FieldData.globalOrdinalsValues(ValuesSource.java:187)
       app//org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.getGlobalOrds(GlobalOrdinalsStringTermsAggregator.java:126)
       app//org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.getLeafCollector(GlobalOrdinalsStringTermsAggregator.java:131)
       app//org.elasticsearch.search.aggregations.AggregatorBase.getLeafCollector(AggregatorBase.java:169)
       app//org.elasticsearch.search.aggregations.AggregatorBase.getLeafCollector(AggregatorBase.java:42)
       app//org.apache.lucene.search.MultiCollector.getLeafCollector(MultiCollector.java:124)
       app//org.elasticsearch.search.internal.ContextIndexSearcher.searchLeaf(ContextIndexSearcher.java:186)
       app//org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:171)
       app//org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
       app//org.elasticsearch.search.query.QueryPhase.searchWithCollector(QueryPhase.java:333)
       app//org.elasticsearch.search.query.QueryPhase.executeInternal(QueryPhase.java:295)
       app//org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:134)
       app//org.elasticsearch.indices.IndicesService.lambda$loadIntoContext$19(IndicesService.java:1335)
       app//org.elasticsearch.indices.IndicesService$$Lambda$5107/0x0000000801a39440.accept(Unknown Source)
       app//org.elasticsearch.indices.IndicesService.lambda$cacheShardLevelResult$20(IndicesService.java:1392)
       app//org.elasticsearch.indices.IndicesService$$Lambda$5113/0x0000000801a3ac40.get(Unknown Source)
       app//org.elasticsearch.indices.IndicesRequestCache$Loader.load(IndicesRequestCache.java:174)
       app//org.elasticsearch.indices.IndicesRequestCache$Loader.load(IndicesRequestCache.java:157)
       app//org.elasticsearch.common.cache.Cache.computeIfAbsent(Cache.java:433)
       app//org.elasticsearch.indices.IndicesRequestCache.getOrCompute(IndicesRequestCache.java:123)
       app//org.elasticsearch.indices.IndicesService.cacheShardLevelResult(IndicesService.java:1398)
       app//org.elasticsearch.indices.IndicesService.loadIntoContext(IndicesService.java:1332)
       app//org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:336)
       app//org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:358)
       app//org.elasticsearch.search.SearchService.lambda$executeQueryPhase$1(SearchService.java:343)
       app//org.elasticsearch.search.SearchService$$Lambda$4801/0x00000008019ac440.apply(Unknown Source)
       app//org.elasticsearch.action.ActionListener.lambda$map$2(ActionListener.java:146)
       app//org.elasticsearch.action.ActionListener$$Lambda$4077/0x00000008017c8840.accept(Unknown Source)
       app//org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63)
       app//org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58)
       app//org.elasticsearch.action.ActionRunnable$$Lambda$4833/0x00000008019b4440.accept(Unknown Source)
       app//org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
       app//org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44)
       app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:692)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
       [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       [email protected]/java.lang.Thread.run(Thread.java:830)
     7/10 snapshots sharing following 20 elements
       app//org.elasticsearch.indices.IndicesRequestCache.getOrCompute(IndicesRequestCache.java:123)
       app//org.elasticsearch.indices.IndicesService.cacheShardLevelResult(IndicesService.java:1398)
       app//org.elasticsearch.indices.IndicesService.loadIntoContext(IndicesService.java:1332)
       app//org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:336)
       app//org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:358)
       app//org.elasticsearch.search.SearchService.lambda$executeQueryPhase$1(SearchService.java:343)
       app//org.elasticsearch.search.SearchService$$Lambda$4801/0x00000008019ac440.apply(Unknown Source)
       app//org.elasticsearch.action.ActionListener.lambda$map$2(ActionListener.java:146)
       app//org.elasticsearch.action.ActionListener$$Lambda$4077/0x00000008017c8840.accept(Unknown Source)
       app//org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63)
       app//org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58)
       app//org.elasticsearch.action.ActionRunnable$$Lambda$4833/0x00000008019b4440.accept(Unknown Source)
       app//org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
       app//org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44)
       app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:692)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
       [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       [email protected]/java.lang.Thread.run(Thread.java:830)
     unique snapshot
       app//org.elasticsearch.common.collect.CopyOnWriteHashMap$InnerNode.visit(CopyOnWriteHashMap.java:278)
       app//org.elasticsearch.common.collect.CopyOnWriteHashMap$EntryIterator.next(CopyOnWriteHashMap.java:454)
       app//org.elasticsearch.common.collect.CopyOnWriteHashMap$EntryIterator.next(CopyOnWriteHashMap.java:431)
       [email protected]/java.util.AbstractMap$2$1.next(AbstractMap.java:418)
       app//org.elasticsearch.index.mapper.FieldTypeLookup.simpleMatchToFullName(FieldTypeLookup.java:198)
       app//org.elasticsearch.index.mapper.MapperService.simpleMatchToFullName(MapperService.java:770)
       app//org.elasticsearch.index.query.QueryShardContext.simpleMatchToIndexNames(QueryShardContext.java:231)
       app//org.elasticsearch.index.search.QueryParserHelper.resolveMappingField(QueryParserHelper.java:134)
       app//org.elasticsearch.index.search.QueryParserHelper.resolveMappingFields(QueryParserHelper.java:90)
       app//org.elasticsearch.index.search.QueryParserHelper.resolveMappingFields(QueryParserHelper.java:70)
       app//org.elasticsearch.index.query.QueryStringQueryBuilder.doToQuery(QueryStringQueryBuilder.java:865)
       app//org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:99)
       app//org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregatorFactory.<init>(FiltersAggregatorFactory.java:60)
       app//org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregationBuilder.doBuild(FiltersAggregationBuilder.java:225)
       app//org.elasticsearch.search.aggregations.AbstractAggregationBuilder.build(AbstractAggregationBuilder.java:139)
       app//org.elasticsearch.search.aggregations.AggregatorFactories$Builder.build(AggregatorFactories.java:321)
       app//org.elasticsearch.search.SearchService.parseSource(SearchService.java:796)
       app//org.elasticsearch.search.SearchService.createContext(SearchService.java:591)
       app//org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:550)
       app//org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:351)
       app//org.elasticsearch.search.SearchService.lambda$executeQueryPhase$1(SearchService.java:343)
       app//org.elasticsearch.search.SearchService$$Lambda$4801/0x00000008019ac440.apply(Unknown Source)
       app//org.elasticsearch.action.ActionListener.lambda$map$2(ActionListener.java:146)
       app//org.elasticsearch.action.ActionListener$$Lambda$4077/0x00000008017c8840.accept(Unknown Source)
       app//org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63)
       app//org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:58)
       app//org.elasticsearch.action.ActionRunnable$$Lambda$4833/0x00000008019b4440.accept(Unknown Source)
       app//org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:73)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
       app//org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:44)
       app//org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:692)
       app//org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
       [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       [email protected]/java.lang.Thread.run(Thread.java:830)

@weltenwort
Copy link
Member

weltenwort commented May 5, 2020

ℹ️ the logs ui equivalent of this has been implemented in #64021, which should be used as a template for the resolution to this task

@weltenwort weltenwort removed their assignment May 5, 2020
@jasonrhodes jasonrhodes added this to the Metrics UI 7.10 milestone Jul 21, 2020
@jasonrhodes jasonrhodes changed the title [Metrics UI] Move Fields from Source API to separate API [Metrics UI] Move source API metrics routes source to HTTP Jul 28, 2020
@sgrodzicki sgrodzicki removed this from the Metrics UI 7.10 milestone Sep 28, 2020
@sgrodzicki sgrodzicki added this to the Metrics UI 7.11 milestone Oct 6, 2020
@smith
Copy link
Contributor

smith commented Feb 27, 2023

Not prioritizing this at this time.

@smith smith closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
@zube zube bot closed this as completed May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

No branches or pull requests

9 participants