Last active
August 3, 2022 01:05
-
-
Save sdboyer/3f7c1ac4bbb64c8b9658230e0b9c7cc0 to your computer and use it in GitHub Desktop.
Example grafana datasource plugin slot implementations (query and dsoptions) for prometheus datasource plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dsschema | |
import "github.com/grafana/thema" | |
Query: thema.#Lineage & { | |
name: "prometheus" | |
seqs: [ | |
{ | |
schemas: [ | |
{// 0.0 | |
expr: string | |
legendFormat: string | |
interval: string | |
intervalMS: int64 | |
stepMode: string | |
range: bool | *true | |
instant: !range | |
exemplar: bool | *false | |
intervalFactor: int64 | |
utcOffsetSec: int64 | |
}, | |
] | |
}, | |
] | |
} | |
DSOptions: thema.#Lineage & { | |
name: "prometheus" | |
seqs: [ | |
{ | |
schemas: [ | |
{// 0.0 | |
Options: { | |
timeInterval: string | *"15s" | |
httpMethod: "GET" | *"POST" | |
queryTimeout?: string | |
directUrl?: string | |
customQueryParameters?: string | |
disableMetricsLookup?: boolean | |
} | |
SecureOptions: { | |
basicAuthUser?: string | |
basicAuthPassword?: string | |
} | |
}, | |
] | |
}, | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment