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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use VECTOR_SELF_NODE_NAME for internal_metrics #20481

Open
taind772 opened this issue May 13, 2024 · 3 comments
Open

Use VECTOR_SELF_NODE_NAME for internal_metrics #20481

taind772 opened this issue May 13, 2024 · 3 comments
Labels
domain: config Anything related to configuring Vector domain: observability Anything related to monitoring/observing Vector source: host_metrics Anything `host_metrics` source related source: internal_metrics Anything `internal_metrics` source related type: feature A value-adding code addition that introduce new functionality.

Comments

@taind772
Copy link

taind772 commented May 13, 2024

A note for the community

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Use Cases

Should we use VECTOR_SELF_NODE_NAME as host label for Internal metrics in Kubernetes deploys? Or some other label like node?

The current host label in Kubernetes deployment (agent mode) is the same as pod label. As I understand, to get which node vector agent was running on we need to join the metrics with kube_pod_info (metrics from kube-state-metrics) or add a custom VRL transform. While possible, it is tedious and should just work by default.

This piece of information is meaning

image

Attempted Solutions

No response

Proposal

No response

References

No response

Version

0.36.0
No response

@taind772 taind772 added the type: feature A value-adding code addition that introduce new functionality. label May 13, 2024
@jszwedko jszwedko added domain: observability Anything related to monitoring/observing Vector source: host_metrics Anything `host_metrics` source related source: internal_metrics Anything `internal_metrics` source related labels May 20, 2024
@jszwedko
Copy link
Member

Thanks for this report @taind772 .

Currently Vector just uses whatever gethostname returns as the hostname. Can you explain your use-case a bit more? Why do you want to tie it to the node name rather than the pod name?

I think if we do decide to do this enhancement to the "host" detection it should apply equally to all places where Vector annotates the name of the host it is running on in addition to internal_metrics.

@taind772
Copy link
Author

Sorry for the bad & incomplete issue, I take a look back and can't figure out what am I about to say at the time xD.

In my use case, I use Vector to scrape and push Kubernetes pod logs to remote sinks, so it is easier to debug if we know which Kubernetes node Vector pod is running in since the Kubernetes node name is static and I only have one Vector agent per node. The Vector pod name changes after a restart - so it's a bit more tedious to debug (we need to map the pod name to the Kubernetes hostname with Kube state metrics or use metrics relabeling).

I think if we do decide to do this enhancement to the "host" detection it should apply equally to all places where Vector annotates the name of the host it is running on in addition to internal_metrics.

It's better to have a way for users to override the default hostname from gethostname since sometimes users have little control over the host Vector running on and want the host label to represent some other semantic.

After a short look back, I'm confused about the issue myself. Maybe I'm just too lazy to add a join query on metrics, so feel free to close the issue.

@jszwedko
Copy link
Member

Gotcha, I can see why it'd be useful to have the node in that situation. I think we'd be open to configuring the hostname to use (maybe a global hostname parameter).

@jszwedko jszwedko added the domain: config Anything related to configuring Vector label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: config Anything related to configuring Vector domain: observability Anything related to monitoring/observing Vector source: host_metrics Anything `host_metrics` source related source: internal_metrics Anything `internal_metrics` source related type: feature A value-adding code addition that introduce new functionality.
Projects
None yet
Development

No branches or pull requests

2 participants