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

[OSPRH-11692] node_exporter scrapeconfig must include full fqdn instead #535

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

jlarriba
Copy link
Collaborator

@jlarriba jlarriba commented Nov 19, 2024

of hostname

This creates a ScrapeConfig.staticConfigs section like this

staticConfigs:
  - labels:
      fqdn: edpm-compute-0.ctlplane.example.com
    targets:
    - 192.168.122.100:9100
  - labels:
      fqdn: edpm-compute-1.ctlplane.example.com
    targets:
    - 192.168.122.101:9100

Copy link
Contributor

openshift-ci bot commented Nov 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jlarriba

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jlarriba jlarriba requested a review from vyzigold November 19, 2024 11:29
IP: fmt.Sprintf("%s:%d", node.IP, telemetryv1.DefaultNodeExporterPort),
Hostname: node.Hostname,
IP: fmt.Sprintf("%s:%d", node.IP, telemetryv1.DefaultNodeExporterPort),
FQDN: node.FQDN,

Choose a reason for hiding this comment

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

can we have both
what i think would be reasonable for wathcer to do is check the fqdn and fallback to the host name if not found.

in nova/openstack depending on how you configure things the HOST filed can be a hostname or a fqdn so having both i think is more correct.

Copy link

Choose a reason for hiding this comment

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

there is a lot of overhead per added label so it is preferable to avoid it if we can.

if we really need to we can generate hostname from fqdn

Copy link

Choose a reason for hiding this comment

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

(for clarification)... so @SeanMooney is your concern about watcher's view of the cluster i.e. how watcher will know the compute nodes if it will be by hostname or fqdn.

so if we go this way it means that we would require fqdn to be used in the watcher node.hostname . Again though we could tolerate it if watcher only has hostname, we'd need to process the fqdn to extract it.

Choose a reason for hiding this comment

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

my concern is makeing sure we do not require FQDNs for watcher to work as that is not a reasonable requirement for upstream watcher given nova does not require that and until a few years ago technically did not support FQDNs, triple start using them before nova officially supported them...

i guess its ok for the operator to use fqdns provided we support both in watcher, we can detect ti the nova names are a host name or not and just match on the first label of the fqdn if we have a host name so i guess this is ok as it is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But having both will add an extra label to ALL metrics coming from node_exporter. We don't think it is worth.

Choose a reason for hiding this comment

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

right that why i said i thinkits ok to just have fqdn provided watcher can work with or without fqdns on the nova side.

in our devstack jobs we should be testing with just hostname and in our operator jobs we can test with FQDNs.

Copy link

@marios marios Nov 20, 2024

Choose a reason for hiding this comment

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

ack on your concern @SeanMooney i had the same feeling when updating the data source last night, especially when writing the docstring for the def _build_prometheus_host_instance_map(self): https://review.opendev.org/c/openstack/watcher/+/934423/7/watcher/decision_engine/datasources/prometheus.py#66

 This relies on a custom 'fqdn' label added to Prometheus scrape_configs.

It felt wrong that we made the assumption that watcher will have fqdn in its node.hostname ... but yeah i think we can tolerate it by extracting the hostname from fqdn and letting watcher work with both ... just added a comment at https://review.opendev.org/c/openstack/watcher/+/934423/comment/d4299ddf_564ef3ba/ and we have a sync call today so lets talk more there

Copy link

Choose a reason for hiding this comment

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

also forgot to add THANK YOU @jlarriba++ for jumping on this so quickly and getting this in for .04 feature freeze

@vyzigold
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 19, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit dc0d610 into openstack-k8s-operators:main Nov 19, 2024
6 checks passed
@jlarriba
Copy link
Collaborator Author

/cherry-pick 18.0-fr1

@openshift-cherrypick-robot

@jlarriba: #535 failed to apply on top of branch "18.0-fr1":

Applying: node_exporter scrapeconfig must include full fqdn instead of hostname
Using index info to reconstruct a base tree...
M	controllers/metricstorage_controller.go
M	pkg/metricstorage/scrape_config.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/metricstorage/scrape_config.go
CONFLICT (content): Merge conflict in pkg/metricstorage/scrape_config.go
Auto-merging controllers/metricstorage_controller.go
CONFLICT (content): Merge conflict in controllers/metricstorage_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 node_exporter scrapeconfig must include full fqdn instead of hostname

In response to this:

/cherry-pick 18.0-fr1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jlarriba
Copy link
Collaborator Author

/cherry-pick 18.0-fr1

@openshift-cherrypick-robot

@jlarriba: new pull request created: #541

In response to this:

/cherry-pick 18.0-fr1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

Successfully merging this pull request may close these issues.

5 participants