Skip to content

Instantly share code, notes, and snippets.

@Stono
Created August 3, 2023 09:39
Show Gist options
  • Save Stono/ee850350d4e798bd69e1300d2a4ed203 to your computer and use it in GitHub Desktop.
Save Stono/ee850350d4e798bd69e1300d2a4ed203 to your computer and use it in GitHub Desktop.
An optimised index template for Jaeger with Istio
{
"index_patterns": [
"testing-jaeger-span*",
"dev-jaeger-span*",
"preprod-jaeger-span*",
"prod-jaeger-span*",
"bcp-jaeger-span*"
],
"template": {
"settings": {
"analysis": {
"char_filter": {
"custom_regex_split": {
"type": "pattern_replace",
"pattern": "(https?)://([^/\\?]+)(/[^\\?]+)?\\??(.*)?",
"replacement": "$1_SPLIT_$2_SPLIT_$3_SPLIT_$4"
}
},
"tokenizer": {
"url_tokenizer": {
"type": "pattern",
"pattern": "_SPLIT_|&"
}
},
"filter": {
"remove_split": {
"type": "pattern_replace",
"pattern": "_split_",
"replacement": ""
},
"remove_empty_filter": {
"type": "stop",
"stopwords": [""]
}
},
"analyzer": {
"custom_url_analyzer": {
"type": "custom",
"tokenizer": "url_tokenizer",
"char_filter": ["custom_regex_split"],
"filter": ["lowercase", "remove_split", "remove_empty_filter"]
}
}
},
"number_of_shards": 30,
"number_of_replicas": 1,
"index": {
"queries": {
"cache": { "enabled": false }
},
"requests": {
"cache": {
"enable": true
}
},
"mapping": {
"nested_fields": {
"limit": 50
}
}
},
"lifecycle": {
"name": "custom-jaeger"
}
},
"mappings": {
"dynamic_templates": [
{
"http_url": {
"mapping": {
"type": "text",
"analyzer": "custom_url_analyzer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
}
}
},
"path_match": "tag.http@url"
}
},
{
"upstream_cluster": {
"mapping": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"path_match": "tag.upstream_cluster"
}
},
{
"span_tags_map": {
"mapping": {
"type": "keyword",
"ignore_above": 256
},
"path_match": "tag.*"
}
},
{
"process_tags_map": {
"mapping": {
"type": "keyword",
"ignore_above": 256
},
"path_match": "process.tag.*"
}
}
],
"properties": {
"traceID": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"parentSpanID": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"spanID": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"operationName": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"startTime": {
"type": "long"
},
"startTimeMillis": {
"type": "date",
"format": "epoch_millis"
},
"duration": {
"type": "long"
},
"flags": {
"type": "integer"
},
"logs": {
"type": "nested",
"dynamic": false,
"properties": {
"timestamp": {
"type": "long"
},
"fields": {
"type": "nested",
"dynamic": false,
"properties": {
"key": {
"type": "keyword",
"ignore_above": 256
},
"value": {
"type": "keyword",
"ignore_above": 256
},
"tagType": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"process": {
"properties": {
"serviceName": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"tag": {
"type": "object"
},
"tags": {
"type": "nested",
"dynamic": false,
"properties": {
"key": {
"type": "keyword",
"ignore_above": 256
},
"value": {
"type": "keyword",
"ignore_above": 256
},
"tagType": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"references": {
"type": "nested",
"dynamic": false,
"properties": {
"refType": {
"type": "keyword",
"ignore_above": 256
},
"traceID": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
},
"spanID": {
"type": "keyword",
"ignore_above": 256,
"eager_global_ordinals": true
}
}
},
"tag": {
"type": "object"
},
"tags": {
"type": "nested",
"dynamic": false,
"properties": {
"key": {
"type": "keyword",
"ignore_above": 256
},
"value": {
"type": "keyword",
"ignore_above": 256
},
"tagType": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
},
"composed_of": ["custom-default"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment