I am looking for a way to monitor metrics from my Spring Boot application which runs in a minikube cluster to in an Azure portal. So far for the demo I have built a telemetry as follows and connected my application to Application Insights in Azure:
TelemetryClient telemetryClient = new TelemetryClient();
MetricTelemetry telemetry = new MetricTelemetry();
telemetry.setTimestamp(timestamp);
telemetry.setName("changed records");
telemetry.setValue(10);
telemetryClient.trackMetric(telemetry);
As you can see in the screenshot, this works fine. But now I need a way to filter by the namespace and pod. For example, in my student work I have 3 different namespaces with 2 pods each.
Does anyone know a good way to get the namespace and pod information from my minikube cluster?
Pod fields such as namespace, node name, pod name and IP etc can be pass to your container via environment variables at runtime, checkout the example from the official document here.