Skip to content

Commit

Permalink
add periodic metrics reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mms-gianni committed May 4, 2024
1 parent 96530f9 commit d3b9f24
Show file tree
Hide file tree
Showing 5 changed files with 3,052 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/src/components/apps/metrics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ import { useKuberoStore } from '../../stores/kubero'
import { mapState } from 'pinia'
import axios from "axios";
import { start } from 'repl';
const colors = ['#8560a9', '#a887c9', '#b99bd6', '#d2bde6']
Expand Down Expand Up @@ -592,12 +593,17 @@ export default defineComponent({
data: number[][],
}[],
scale: '24h' as '2h'| '24h' | '7d',
timer: null as any,
}),
components: {
VueApexCharts,
},
mounted() {
this.refreshMetrics();
this.startTimer();
},
unmounted() {
clearInterval(this.timer);
},
watch: {
scale: function (val) {
Expand All @@ -618,6 +624,12 @@ export default defineComponent({
return metrics;
},
*/
startTimer() {
this.timer = setInterval(() => {
console.log("refreshing metrics");
this.refreshMetrics();
}, 4000);
},
refreshMetrics() {
if (this.kubero.metricsEnabled) {
this.getMemoryMetrics();
Expand Down
54 changes: 54 additions & 0 deletions prom-v-small.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
alertmanager:
enabled: true
persistence:
## @param alertmanager.persistence.enabled Enable Alertmanager data persistence using VolumeClaimTemplates
##
enabled: false
## @section Prometheus server Parameters
##
server:
## @param server.alertingRules Prometheus alerting rules. This content will be stored in the the rules.yaml file and the content can be a template.
## ref: <https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/>
##
alertingRules: {}
## @param server.extraScrapeConfigs Promethus configuration, useful to declare new scrape_configs. This content will be merged with the 'server.configuration' value and stored in the the prometheus.yaml file.
## ref: <https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config>
##
extraScrapeConfigs: []
## @param server.replicaCount Number of Prometheus replicas to deploy
##
replicaCount: 1
thanos:
## @param server.thanos.create Create a Thanos sidecar container
##
create: false
ingress:
## @param server.ingress.enabled Enable ingress record generation for Prometheus
##
enabled: true
## @param server.ingress.hostname Default host for the ingress record
##
#hostname: server.prometheus.local
hostname: prometheus.localhost
persistence:
## @param server.persistence.enabled Enable persistence using Persistent Volume Claims. If you have multiple instances (server.repicacount > 1), please considere using an external storage service like Thanos or Grafana Mimir
##
enabled: false
annotations: {}
## @param server.persistence.accessModes Persistent Volume Access Modes
##
accessModes:
- ReadWriteOnce
## @param server.persistence.size Size of data volume
##
size: 8Gi
## @param server.persistence.existingClaim The name of an existing PVC to use for persistence
##
volumePermissions:
## @param volumePermissions.enabled Enable init container that changes the owner/group of the PV mount point to `runAsUser:fsGroup`
##
enabled: false
containerSecurityContext:
seLinuxOptions: null
runAsUser: 0
Loading

0 comments on commit d3b9f24

Please sign in to comment.