Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MetadataProfile PoC demo #114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion monitoring/local_monitoring/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,32 @@ function kruize_local_metric_profile() {
fi
}

function kruize_local_metadata_profile() {

# Metadata Profile JSON
cluster_metadata_local_monitoring="${current_dir}/autotune/manifests/autotune/metadata-profiles/cluster-metadata-local-monitoring.json"

{
echo
echo "######################################################"
echo "# Install default metadata profile"
echo "######################################################"
echo
output=$(curl -X POST http://${KRUIZE_URL}/createMetadataProfile -d @$cluster_metadata_local_monitoring)
echo
} >> "${LOG_FILE}" 2>&1

if [[ "$output" != *"SUCCESS"* ]]; then
echo $output >> "${LOG_FILE}" 2>&1
false
check_err "Error. Unable to create metadata profile. Exiting!"
fi
}

function kruize_local_metadata() {
export DATASOURCE="prometheus-1"
export CLUSTER_NAME="default"
export METADATA_PROFILE="cluster-metadata-local-monitoring"
{
echo
echo "######################################################"
Expand All @@ -66,7 +89,9 @@ function kruize_local_metadata() {
--header 'Content-Type: application/json' \
--data '{
"version": "v1.0",
"datasource_name": "prometheus-1"
"datasource_name": "prometheus-1",
"metadata_profile": "cluster-metadata-local-monitoring",
"measurement_duration": "15"
}')

# Exit if unable to connect to datasource
Expand Down Expand Up @@ -438,6 +463,10 @@ function kruize_local_demo_setup() {
kruize_local_metric_profile
echo "βœ… Installation of metric profile complete!"

echo -n "πŸ”„ Installing metadata profile..."
kruize_local_metadata_profile
echo "βœ… Installation of metadata profile complete!"

if [ ${demo} == "local" ]; then
echo -n "πŸ”„ Collecting metadata..."
kruize_local_metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"experiment_name": "monitor_container_PLACEHOLDER_CONTAINER",
"cluster_name": "default",
"performance_profile": "resource-optimization-local-monitoring",
"metadata_profile": "cluster-metadata-local-monitoring",
"mode": "monitor",
"target_cluster": "local",
"datasource": "prometheus-1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"experiment_name": "monitor_namespace_PLACEHOLDER_NAMESPACE_NAME",
"cluster_name": "default",
"performance_profile": "resource-optimization-local-monitoring",
"metadata_profile": "cluster-metadata-local-monitoring",
"mode": "monitor",
"target_cluster": "local",
"datasource": "prometheus-1",
Expand Down