Import recommendation data into APM tools
less than a minute
By creating a Prometheus scrape job, Optimize Live exports recommendation data as Prometheus metrics, which you can import into other application performance management (APM) tools.
To define a scrape job to get recommendation data:
-
Edit the
prometheus-server
ConfigMap in theprometheus
namespace:kubectl edit configmap -n prometheus prometheus-server
-
Add the following scrape job to the
scrape_configs:
section of the ConfigMap.-
Replace SF_CLIENT_ID with the clientID value in your cluster credential file.
-
Replace SF_CLIENT_SECRET with the clientSecret value in your cluster credential file.
Alternatively, a Prometheus administrator can put the clientSecret in a file and leverage theclient_secret_file
parameter and specify the absolute path (for example,client_secret: /mnt/client_secret_file
).- job_name: optimize-live-recommendations honor_labels: true proxy_from_environment: true scheme: https oauth2: client_id: 'SF_CLIENT_ID' client_secret: 'SF_CLIENT_SECRET' token_url: 'https://api.stormforge.io/oauth/token' endpoint_params: audience: 'https://api.stormforge.io/' grantType: client_credentials metrics_path: /v3/workload-metrics static_configs: - targets: ["api.stormforge.io"]
-
-
(Optional) To confirm that the scrape job is working as expected, compare the results in Prometheus to the output of the command below:
curl -H "$(stormforge whoami --header)" https://api.stormforge.io:443/v3/workload-metrics