File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Copyright The Perses Authors
2+ // Licensed under the Apache License, Version 2.0 (the "License");
3+ // you may not use this file except in compliance with the License.
4+ // You may obtain a copy of the License at
5+ //
6+ // http://www.apache.org/licenses/LICENSE-2.0
7+ //
8+ // Unless required by applicable law or agreed to in writing, software
9+ // distributed under the License is distributed on an "AS IS" BASIS,
10+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ // See the License for the specific language governing permissions and
12+ // limitations under the License.
13+
14+ package common
15+
16+ myDirectSpec : {
17+ common .#baseDatasourceSpec
18+ directUrl : " localhost:8080 "
19+ }
20+
21+ myProxySpec : {
22+ common .#baseDatasourceSpec
23+ proxy : {
24+ kind : " HTTPProxy " ,
25+ spec : {
26+ url : " https://prometheus.demo.prometheus.io " ,
27+ allowedEndpoints : [
28+ {
29+ endpointPattern : " /api/v1/labels " ,
30+ method : " POST "
31+ },
32+ {
33+ endpointPattern : " /api/v1/series " ,
34+ method : " POST "
35+ },
36+ ]
37+ }
38+ },
39+ }
40+
41+ myDsVarSelector : #datasourceSelector & { _kind : " MyDatasource " }
42+
43+ myDsVarSelector : #datasourceSelector & { datasource : " $dsVar " }
Original file line number Diff line number Diff line change 1414package common
1515
1616myFormat : #format & {
17- decimalPlaces : 0
18- shortValues : false
17+ decimalPlaces : 0
18+ shortValues : false
1919}
Original file line number Diff line number Diff line change 1313
1414package common
1515
16+ #baseDatasourceSpec : #directUrl | #proxy
17+
18+ #directUrl : {
19+ directUrl : common .#url
20+ }
21+
22+ #proxy : {
23+ proxy : commonProxy .#HTTPProxy
24+ }
25+
1626#datasourceSelector : {
27+ _kind : string
1728 datasource ?: =~ #variableSyntaxRegex | {
18- kind : string
29+ kind : _kind
1930 name ?: string
2031 }
21- }
32+ }
You can’t perform that action at this time.
0 commit comments