docs: String spanIndexTemplate() {
      String result =
          "{\n"
              + "  \"TEMPLATE\": \"${__INDEX__}:"
              + SPAN
              + "-*\",\n"
              + "  \"settings\": {\n"
              + "    \"index.number_of_shards\": ${__NUMBER_OF_SHARDS__},\n"
              + "    \"index.number_of_replicas\": ${__NUMBER_OF_REPLICAS__},\n"
              + "    \"index.requests.cache.enable\": true,\n"
              + "    \"index.mapper.dynamic\": false,\n"
              + "    \"analysis\": {\n"
              + "      \"analyzer\": {\n"
              + "        \"traceId_analyzer\": {\n"
              + "          \"type\": \"custom\",\n"
              + "          \"tokenizer\": \"keyword\",\n"
              + "          \"filter\": \"traceId_filter\"\n"
              + "        }\n"
              + "      },\n"
              + "      \"filter\": {\n"
              + "        \"traceId_filter\": {\n"
              + "          \"type\": \"pattern_capture\",\n"
              + "          \"patterns\": [\"([0-9a-f]{1,16})$\"],\n"
              + "          \"preserve_original\": true\n"
              + "        }\n"
              + "      }\n"
              + "    }\n"
              + "  },\n";
      if (searchEnabled) {
        return result
            + ("  \"mappings\": {\n"
                + "    \"_default_\": {\n"
                + "      DISABLE_ALL" // don't concat all fields into big string
                + "      \"dynamic_templates\": [\n"
                + "        {\n"
                + "          \"strings\": {\n"
                + "            \"mapping\": {\n"
                + "              KEYWORD,\n"
                + "              \"ignore_above\": 256\n"
                + "            },\n"
                + "            \"match_mapping_type\": \"string\",\n"
                + "            \"match\": \"*\"\n"
                + "          }\n"
                + "        }\n"
                + "      ]\n"
                + "    },\n"
                + "    \""
                + SPAN
                + "\": {\n"
                + "      \"_source\": {\"excludes\": [\"_q\"] },\n"
                + "      \"properties\": {\n"
                + "        \"traceId\": ${__TRACE_ID_MAPPING__},\n"
                + "        \"name\": { KEYWORD },\n"
                + "        \"localEndpoint\": {\n"
                + "          \"type\": \"object\",\n"
                + "          \"dynamic\": false,\n"
                + "          \"properties\": { \"serviceName\": { KEYWORD } }\n"
                + "        },\n"
                + "        \"remoteEndpoint\": {\n"
                + "          \"type\": \"object\",\n"
                + "          \"dynamic\": false,\n"
                + "          \"properties\": { \"serviceName\": { KEYWORD } }\n"
                + "        },\n"
                + "        \"timestamp_millis\": {\n"
                + "          \"type\":   \"date\",\n"
                + "          \"format\": \"epoch_millis\"\n"
                + "        },\n"
                + "        \"duration\": { \"type\": \"long\" },\n"
                + "        \"annotations\": { \"enabled\": false },\n"
                + "        \"tags\": { \"enabled\": false },\n"
                + "        \"_q\": { KEYWORD }\n"
                + "      }\n"
                + "    }\n"
                + "  }\n"
                + "}");
      }
      return result
          + ("  \"mappings\": {\n"
              + "    \"_default_\": { DISABLE_ALL },\n"
              + "    \""
              + SPAN
              + "\": {\n"
              + "      \"properties\": {\n"
              + "        \"traceId\": ${__TRACE_ID_MAPPING__},\n"
              + "        \"annotations\": { \"enabled\": false },\n"
              + "        \"tags\": { \"enabled\": false }\n"
              + "      }\n"
              + "    }\n"
              + "  }\n"
              + "}");
    }