-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Datadog: datadog.hostname setting does not appear to affect host inventory display name #29866
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I did more digging into this. The Without explicit
|
Hey, thanks for filing this issue. There's a lot to unpack here, so let me reply below to individual points so that I can hopefully clear up some confusion and get your setup to a satisfying state. Questions about the hostname in the infrastructure list
The If you are familar with the Datadog Agent, the situation there is similar: if you tag something with a
Can you elaborate on this? The Datadog Agent does not have any
That is true, and I agree it is confusing. The first part is not very easy to change today (the second part is easy), but generally making this simpler is in our roadmap. In general using Comments about the hostname picked up by default in different cloud providers
The current implementation focuses on providing compatibility with the Datadog Agent and other Datadog products hostnames by default. OpenTelemetry provides a lot of flexibility to customize your hostname as you see fit, but the default will remain this because otherwise it wouldn't match that chosen by other Datadog products.
There is one exception in AWS, but otherwise it is the same. Here is a table with all the code linked and a brief summary of wht it does
I don't think this is the case. On both the attribute based discovery as well as the builtin provider case all cloud providers are checked before the Kubernetes node name is checked.
Not sure what you mean by this, could you elaborate?
Yup, this is there for legacy reasons indeed. Other Datadog products expect this so we fetch it.
If you have concrete suggestions about this I am happy to tackle this. The logic itself is pretty unwieldy to be able to support a wide range of cases, so it is fundamentally complex, but I am happy to take feedback as to what to simplify while preserving behavior. |
Thanks very much @mx-psi for your comments. I definitely do not expect I did expect it to change the hostname shown in the DD infrastructure view UI. It does not appear to do so. The use of the cloud provider's low level node id (usually exposed in OTLP as It's particularly painful because many DD dashboards only support filtering by host using this low-level host-id, not by host name aliases or tags. "OpenTelemetry Host Metrics Dashboard" is one such example. it's ... not great UX. Putting the table you prepared above into the DD exporter docs, along with the configuration guidance you gave, would be an immense improvement since at least it would be clearly documented that DD expects and requires the low level cloud provider node names, and you cannot get it to use a user-friendly node name instead. Clarifying the behaviour and recommended use of opentelemetry-collector-contrib/exporter/datadogexporter/examples/collector.yaml Line 382 in 0f92b21
In the end though, I don't think it's unreasonable to want to display nodes with the names the user knows those nodes by, not: Individual comments:
I was unclear. I meant that when
So it's not also supposed to set the host name used in the DD infrastructure node list and infrastructure map views? The docs say "Source for the hostname of host metadata", so I would have expected it to use the configured host name. The k8s node name injected via downward api and set as possibly because I currently have
Nodes in the infrastructure view have "tags" sections for "datadog", "user", and if explicit tags are configured in the otel collector, "otel". The DD exporter for the otel collector does not set basic tags that the DD UI appears to expect to be defined by default like so the default view groups everything under "no availability-zone" even AWS nodes that have an AZ (Ignore the missing cpu data, that's a known issue in my current config, and not relevant to this issue) Similarly, there are no tags for cloud provider, region etc. Even though suitable tags are provided on metrics by the except for a couple of limited ones for GCP nodes. |
Thanks again for the detailed reply :)
The explanation is technically correct, but confusing. The infrastructure list will show all hostnames associated with the telemetry you send. It will also show additional data sent on a separate, dedicated payload called 'host metadata'. If present, the In any case that detail is not very relevant for end-users, so we should change the documentation to improve this. I believe these are the things you would like to see:
Am I missing anything? A couple of these are already in our backlog, I will add the rest and link this issue to them so you are kept updated with progress. |
@mx-psi Right, except for "Add 'prettier' hostnames as host aliases by default in cloud provider environments." I want to see the hostname as the primary display name. If there's some low level cloud provider host ID it's useful to have that in the aliases. Either that, or some other means to tell DD's UI what the preferred user-facing host name is. Because If that's just not possible with DD's platform right now, then clear docs to explain that you have to live with the low-level opaque hostnames as the primary display name, why, and that the real hostname is in the aliases. It'd help a lot if dashboards allowed target hosts to be picked via a quicksearch that accepted aliases though. See e.g. the DD opentelemetry hosts dashboard mentioned earlier. Many other places display the meaningless-to-the-user host IDs prominently, but at least most other places allow searching by host alias. And for
I suggest that The Thanks again for engaging on this. |
Example of user experience issues, and why
is more than a minor cosmetic issue: In kube, I have an otel collector called
(This could be any "real" workload on the node that I want to look up in DD too, I'm just using the collector as an example). Because the exporter doesn't even set the alias to the configured node name for Azure nodes, I can't find the node it in DD's infrastructure view: Instead I have to find the CSP-specific internal identifier for the node in the k8s Node resource, which for Azure is in
(For AWS it's in an annotation on the node, for GCP it's somewhere else...) Then I can look this up in DD. Or I could search some metrics tags in DD to figure out the association between the Here I add a filter by tag for the k8s node name: but the metric summary still shows all values for This means it's not even practical to use the metrics sent to DD to map the The config has
and the k8s node name is correctly injected from a downward-api provided env-var on the DaemonSet. At least with the DD agent, the aliases are more consistently sent (I think) so the user has some hope of finding their node. If the dd exporter for the otel collector consistently set node aliases, that would make some small usability improvement here. I might be able to work around it by sending an otel |
@mx-psi For comparison, see here that the proprietary DD agent shows the Azure node's host name as the primary display name, and the Azure VMID (low level system UUID) as an alias. This is the expected, and desired, behaviour for the OpenTelemetry Collector Datadog Exporter too. Compare to the same view of another node that's reporting via the otel collector |
See also #11033 |
@ringerc Thanks again for clarifying, I updated the wording on the list from #29866 (comment) regarding the hostnames and host aliases. I will keep this issue linked with the related tickets and you will get an update when any changes related to these items happen |
Hi, circling back on this, I am going to close this issue with #31702, since after that PR is merged I believe we have made sufficient progress on all the items listed on #29866 (comment). To summarize:
|
…_metadata::hostname_source settings (open-telemetry#31702) **Description:** Improves documentation on the `hostname` and `host_metadata::hostname_source` settings based on feedback from open-telemetry#29866 **Link to tracking Issue:** Fixes open-telemetry#29866
…_metadata::hostname_source settings (open-telemetry#31702) **Description:** Improves documentation on the `hostname` and `host_metadata::hostname_source` settings based on feedback from open-telemetry#29866 **Link to tracking Issue:** Fixes open-telemetry#29866
Thanks for the writeup. My team is running into this issue as well, and even after reading over the updated docs, I don't see a way to prevent datadog from using the ec2 instance id as the host name in the infrastructure list, and creating an alias for the provided host tag, if any (e.g. The only way we've found to prevent datadog from creating this alias is to disable host metadata entirely—and even this only works for new hosts that datadog hasn't seen before. Once a host alias is created, it seems to persist indefinitely (at least for a few days), such that metrics still have their host tag automatically changed by datadog to the instance id server-side even if we stop sending host metadata. Is there really no way to prevent otelcol from using the ec2 instance id as the canonical host name? |
The exporter reports information about:
The
Arbitrary aliases are not currently supported indeed
I believe it may take up to two weeks for the host to be entirely removed from our systems if it stops reporting, yes. |
Thanks @mx-psi. I think I'm still not understanding a few points, though.
My goal here is not to create an alias at all. As far as I can tell, datadog creates the alias, and uses the ec2 instance id as the primary host name, regardless of the value of
Sorry if I'm misunderstanding, but this doesn't seem to be the case. If we send host metadata, the infrastructure list always uses the ec2 instance id, not the hostname field, to name the instance. Even though we set |
From my conversations with a DD product manager and elsewhere, this is apparently a "feature" and will not be changed. |
Component(s)
exporter/datadog
What happened?
Description
The datadog exporter configuration option
hostname
does not appear to affect the hostname displayed as the preferred hostname in the datadog UI infrastructure view host map or host inventory.It continues to use the internal cloud provider id for the host; the configured hostname is assigned as a host alias instead. This is not great, as AWS host IDs are
i-xxxxxxxxxxx
and GCP host-ids are UUIDs like0b797c2d-36cc-4bd4-bdbb-f33d7a0fcc2b
. Many datadog dashboards don't support filtering by host aliases, only by the "main" hostname, so this impacts dashboard usability too.This is the case whether
host_metadata.hostname_source
is set tofirst_resource
orconfig_or_system
.Steps to Reproduce
Configure an OpenTelemetry based datadog agent using the default otel node image
otel/opentelemetry-collector-contrib:0.90.1
.Use the recommended datadog configuration with the
k8sattributes
processor,resourcedetection
processor configs for your cloud environment etc.Add the following to your
DaemonSet
'senv
stanza:Configure the datadog exporter with:
and add your API key config etc.
Visit the linked DD account. Note that the new node shows up in the "Infrastructure -> Host Map" view under its internal cloud provider id (the
host.id
detected by the processors) not the configured hostname.Try changing the
hostname_source
tofirst_resource
. Repeat. You will still see the internalhost.id
as the hostname.Expected Result
I expect to see the value of the
host.name
ork8s.node.name
provided to the datadog exporter, not the internalhost.id
. This is the behaviour seen with the DD agent.If the reported preferred hostname changes after initial node registration, the DD UI should reflect the preferred hostname being sent.
Actual Result
No matter what I do, my nodes show up with the
host.id
for their primary display hostname.The real hostname (k8s node name) is sometimes shown in the "aliases", sometimes not. I've yet to determine why.
The real hostname is not shown in the overviews:
or usable for selecting hosts in dashboards:
I have verified via
kubectl debug
based inspection of the otel collector process's/proc/$pid/env
that theK8S_NODE_NAME
env-var is present and set to the kube node name.Collector version
0.90.1
Environment information
Environment
k8s on Azure AKS, Google Cloud GKE and AWS EKS.
OpenTelemetry Collector configuration
Log output
Additional context
Related issue requesting auto-discovery of host metadata tags: #29700
The text was updated successfully, but these errors were encountered: