-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Scrapers - Capture host and port of monitored endpoint as resource attributes #7081
Comments
@Aneurysm9, @dashpole, as code owners of the |
Are the
|
This is a good point. I don't think we are necessarily beholden to them in the context of metrics. My assumption is that we should align across signal types wherever reasonable though.
I'm not aware of any others. |
Resource attributes should be common to all signal types, I would think, as they describe the resource that produced the signal. I'm not sure that the That said, there don't seem to be any resource attributes that are appropriate here and, to the extent that we're deriving them from information available on the scraping side and not having the resource identify itself, we probably will not have any good options. |
That's true, but I think it would often be correct. When it's not, I would think it's still the closest we can get to meaningfully identifying the resource from which the metrics was pulled. To speculate a bit - is this why prometheus uses the more generic term |
They're actually used for HTTP metrics as well. In this instance, |
Ah, perfect. Then I think those conventions should apply to the prometheus receiver.
I would agree if this were a metric about the prometheus receiver itself, but i'm not sure it makes sense for metrics scraped from an application. If the collector is doing resource detection on a metric produced by an application, I think attributes should be detected from the perspective of the application, rather than the perspective of the collector. The prometheus endpoint is technically the peer of the collector, but I would find it confusing to see a |
If the canonical labels are |
+1. I think this supports the original proposal of using
I would be in favor of setting |
…y#7081) This change simplifies the generated pdata code to not wrap orig fields in the internal package for structs that are not being used by other packages. The code generator is adjusted to generate wrapped or unwrapped code for only for structs that need it based on the package name. The only exception is `Slice` struct that was pulled from the generator because: - We don't have and don't expect to have any new slices that are used by other packages. - The `Slice` struct have two additional methods `AsRaw` and `FromRaw` that are not generated and defined in a separate file which is a bit confusing.
Metric scrapers typically pull data from a known host and port. The metrics produced by a scraper would be more useful if placed in the context of the resource they describe. Therefore, scrapers should capture these values as resource attributes, when possible.
The semantic conventions define the attributes
net.host.name
andnet.host.port
here, and I believe these are appropriate for this use case.Additional Context
Prometheus produces telemetry with basically the same information via the instance label, although this is a combined field, defined as
<host>:<port> part of the target's URL that was scraped
.The
prometheusreceiver
splits theinstance
and saves the host and port ashost.name
andport
. We likely want to use the same attribute names in both the prometheus and non-prometheus cases, but perhaps some prometheus experts can shed light on whether there is a distinction here I'm missing.The text was updated successfully, but these errors were encountered: