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

Updated HAProxy Prometheus documentation #587

Merged

Conversation

algchoo
Copy link
Contributor

@algchoo algchoo commented Jul 14, 2023

Changes

Details
The exporter initially used has been retired and an official exporter is available as of version 2.4. The changes here remove the unofficial exporter from the documentation and shift the focus towards the official exporter.

There are instructions on building HAProxy with the Prometheus exporter module enabled and the docker images seem to have this enabled by default, I checked the latest available version of 2.4 and 2.8, both have it enabled. The metrics appear to be the same, or changes that are present don't affect the dashboard.

The documentation has been modified to fit the format for exporter_type: included.

@github-actions github-actions bot requested a review from yqlu July 14, 2023 18:57
@yqlu
Copy link
Collaborator

yqlu commented Jul 14, 2023

This seems like it would be a bigger change, because we want to switch the documentation from type=sidecar to type=included

With reference to the published docs, we want it to look more like
https://cloud.google.com/stackdriver/docs/managed-prometheus/exporters/airflow
or maybe https://cloud.google.com/stackdriver/docs/managed-prometheus/exporters/flink

which is being populated by https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples/blob/master/integrations/airflow/documentation.yaml and https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples/blob/master/integrations/flink/documentation.yaml

Which means...

  • switching exporter_type from sidecar -> included
  • adding analogous "additional_prereq_info" like what we did in flink / airflow about how HAProxy exposes Prometheus-format metrics automatically if you update the config map in this way... and run this command to verify metrics are emitted on the expected endpoint...
  • get rid of the "additional_install_info" which is now irrelevant
  • update exporter_name, exporter_pkg_name, exporter_repo_url, etc (and the relevant fields in integrations/haproxy/prometheus_metadata.yaml) to no longer point to the old exporter and github repo

@algchoo
Copy link
Contributor Author

algchoo commented Jul 17, 2023

@yqlu Thank you for the review, changes have been pushed based on the feedback.

@yqlu
Copy link
Collaborator

yqlu commented Jul 19, 2023

Tagging @mtabasko for additional scrutiny because this is a larger change (switching exporter types entirely)

@mtabasko
Copy link

Thanks, YQ. How urgent is this? If urgent, I will try to look at it tomorrow (Thurs, 20 july). (Next week would be much better -- I'm really swamped right now. Sorry!)

@yqlu
Copy link
Collaborator

yqlu commented Jul 20, 2023

Not urgent -- next week is fine!

Copy link

@mtabasko mtabasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took me so long to get to. YQ, I've staged a version of the HAProxy doc that incorporates the changes I've suggested here, too.

integrations/haproxy/documentation.yaml Outdated Show resolved Hide resolved
Most of the official docker images for versions greater than or equal to 2.4 are built with this service enabled.
The following example was built referencing [HAProxy Enterprise documentation](https://www.haproxy.com/documentation/hapee/latest/observability/metrics/prometheus/).
It works with the community edition and can be modified to suit specific needs:
<pre>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended to be included inline (and not extracted into the an external file (which is what we do with "config_mods" As is, this will just be an inline block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtabasko Sorry for not getting back sooner, I hope you're doing well!

I believe that this being inline is appropriate, based on other included exporters. I wasn't sure that including a config_mods section in this file made sense and if it does I'd be happy to make changes accordingly.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Austin! Hope you're doing well, too!

I don't have a strong opinion about this -- I realize that you don't have great insight into what we do with this downstream, so I just wanted to make sure that "inline" reflected your intent. So I have no objection. If you and YQ are good with it, that's good enough for me!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this, if everyone else is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I think this makes sense -- https://cloud.google.com/stackdriver/docs/managed-prometheus/exporters/flink is the one we want to model this after.

integrations/haproxy/documentation.yaml Show resolved Hide resolved
@@ -81,6 +85,9 @@ podmonitoring_config: |
selector:
matchLabels:
app.kubernetes.io/name: haproxy
additional_podmonitoring_info: |
Ensure that the values of the `port` and `matchLabels` fields match those of the {{app_name_short}} pods you want to monitor.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear if this is one paragraph or two. line 89 and 90 are "thematically" different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted to make this two separate paragraphs, but if it doesn't look right we do something different.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think two paragraphs is good here. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -81,6 +85,9 @@ podmonitoring_config: |
selector:
matchLabels:
app.kubernetes.io/name: haproxy
additional_podmonitoring_info: |
Ensure that the values of the `port` and `matchLabels` fields match those of the {{app_name_short}} pods you want to monitor.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think two paragraphs is good here. Thanks!

Copy link
Collaborator

@yqlu yqlu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small wording changes, then LGTM. Thanks Austin!!

Most of the official docker images for versions greater than or equal to 2.4 are built with this service enabled.
The following example was built referencing [HAProxy Enterprise documentation](https://www.haproxy.com/documentation/hapee/latest/observability/metrics/prometheus/).
It works with the community edition and can be modified to suit specific needs:
<pre>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I think this makes sense -- https://cloud.google.com/stackdriver/docs/managed-prometheus/exporters/flink is the one we want to model this after.

@@ -81,6 +85,9 @@ podmonitoring_config: |
selector:
matchLabels:
app.kubernetes.io/name: haproxy
additional_podmonitoring_info: |
Ensure that the values of the `port` and `matchLabels` fields match those of the {{app_name_short}} pods you want to monitor.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

exporter_name: the HAProxy exporter
exporter_pkg_name: haproxy_exporter
exporter_repo_url: https://github.com/prometheus/haproxy_exporter
exporter_name: the HAProxy promex exporter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exporter_name: the HAProxy promex exporter
exporter_name: the PROMEX service for HAProxy

Reading through https://github.com/haproxy/haproxy/blob/master/addons/promex/README and I think that's a more accurate name (they don't ever use "promex" in lowercase).

{{app_name_short}} exposes Prometheus-format metrics only when it is
[built with the service enabled](https://github.com/haproxy/haproxy/blob/master/addons/promex/README){:class="external"} and an appropriate `frontend` is included in the configuration.

Most of the official docker images for versions greater than or equal to 2.4 are built with this service enabled.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Most of the official docker images for versions greater than or equal to 2.4 are built with this service enabled.
Most of the official Docker images for versions greater than or equal to 2.4 are built with this service enabled.

@yqlu yqlu merged commit 18f8aa1 into GoogleCloudPlatform:master Aug 2, 2023
algchoo added a commit to observIQ/monitoring-dashboard-samples that referenced this pull request Aug 15, 2023
* Updated haproxy config, port name, and image version. Updated minimum version to match haproxy version

* Changed haproxy exporter type to be 'included' and updated the documentation to fit that template

* added back deployment yaml, named port, and metric verification instructions

* added class to links, added new lines

* small wording changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants