-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from appuio/feat/monitoring
Add option to scrape APPUiO Cloud Agent metrics
- Loading branch information
Showing
11 changed files
with
121 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local prom = import 'lib/prom.libsonnet'; | ||
local inv = kap.inventory(); | ||
local params = inv.parameters.appuio_cloud; | ||
|
||
|
||
local sm = | ||
prom.ServiceMonitor('appuio-cloud-agent') { | ||
metadata+: { | ||
namespace: params.namespace, | ||
labels+: { | ||
'control-plane': 'appuio-cloud-agent', | ||
service: 'metrics', | ||
}, | ||
}, | ||
spec: { | ||
endpoints: [ { | ||
port: 'metrics-port', | ||
} ], | ||
namespaceSelector: { matchNames: [ params.namespace ] }, | ||
selector: { | ||
matchLabels: { | ||
'control-plane': 'appuio-cloud-agent', | ||
service: 'metrics', | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
if params.monitoring.enabled then | ||
{ | ||
'10_monitoring/00_servicemonitor-appuio-cloud-agent': sm, | ||
} | ||
else | ||
{} |
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
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
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
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
16 changes: 16 additions & 0 deletions
16
tests/golden/defaults/appuio-cloud/appuio-cloud/01_agent/20_metrics_service.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
control-plane: appuio-cloud-agent | ||
service: metrics | ||
name: metrics-service | ||
namespace: appuio-cloud | ||
spec: | ||
ports: | ||
- name: metrics-port | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
control-plane: appuio-cloud-agent |
20 changes: 20 additions & 0 deletions
20
...efaults/appuio-cloud/appuio-cloud/10_monitoring/00_servicemonitor-appuio-cloud-agent.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
annotations: {} | ||
labels: | ||
control-plane: appuio-cloud-agent | ||
name: appuio-cloud-agent | ||
service: metrics | ||
name: appuio-cloud-agent | ||
namespace: appuio-cloud | ||
spec: | ||
endpoints: | ||
- port: metrics-port | ||
namespaceSelector: | ||
matchNames: | ||
- appuio-cloud | ||
selector: | ||
matchLabels: | ||
control-plane: appuio-cloud-agent | ||
service: metrics |