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

Per measurement tags for telegraf and InfluxDB #53

Open
p3r7 opened this issue Dec 21, 2016 · 4 comments
Open

Per measurement tags for telegraf and InfluxDB #53

p3r7 opened this issue Dec 21, 2016 · 4 comments

Comments

@p3r7
Copy link

p3r7 commented Dec 21, 2016

Hi there,

First of all, thanks for this great lib. I particularly enjoy this no vendor lock-in approach 馃憤

Most (if not all) formats that support tags support setting different tags for each measurement.

It would be nice to retain the global (per $collector instance) tags, but also to support additional tags that would be set for only the current measurement, via additional (optional) function parameters.

For example:

$collector = \Beberlei\Metrics\Factory::create('telegraf');
$collector->setTags(['app_name' => 'myApp']);
$collector->increment('foo.bar', ['additional_tag' => 'tag_value']);

I could make a PR if you agree with that change.

EDIT: I didn't see that this just got implemented via the InlineTaggableGaugeableCollector interface. Only DogStatsD seems to implement it but Telegraf and InfluxDB should also support it.

@p3r7 p3r7 changed the title Per measurement tags Per measurement tags for telegraf and InfluxDB Dec 21, 2016
@lyrixx
Copy link
Collaborator

lyrixx commented Dec 22, 2016

Hello @p3r7

It looks like a good idea to me.

Could you submit a PR?

Thanks.

@p3r7
Copy link
Author

p3r7 commented Dec 22, 2016

Yeah, sure 馃槈

@buffcode
Copy link

Prometheus also supports per metric labels / tags. Currently they can only be set globally for the service.

http_requests_total{method="post",code="200"} 1027 1395066363000
http_requests_total{method="post",code="400"}    3 1395066363000

Reference: https://prometheus.io/docs/instrumenting/exposition_formats/

@p3r7
Copy link
Author

p3r7 commented Mar 31, 2017

@buffcode : yeah, and I implemented it.
You've seen my PR.
I would gladly accept some help or you taking ownership if you feel like.

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

No branches or pull requests

3 participants