-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Clearly Specify Router Metrics file format returned #10549
Conversation
@knobunc Is this something your team can help with? (I pulled a QuickLab instance to test, but it won't allow users to get metrics.) Per BZ:
|
@knobunc PTAL |
@pecameron Can you take a look at this? I believe you wrote the original text that a customer is seeking more information/clarification on. |
==== | ||
---- | ||
$ oc adm router --service-account=router | ||
---- | ||
==== | ||
metrics are automatically available in Prometheus format on the stats-port, default 1936. To suppress metrics collection, | ||
|
||
* To get a CSV text file that contains Prometheus format statistics with *metrics* exposed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a CSV format. I'd say:
To get the Prometheus statistics for the exposed metrics:
|
||
* To get a CSV text file that contains Prometheus format statistics with *metrics* exposed: | ||
+ | ||
Launch the stats window use the following URL in a browser: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't going to work since localhost from a browser is likely the machine they are on. Really they need to tell prometheus to gather from the host:1936 with the appropriate credentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knobunc @pecameron
The customer is looking for:
Please clearly specify both the url to get the metrics and the actual file time returned, txt or html
If I read our docs right, the URL is the STATS_PORT address set in the router env variables and the user can curl <user>:<password>@<router_IP>:<STATS_PORT>/metrics
.
oc get po router-1-6tuk1 --template={{.status.hostIP}}
for router IPoc describe po router-1-6tuk1
to get the admin name/password?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the thrust of the doc should push Prometheus metrics. This plugs into the standard way metrics are collected in Openshift. These metrics include the haproxy native metrics an some controller metrics. The previous way was to use the native metrics from haproxy 1.5 and this should be for backward compatibility only.
Launch the stats window use the following URL in a browser: | ||
+ | ||
---- | ||
http://admin:<Password>@localhost:1936/metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "localhost" should be the router's ip address or FQN. @knobunc is this correct?
Launch the stats window use the following URL in a browser: | ||
+ | ||
---- | ||
http://admin:<Password>@localhost:1936/metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/metrics" is not needed here since any path (or no path) will yield the same results. Again, localhost is the IP or FQN of the router.
@@ -1531,10 +1550,10 @@ metadata: | |||
prometheus.openshift.io/username: admin | |||
---- | |||
==== | |||
|
|||
+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knobunc didn't we change authorization to not pass the username and password as annotations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lihongan Could you review this PR?
@anpingli PTAL |
==== | ||
---- | ||
$ oc adm router --service-account=router --stats-port=0 | ||
---- | ||
==== | ||
|
||
To switch to the HAProxy CSV format metrics, edit the xref:../../architecture/networking/routes.adoc#env-variables[environment variables] | ||
* To switch to the HAProxy CSV format metrics, edit the xref:../../architecture/networking/routes.adoc#env-variables[environment variables] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above should be switch to the HTML format metrics
instead of CSV format
, see https://bugzilla.redhat.com/show_bug.cgi?id=1548500
@lihongan PTAL |
LGTM, thank you @mburke5678 |
@openshift/team-documentation PTAL |
@knobunc @pecameron How far back should I roll these changes back? All the way to 3.1? |
The router stats were protected by delegated auth in this PR openshift/origin#16975 (this went into 3.7) And the new stats were added by openshift/origin#13337 (this went into 3.6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple of picks and suggestions for you to consider. :)
link:https://cbonte.github.io/haproxy-dconv/1.5/configuration.html#9[HAProxy router] in its own CSV format. | ||
These metrics include the HAProxy native metrics and some controller metrics. | ||
|
||
When you create a router using the following command, {product-title} makes metrics available in Prometheus format on the stats-port, default 1936. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe s/stats-port/stats port
maybe s/default/by default
value: 0.0.0.0:1936 | ||
- name: ROUTER_METRICS_TYPE | ||
value: haproxy | ||
oc describe pod <router_pod> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/oc/$ oc
|
||
Information needed to access the metrics is found the router service annotations: | ||
* To suppress metrics collection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/,/:
==== | ||
* To extract the raw statistics in Prometheus format use the following. | ||
+ | ||
You can get the information you need to access the metrics from the router service annotations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this line an annotation for line 1501 (annotations:)
|
||
==== | ||
* To extract the raw statistics in Prometheus format use the following. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/format/format,
maybe s/use the following./run the following command and modify the output:
Use the above username and password to access the metrics. The path is "/metrics". | ||
|
||
+ | ||
The metrics port is the STATS_PORT, default 1936. You might need to configure your firewall to permit access. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`STATS_PORT` ?
s/default/by default
|
||
+ | ||
The metrics port is the STATS_PORT, default 1936. You might need to configure your firewall to permit access. | ||
Use the above user name and password to access the metrics. The path is "/metrics". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/above/previous (or established or <modifier_of_choice>)
s/"/metrics"/`/metrics`
value: haproxy | ||
---- | ||
+ | ||
Launch the stats window using the following URL in a browser, where 1936 is the `STATS_PORT` value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the organization of this section could be improved. I think this section is actually three substeps and that you have them presented in 1-3-2 order.
s/Launch the stats window using the following URL in a browser, where 1936 is the STATS_PORT
value/Open the stats window at the following URL:
The note about 1936 might be better as an annotation on line 1557.
oc describe pod <router_pod> | ||
---- | ||
+ | ||
You get a statistics file in HTML format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the statistics display or do they automatically download? I might say one of these instead:
"The statistics display."
"An HTML file that contains the statistics downloads."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@knobunc Can you help with this? (I tried to set up an QuickLab instance, but I cannot access the stats page). What output does the user get when here?
On 07/23/2018 10:00 AM, Michael Burke wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In install_config/router/default_haproxy_router.adoc
<#10549 (comment)>:
> + value: haproxy
+----
++
+Launch the stats window using the following URL in a browser, where 1936 is the `STATS_PORT` value:
++
+----
+http://admin:<Password>@<router_IP>:1936
+----
++
+To get the router IP, admin name, and password:
++
+----
+oc describe pod <router_pod>
+----
++
+You get a statistics file in HTML format.
@knobunc <https://github.com/knobunc> Can you help with this? (I tried
to set up an QuickLab instance, but I cannot access the stats page).
What output does the user get when here?
I don't have a working cluster at present. When I get it back up I will
give it a try. Also on PTO 7/25-31. Sorry for the delay.
…
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10549 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANUgegMlpb9SwaexFjz2_8tf-4KaweQqks5uJdbrgaJpZM4U9pHM>.
|
The preview will be availble shortly at:
|
@lihongan |
@mburke5678 Looks good. Thank you. |
@mburke5678 I have added the 3.11 branch label and the next milestone. |
https://bugzilla.redhat.com/show_bug.cgi?id=1548500