Skip to content

Commit 023e34c

Browse files
authored
Merge pull request #82119 from eromanova97/OBSDOCS-800
OBSDOCS-800: Add json formatting option to sample CLI commands in acc…
2 parents 0dad061 + 8c2022f commit 023e34c

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

modules/accessing-metrics-outside-cluster.adoc

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,35 @@ $ curl -H "Authorization: Bearer $TOKEN" -k "https://$HOST/api/v1/query?" --data
5454
+
5555
The output shows the status for each application pod that Prometheus is scraping:
5656
+
57-
.Example output
57+
.The formatted example output
5858
[source,terminal]
5959
----
60-
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"up","endpoint":"web","instance":"10.129.0.46:8080","job":"prometheus-example-app","namespace":"ns1","pod":"prometheus-example-app-68d47c4fb6-jztp2","service":"prometheus-example-app"},"value":[1591881154.748,"1"]}]}}
60+
{
61+
"status": "success",
62+
"data": {
63+
"resultType": "vector",
64+
"result": [
65+
{
66+
"metric": {
67+
"__name__": "up",
68+
"endpoint": "web",
69+
"instance": "10.129.0.46:8080",
70+
"job": "prometheus-example-app",
71+
"namespace": "ns1",
72+
"pod": "prometheus-example-app-68d47c4fb6-jztp2",
73+
"service": "prometheus-example-app"
74+
},
75+
"value": [
76+
1591881154.748,
77+
"1"
78+
]
79+
}
80+
],
81+
}
82+
}
6183
----
84+
+
85+
[NOTE]
86+
====
87+
The formatted example output uses a filtering tool, such as `jq`, to provide the formatted indented JSON. See the link:https://stedolan.github.io/jq/manual/[jq Manual] for more information about using `jq`.
88+
====

0 commit comments

Comments
 (0)