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

Don't send runtime field mappings when the field is not in use #139025

Closed
Tracked by #166175
ghudgins opened this issue Aug 17, 2022 · 5 comments
Closed
Tracked by #166175

Don't send runtime field mappings when the field is not in use #139025

ghudgins opened this issue Aug 17, 2022 · 5 comments
Labels
discuss Feature:Lens Feature:Search Querying infrastructure in Kibana Icebox impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated performance Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@ghudgins
Copy link

Describe the feature
Don't send runtime mapping when they aren't in use

Describe a specific use case for the feature:
When I have a runtime field defined
And I am not using it in a visualization
I need Lens to not send the runtime mapping
So I can avoid any extra cost having this mapping has <-- assumption here...does it cost anything? if not we can close this issue

See dont-request-me in below vis (that is only doing a date histogram of document counts)

{
  "aggs": {
    "0": {
      "date_histogram": {
        "field": "@timestamp",
        "fixed_interval": "30s",
        "time_zone": "America/New_York",
        "extended_bounds": {
          "min": 1660752918150,
          "max": 1660753818150
        }
      }
    }
  },
  "size": 0,
  "fields": [
    {
      "field": "@timestamp",
      "format": "date_time"
    },
    {
      "field": "timestamp",
      "format": "date_time"
    },
    {
      "field": "utc_time",
      "format": "date_time"
    }
  ],
  "script_fields": {},
  "stored_fields": [
    "*"
  ],
  "runtime_mappings": {
    "hour_of_day": {
      "type": "long",
      "script": {
        "source": "emit(doc['timestamp'].value.getHour());"
      }
    },
    "dont-request-me": {
      "type": "keyword",
      "script": {
        "source": "emit('yo');"
      }
    }
  },
  "_source": {
    "excludes": []
  },
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "range": {
            "@timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2022-08-17T16:15:18.150Z",
              "lte": "2022-08-17T16:30:18.150Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}
@ghudgins ghudgins added discuss Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Aug 17, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@ghudgins
Copy link
Author

CC @elastic/kibana-app-services in case this is actually an issue in your domain

@flash1293
Copy link
Contributor

Elasticsearch will only evaluate the fields if required (e.g. they are used in a filter or in an aggregation).

There is a cost attached to them as they have to be sent over the wire with every request so if there are a lot of large runtime fields it might have a certain impact because uploading bytes and Json serialization and parsing isn’t free.

however I don’t think it’s worth pursuing this as I don’t think it would make a significant difference in practice and it’s very hard to tell whether a runtime field is used or not (the benefit of runtime fields is that they behave like regular fields in almost every case so you can use them almost everywhere, in query DSL and so on).

I’d say let’s wait whether customers actually run into issues with this

@flash1293 flash1293 added Team:AppServicesSv and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Aug 17, 2022
@exalate-issue-sync exalate-issue-sync bot added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Aug 17, 2022
@exalate-issue-sync exalate-issue-sync bot changed the title [Lens] Don't send runtime field mappings when the field is not in use Don't send runtime field mappings when the field is not in use Aug 22, 2022
@petrklapka petrklapka added Feature:Search Querying infrastructure in Kibana Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. and removed Team:AppServicesSv labels Nov 23, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@davismcphee davismcphee added the loe:needs-research This issue requires some research before it can be worked on or estimated label Sep 8, 2023
@markov00 markov00 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@markov00 markov00 reopened this Jun 3, 2024
@kertal kertal added the Icebox label Sep 24, 2024
@kertal
Copy link
Member

kertal commented Sep 24, 2024

Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.

@kertal kertal closed this as not planned Won't fix, can't repro, duplicate, stale Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:Lens Feature:Search Querying infrastructure in Kibana Icebox impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:needs-research This issue requires some research before it can be worked on or estimated performance Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

No branches or pull requests

7 participants