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

Commit

Permalink
Add loki datasource attributes (#65)
Browse files Browse the repository at this point in the history
* Add loki datasource attributes
maxLines + derivedFields

* Export LokiDerivedField
  • Loading branch information
julienduchesne authored Feb 21, 2022
1 parent 4e110c8 commit 8c4f52c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ func (ds *DataSource) UnmarshalJSON(b []byte) (err error) {
return err
}

type LokiDerivedField struct {
Name string `json:"name"`
MatcherRegex string `json:"matcherRegex"`
URL string `json:"url"`
DatasourceUID string `json:"datasourceUid,omitempty"`
}

// JSONData is a representation of the datasource `jsonData` property
type JSONData struct {
// Used by all datasources
Expand Down Expand Up @@ -116,6 +123,10 @@ type JSONData struct {
ExternalID string `json:"externalId,omitempty"`
Profile string `json:"profile,omitempty"`

// Used by Loki
DerivedFields []LokiDerivedField `json:"derivedFields,omitempty"`
MaxLines int `json:"maxLines,omitempty"`

// Used by OpenTSDB
TsdbVersion int64 `json:"tsdbVersion,omitempty"`
TsdbResolution int64 `json:"tsdbResolution,omitempty"`
Expand Down

0 comments on commit 8c4f52c

Please sign in to comment.