Expectations for setting service.name
in a scraper
#43125
Unanswered
jon-signal
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm working on a new metrics receiver and am trying to understand the expectations for setting attributes that are required by resource semantic conventions. I'm using https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/redisreceiver as an example, since the service from which we're trying to extract metrics has a similar "shape:" we can communicate with the service to get a human-readable, plaintext dump of the service's status that we can then parse and publish as metrics. Even if the receiver I'm building doesn't make it into the
opentelemetry-collector-contrib
repo, usingmdatagen
and thescaper
framework seems to make the job a lot easier.I notice that the Redis receiver doesn't declare
service.name
in its metadata and also doesn't seem to set it anywhere in its code. The former doesn't surprise me (sinceservice.name
is "defined" elsewhere), but the latter does a little. What's the expectation for settingservice.name
with the Redis receiver, and for scrapers/receivers in general? I can think of a few scenarios, but none seems quite right.service.name
viaenvironment variables(EDIT: scratch that—I missed that the environment variable approach is for the SDK, not the Collector) or processor? Unless I'm mistaken, this would essentially require one Collector deployment per running service, right?conventions.AttributeServiceName
via the low-levelpcommon.Resource
API. I don't see this happening in any contributed receiver, though, and suspect it's something of a model mismatch.service.name
somewhere in its metadata/implementation? I don't think this is the case since no other receivers seem to do so, either.In any case, I can certainly find a way forward, but I am curious about the standard practice is for cases like this. Thanks kindly!
Beta Was this translation helpful? Give feedback.
All reactions