Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions internal/storage/elasticsearch/dbmodel/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type Span struct {
Tag map[string]any `json:"tag,omitempty"`
Logs []Log `json:"logs"`
Process Process `json:"process,omitempty"`
Scope Scope `json:"scope,omitempty"`
}

// Reference is a reference from one span to another
Expand Down Expand Up @@ -120,3 +121,10 @@ type TraceQueryParameters struct {
// TODO: Rename NumTraces to SearchDepth
NumTraces int
}

type Scope struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Tags []KeyValue `json:"tags,omitempty"`
Tag map[string]any `json:"tag,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we add another field TagType to capture the type of value and avoid data loss? We'd want to do that for all 3 flavors of Tag field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add it in the DotReplacement PR as tag map handling is taking place there!

}
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,39 @@
}
}
},
"scope":{
"properties":{
"name":{
"type":"keyword",
"ignore_above":256
},
"version":{
"type":"keyword",
"ignore_above":256
},
"tag":{
"type":"object"
},
"tags":{
"type":"nested",
"dynamic":false,
"properties":{
"key":{
"type":"keyword",
"ignore_above":256
},
"value":{
"type":"keyword",
"ignore_above":256
},
"type":{
"type":"keyword",
"ignore_above":256
}
}
}
}
},
"references":{
"type":"nested",
"dynamic":false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,39 @@
}
}
}
},
"scope":{
"properties":{
"name":{
"type":"keyword",
"ignore_above":256
},
"version":{
"type":"keyword",
"ignore_above":256
},
"tag":{
"type":"object"
},
"tags":{
"type":"nested",
"dynamic":false,
"properties":{
"key":{
"type":"keyword",
"ignore_above":256
},
"value":{
"type":"keyword",
"ignore_above":256
},
"type":{
"type":"keyword",
"ignore_above":256
}
}
}
}
},
"references":{
"type":"nested",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,39 @@
}
}
},
"scope":{
"properties":{
"name":{
"type":"keyword",
"ignore_above":256
},
"version":{
"type":"keyword",
"ignore_above":256
},
"tag":{
"type":"object"
},
"tags":{
"type":"nested",
"dynamic":false,
"properties":{
"key":{
"type":"keyword",
"ignore_above":256
},
"value":{
"type":"keyword",
"ignore_above":256
},
"type":{
"type":"keyword",
"ignore_above":256
}
}
}
}
},
"references": {
"type": "nested",
"dynamic": false,
Expand Down
33 changes: 33 additions & 0 deletions internal/storage/v1/elasticsearch/mappings/jaeger-span-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,39 @@
}
}
},
"scope":{
"properties":{
"name":{
"type":"keyword",
"ignore_above":256
},
"version":{
"type":"keyword",
"ignore_above":256
},
"tag":{
"type":"object"
},
"tags":{
"type":"nested",
"dynamic":false,
"properties":{
"key":{
"type":"keyword",
"ignore_above":256
},
"value":{
"type":"keyword",
"ignore_above":256
},
"type":{
"type":"keyword",
"ignore_above":256
}
}
}
}
},
"references":{
"type":"nested",
"dynamic":false,
Expand Down
33 changes: 33 additions & 0 deletions internal/storage/v1/elasticsearch/mappings/jaeger-span-7.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,39 @@
}
}
}
},
"scope":{
"properties":{
"name":{
"type":"keyword",
"ignore_above":256
},
"version":{
"type":"keyword",
"ignore_above":256
},
"tag":{
"type":"object"
},
"tags":{
"type":"nested",
"dynamic":false,
"properties":{
"key":{
"type":"keyword",
"ignore_above":256
},
"value":{
"type":"keyword",
"ignore_above":256
},
"type":{
"type":"keyword",
"ignore_above":256
}
}
}
}
},
"references":{
"type":"nested",
Expand Down
33 changes: 33 additions & 0 deletions internal/storage/v1/elasticsearch/mappings/jaeger-span-8.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,39 @@
}
}
},
"scope":{
"properties":{
"name":{
"type":"keyword",
"ignore_above":256
},
"version":{
"type":"keyword",
"ignore_above":256
},
"tag":{
"type":"object"
},
"tags":{
"type":"nested",
"dynamic":false,
"properties":{
"key":{
"type":"keyword",
"ignore_above":256
},
"value":{
"type":"keyword",
"ignore_above":256
},
"type":{
"type":"keyword",
"ignore_above":256
}
}
}
}
},
"references": {
"type": "nested",
"dynamic": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@
"value": true
}
]
}
},
"scope": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
}
}
},
{
"bool":{
"must":{
"regexp":{
"scope.tag.bat@foo":{
"value":"spook"
}
}
}
}
},
{
"nested":{
"path":"tags",
Expand Down Expand Up @@ -97,6 +108,32 @@
}
}
}
},
{
"nested":{
"ignore_unmapped": true,
"path":"scope.tags",
"query":{
"bool":{
"must":[
{
"match":{
"scope.tags.key":{
"query":"bat.foo"
}
}
},
{
"regexp":{
"scope.tags.value":{
"value":"spook"
}
}
}
]
}
}
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
}
}
},
{
"bool":{
"must":{
"regexp":{
"scope.tag.bat@foo":{
"value":"spo.*"
}
}
}
}
},
{
"nested":{
"path":"tags",
Expand Down Expand Up @@ -97,6 +108,32 @@
}
}
}
},
{
"nested":{
"ignore_unmapped": true,
"path":"scope.tags",
"query":{
"bool":{
"must":[
{
"match":{
"scope.tags.key":{
"query":"bat.foo"
}
}
},
{
"regexp":{
"scope.tags.value":{
"value":"spo.*"
}
}
}
]
}
}
}
}
]
}
Expand Down
Loading
Loading