# ./pp <query> <scope> <aggregate_group_by> <func_string_replacements:funcName,argIdx,currentValue,newValue>...
# aggregate_group_by is optional
$ ./pp 'up{foo="baz",a="q"}' '{a=~"z"}'
up{a=~"z",foo="baz"}
$ ./pp 'up{foo="baz",a="q"}' '{a=~"z",c="z"}'
up{a=~"z",c="z",foo="baz"}
This file contains hidden or 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
### Render a Basic template with POST | |
POST http://admin:admin@localhost:3000/apis/peakq.grafana.app/v0alpha1/render?var-metricName=up | |
Content-Type: application/json | |
Accept: application/json | |
{ | |
"title": "Test", | |
"vars": [ | |
{ | |
"key": "metricName", |
This file contains hidden or 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
diff --git a/go.mod b/go.mod | |
index 7534de9cfc..41d10ed8b3 100644 | |
--- a/go.mod | |
+++ b/go.mod | |
@@ -124,7 +124,7 @@ require ( | |
gopkg.in/mail.v2 v2.3.1 // @grafana/backend-platform | |
gopkg.in/yaml.v2 v2.4.0 // indirect | |
gopkg.in/yaml.v3 v3.0.1 // @grafana/alerting-squad-backend | |
- xorm.io/builder v0.3.6 // @grafana/backend-platform | |
+ xorm.io/builder v0.3.6 // indirect; @grafana/backend-platform |
Recorded Queries will record multiple metrics, identified by labels, if the input data is numeric dataplane data.
Numeric dataplane data comes:
- directly from a datasource, prometheus instant queries are an example
- Server Side Expressions Reduce operation results (which can takes various forms of time series data as input)
This file contains hidden or 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
diff --git a/internal/components/datasource/schema.go b/internal/components/datasource/schema.go | |
index 98a29197ec..d75330be5c 100644 | |
--- a/internal/components/datasource/schema.go | |
+++ b/internal/components/datasource/schema.go | |
@@ -82,6 +82,29 @@ func newDataSourceJSONKernel(lin thema.Lineage) kernel.InputKernel { | |
return jdk | |
} | |
+// TODO: | |
+// What is the schema (constraints) on []DataSource |
mysql> desc data_source;
+---------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
Some Notes on Data source Info / Data source Ref:
-
Terms I'm using for these notes:
- DatasourceRef: is model that includes (uid+type), is saved by dashboards and alerting (note: alerting is current UID only)
- DatasourceInfo: is full information that a datasource neededs to execute a request, and can be looked up by the Ref
-
Contexts:
- Alerting: The Ref is saved. Alerts run as a service, so in this context there is no user (although perhaps there should be a service user or role). Therefore for saved alerts run by the service, authorization is done at creation time, not run time - (as users would not want alerts to stop working if a user is removed).
- Query API: Runtime, in this context there is a user
-
Main Question: