File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1
1
{{- $int_name := (.Get 0 ) -}}
2
+ {{- $metric_namespaces := (.Get 1 ) -}}
3
+ {{- if and $metric_namespaces (not (reflect.IsSlice $metric_namespaces)) -}}
4
+ {{- $metric_namespaces = slice $metric_namespaces -}}
5
+ {{- end -}}
6
+
2
7
{{- if $int_name -}}
8
+ <!-- Some edge cases the metadata is from a non-integration source, we get the JSON from websites-sources -->
9
+ <!-- The datafile in sources needs to follow the convention to match: appid_metadata.json -->
10
+ {{- $exceptions := slice "synthetics" "cloud-foundry" -}}
11
+ {{- if in $exceptions $int_name -}}
12
+ {{- $data := index .Site.Data (print $int_name "_metadata") -}}
13
+ {{- if $data -}}
14
+ < table >
15
+ {{- range $data -}}
16
+ {{- $metric := . -}}
17
+ {{- $shouldRender := false -}}
18
+ {{- if not $metric_namespaces -}}
19
+ {{- $shouldRender = true -}}
20
+ {{- else -}}
21
+ {{- range $metric_namespaces -}}
22
+ {{- if hasPrefix $metric.metric_name . -}}
23
+ {{- $shouldRender = true -}}
24
+ {{- end -}}
25
+ {{- end -}}
26
+ {{- end -}}
27
+
28
+ {{- if $shouldRender -}}
29
+ < tr >
30
+ < td > < strong > {{ .metric_name }}</ strong > < br > ({{ .metric_type }})</ td >
31
+ < td > {{ .description }} {{ with .unit_name }}< br > < em > Shown as {{ . }}{{ end }}</ em > </ td >
32
+ </ tr >
33
+ {{- end -}}
34
+ {{- end -}}
35
+ </ table >
36
+ {{- else -}}
37
+ {{ warnf "%s_metadata.json datafile not found for %s integration." $int_name $int_name }}
38
+ {{- end -}}
39
+ {{- else -}}
40
+
41
+ <!-- For integrations we get the metrics from the integration page -->
3
42
<!-- if the page is a draft we can skip -->
4
43
{{- if not .Page.Draft -}}
5
44
<!-- if non english page load from english integration -->
25
64
{{- end -}}
26
65
{{- end -}}
27
66
{{- end -}}
67
+ {{- end -}}
28
68
{{- end -}}
You can’t perform that action at this time.
0 commit comments