We have a check that enforces the total number of fields needs to be below a certain (configurable) threshold in each index. 

Runtime fields currently do not contribute to the count. There have been misunderstandings around this, caused by runtime fields not having a corresponding lucene field. Object fields and alias fields don't have corresponding lucene fields either yet they count towards the total fields limit.

The original goal of the total fields limit is to prevent a mappings explosion caused by a bogus document being indexed, as it would cause fields being dynamically added to the index mappings, which hinders stability due to the cluster state size of mappings as well as memory footprint of mappings in data nodes.

Runtime fields contribute to cluster state size and memory footprint of mappings like any other field, and they can be created dynamically when [`dynamic` is set to `runtime`](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic.html#dynamic-parameters). Currently a bogus document can cause a mappings explosion when `dynamic` is set to `runtime` which is a bug. For this reason runtime fields should be counted towards the total fields count.
server/src/internalClusterTest/java/org/elasticsearch/index/mapper/DynamicMappingIT.java
public void testDynamicRuntimeNoConflicts() {
        assertAcked(client().admin().indices().prepareCreate("test").setMapping("""
            {"_doc":{"dynamic":"runtime"}}""").get());
        List<IndexRequest> docs = new ArrayList<>();
        
        docs.add(new IndexRequest("test").source("one.two.three", new int[] { 1, 2, 3 }));
        docs.add(new IndexRequest("test").source("one.two", 3.5));
        docs.add(new IndexRequest("test").source("one", "one"));
        docs.add(new IndexRequest("test").source("""
            {"one":{"two": { "three": "three"}}}""", XContentType.JSON));
        Collections.shuffle(docs, random());
        BulkRequest bulkRequest = new BulkRequest();
        for (IndexRequest doc : docs) {
            bulkRequest.add(doc);
        }
        bulkRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
        BulkResponse bulkItemResponses = client().bulk(bulkRequest).actionGet();
        assertFalse(bulkItemResponses.buildFailureMessage(), bulkItemResponses.hasFailures());
        {
            SearchResponse searchResponse = client().prepareSearch("test").setQuery(new MatchQueryBuilder("one", "one")).get();
            assertEquals(1, searchResponse.getHits().getTotalHits().value);
        }
        {
            SearchResponse searchResponse = client().prepareSearch("test").setQuery(new MatchQueryBuilder("one.two", 3.5)).get();
            assertEquals(1, searchResponse.getHits().getTotalHits().value);
        }
        {
            SearchResponse searchResponse = client().prepareSearch("test").setQuery(new MatchQueryBuilder("one.two.three", "1")).get();
            assertEquals(1, searchResponse.getHits().getTotalHits().value);
        }