Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 8c4f52c

Browse files
Add loki datasource attributes (#65)
* Add loki datasource attributes maxLines + derivedFields * Export LokiDerivedField
1 parent 4e110c8 commit 8c4f52c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

datasource.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ func (ds *DataSource) UnmarshalJSON(b []byte) (err error) {
7373
return err
7474
}
7575

76+
type LokiDerivedField struct {
77+
Name string `json:"name"`
78+
MatcherRegex string `json:"matcherRegex"`
79+
URL string `json:"url"`
80+
DatasourceUID string `json:"datasourceUid,omitempty"`
81+
}
82+
7683
// JSONData is a representation of the datasource `jsonData` property
7784
type JSONData struct {
7885
// Used by all datasources
@@ -116,6 +123,10 @@ type JSONData struct {
116123
ExternalID string `json:"externalId,omitempty"`
117124
Profile string `json:"profile,omitempty"`
118125

126+
// Used by Loki
127+
DerivedFields []LokiDerivedField `json:"derivedFields,omitempty"`
128+
MaxLines int `json:"maxLines,omitempty"`
129+
119130
// Used by OpenTSDB
120131
TsdbVersion int64 `json:"tsdbVersion,omitempty"`
121132
TsdbResolution int64 `json:"tsdbResolution,omitempty"`

0 commit comments

Comments
 (0)