Skip to content

Commit 32ce26e

Browse files
authored
chore: added memory limit metrics (#1020)
1 parent 2a437a0 commit 32ce26e

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

internal/collector/otelcol.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ receivers:
2525
{{- end }}
2626
{{- if .Receivers.HostMetrics.Scrapers.Memory }}
2727
memory:
28+
metrics:
29+
system.memory.limit:
30+
enabled: true
2831
{{- end }}
2932
{{- if .Receivers.HostMetrics.Scrapers.Network }}
3033
network:

test/config/collector/test-opentelemetry-collector-agent.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ receivers:
1212
disk:
1313
filesystem:
1414
memory:
15+
metrics:
16+
system.memory.limit:
17+
enabled: true
1518
network:
1619
otlp/0:
1720
protocols:

test/mock/collector/grafana/provisioning/dashboards/host-metrics.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,105 @@
613613
],
614614
"title": "System CPU Logical Count",
615615
"type": "timeseries"
616+
},
617+
{
618+
"datasource": {
619+
"type": "prometheus",
620+
"uid": "otel-prometheus-scraper"
621+
},
622+
"fieldConfig": {
623+
"defaults": {
624+
"color": {
625+
"mode": "palette-classic"
626+
},
627+
"custom": {
628+
"axisBorderShow": false,
629+
"axisCenteredZero": false,
630+
"axisColorMode": "text",
631+
"axisLabel": "",
632+
"axisPlacement": "auto",
633+
"barAlignment": 0,
634+
"drawStyle": "line",
635+
"fillOpacity": 0,
636+
"gradientMode": "none",
637+
"hideFrom": {
638+
"legend": false,
639+
"tooltip": false,
640+
"viz": false
641+
},
642+
"insertNulls": false,
643+
"lineInterpolation": "linear",
644+
"lineWidth": 1,
645+
"pointSize": 5,
646+
"scaleDistribution": {
647+
"type": "linear"
648+
},
649+
"showPoints": "auto",
650+
"spanNulls": false,
651+
"stacking": {
652+
"group": "A",
653+
"mode": "none"
654+
},
655+
"thresholdsStyle": {
656+
"mode": "off"
657+
}
658+
},
659+
"mappings": [],
660+
"thresholds": {
661+
"mode": "absolute",
662+
"steps": [
663+
{
664+
"color": "green",
665+
"value": null
666+
},
667+
{
668+
"color": "red",
669+
"value": 80
670+
}
671+
]
672+
}
673+
},
674+
"overrides": []
675+
},
676+
"gridPos": {
677+
"h": 8,
678+
"w": 12,
679+
"x": 0,
680+
"y": 8
681+
},
682+
"id": 8,
683+
"options": {
684+
"legend": {
685+
"calcs": [],
686+
"displayMode": "list",
687+
"placement": "bottom",
688+
"showLegend": true
689+
},
690+
"tooltip": {
691+
"mode": "single",
692+
"sort": "none"
693+
}
694+
},
695+
"targets": [
696+
{
697+
"datasource": {
698+
"type": "prometheus",
699+
"uid": "otel-prometheus-scraper"
700+
},
701+
"disableTextWrap": false,
702+
"editorMode": "builder",
703+
"expr": "system_memory_limit",
704+
"fullMetaSearch": false,
705+
"includeNullMetadata": true,
706+
"instant": false,
707+
"legendFormat": "__auto",
708+
"range": true,
709+
"refId": "A",
710+
"useBackend": false
711+
}
712+
],
713+
"title": "System Memory Limit",
714+
"type": "timeseries"
616715
}
617716
],
618717
"refresh": "",

0 commit comments

Comments
 (0)