[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Accessing all metrics for a Project



----- Original Message -----
> From: "David Dimas" <david dimas333 gmail com>
> To: dev lists openshift redhat com
> Sent: Thursday, March 10, 2016 5:46:41 AM
> Subject: Accessing all metrics for a Project
> 
> I am running openshift vm.
> when I run this command on command prompt, I am getting JSON object.
> # curl -k -X GET https://hawkular-metrics.example.com/hawkular/metrics/status
> {"MetricsService":"STARTED","Implementation-Version":"0.12.0.Final"....
> But I want to access all metrics for a project.
> 
> https://github.com/openshift/origin-metrics/blob/master/docs/hawkular_metrics.adoc#accessing-all-metrics-for-a-project
> 
> How can I run the command in this link?

The command listed there is just an example of how you could access it using a basic command line tools such as curl

curl -H "Authorization: Bearer ${USER_TOKEN}" -H "Hawkular-tenant: ${PROJECT_NAME}" -X GET https://${HAWKULAR_METRICS_HOSTNAME}/hawkular/metrics/metrics

Where:

USER_TOKEN: the token of the user to access the metrics for the project. You will need to get this from the OpenShift OAuth provider (https://docs.openshift.com/enterprise/3.0/architecture/additional_concepts/authentication.html#oauth). For simple testing, if you are logged into 'oc' as an authenticated user, you can get this from 'oc whoami -t'

PROJECT_NAME: the name of the project you want to access metrics for.

HAWKULAR_METRICS_HOSTNAME: this should correspond to the route's hostname for exposing the metrics service. This is specified during the metrics install. Note that this requires that the router is installed and is configured to expose the service to whatever network you are trying to access this from.

> 
> I want to run all command outside ssh session.

ssh should be unrelated to all of this. The ${HAWKULAR_METRICS_HOSTNAME} should be exposed via the router and your systems need to be configured to use the router to resolve this hostname. 

> 
> I am not sure about Authorization.

Authorization is described here: https://github.com/openshift/origin-metrics/blob/master/docs/hawkular_metrics.adoc#authorization


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]