Skip to content

Commit

Permalink
compatible with multiple versions of es
Browse files Browse the repository at this point in the history
  • Loading branch information
zhixiongdu027 committed Aug 15, 2022
1 parent 33934a5 commit c2c3d27
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 71 deletions.
4 changes: 2 additions & 2 deletions helm/tarsframework/templates/tars-tarslog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ metadata:
tars.io/ServerApp: tars
tars.io/ServerName: tarslog
tars.io/SubType: tars
tars.io/Template: tars.es
tars.io/Template: tars.cpp
spec:
app: tars
server: tarslog
subType: tars
tars:
template: tars.es
template: tars.cpp
profile: |
<tars>
<log>
Expand Down
189 changes: 159 additions & 30 deletions src/LogServer/ESIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,70 @@ constexpr char LogIndexTemplate[] = R"(
"mappings": {
"properties": {
"trace": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"span": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"parent": {
"type": "keyword"
},
"type": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"master": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"slave": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"function": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"time": {
"type": "long"
},
"type": {
"type": "text"
},
"ret": {
"type": "keyword"
"type": "text"
},
"data": {
"type": "keyword"
"type": "text"
}
}
}
Expand All @@ -53,13 +89,31 @@ constexpr char TraceIndexTemplate[] = R"(
"mappings": {
"properties": {
"trace": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"tSpan": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"tMaster": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"tsTime": {
"type": "long"
Expand All @@ -68,25 +122,61 @@ constexpr char TraceIndexTemplate[] = R"(
"type": "long"
},
"sHash": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"fHash": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"spans": {
"type": "nested",
"properties": {
"span": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"parent": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"master": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"slave": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"csTime": {
"type": "long"
Expand All @@ -101,22 +191,37 @@ constexpr char TraceIndexTemplate[] = R"(
"type": "long"
},
"csData": {
"type": "keyword"
"type": "text"
},
"srData": {
"type": "keyword"
"type": "text"
},
"ssData": {
"type": "keyword"
"type": "text"
},
"crData": {
"type": "keyword"
"type": "text"
},
"ret": {
"type": "keyword"
"type": "text"
},
"children": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"function": {
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
}
}
}
Expand All @@ -131,13 +236,25 @@ constexpr char GraphIndexTemplate[] = R"(
"mappings": {
"properties": {
"type": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"vertexes": {
"type": "nested",
"properties": {
"vertex": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"callCount": {
"type": "long"
Expand All @@ -151,10 +268,22 @@ constexpr char GraphIndexTemplate[] = R"(
"type": "nested",
"properties": {
"fromVertex": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"toVertex": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
}
},
"callCount": {
"type": "long"
Expand Down
Loading

0 comments on commit c2c3d27

Please sign in to comment.