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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/inline tags for all #55

Open
wants to merge 23 commits into
base: 3.x
Choose a base branch
from

Conversation

p3r7
Copy link

@p3r7 p3r7 commented Dec 23, 2016

PR to answer enhancement reported in issue #53

Implementation details:

  • as all TaggableCollectors are in fact "InlineTaggable", I renamed the interface InlineTaggableGaugeableCollector into TaggableGaugeableCollector
  • I added inline tags support for: Telegraf, InfluxDB and Prometheus
  • I added global tags support for: DogStatsD

Some stuff to look for before merging:

  • I wrote some new UT for InfluxDB and Prometheus but only tested the InfluxDB ones, due to being unable to download the prometheus client lib on my MS Windows station.
  • I made the global tags overridable by passing inline tags with similar keys. This is debatable.

Enjoy!

@p3r7
Copy link
Author

p3r7 commented Dec 23, 2016

OK, just discovered those automated travis UT checks.

Nevertheless, I'ms struggling to debug my Prometheus UT, due to the aforementioned reasons 😧

/**
* InlineTaggableGaugeableCollector interface.
*/
interface InlineTaggableGaugeableCollector
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can not remove an interface, that's a BC break.

I did not look at the code for now, but If you have to do it, you have to depreciate it and provide an upgrade path.

But honestly, I prefer to not remove it to not break the BC.

baartosz and others added 4 commits March 6, 2017 14:14
This PR was squashed before being merged into the 2.x-dev branch (closes beberlei#56).

Discussion
----------

Added in memory collector

Hi.
I needed to measure processes' metrics and retrieve them in same request/run and hook it up with existing storing procedures. It will be useful to stick to same interface later when we will move that outside to graphite or something. I think it may be useful for others too in some cases.

Commits
-------

466ee27 Added in memory collector
This PR was merged into the 2.x-dev branch.

Discussion
----------

Fixed CS

Commits
-------

0fb6d89 Fixed CS
@buffcode
Copy link

@lyrixx: I would like to pick up this feature for Prometheus. As Prometheus will switch from TaggableCollector to InlineTaggableGaugeableCollector and thus lose setTags(), what is your preference for an upgrade path?

@p3r7
Copy link
Author

p3r7 commented Mar 31, 2017

@buffcode : you do not need to remove the setTags(), it could still be used for global tags, shared by all metrics sent with the Prometheus instance.
See my implementation of it: https://github.com/beberlei/metrics/pull/55/files#diff-04d32a4646baea06bfa885af51292796

I sadly didn't quite got the time to work on this branch lately, and would gladly accept someone taking ownership or just helping, specifically with the prometheus UT. I can't debug them on my M$ Windows station, as the prometheus lib won't download via composer on this OS...

@lyrixx
Copy link
Collaborator

lyrixx commented Apr 3, 2017

you do not need to remove the setTags(), it could still be used for global tags, shared by all metrics sent with the Prometheus instance.

👍

This PR needs a rebase BTW.

@p3r7
Copy link
Author

p3r7 commented Apr 27, 2017

🙌 OK, I merged (rebase wasn't happy, probably due to the deleted InlineTaggableGaugeableCollector.php) and finally managed to debug the failing Prometheus UTs.

I added back the InlineTaggableGaugeableCollector interface, even though no class implement it no more.

Indeed:

  • all classes that were InlineTaggableGaugeableCollector are now TaggableCollector + TaggableGaugeableCollector
  • all classes that were TaggableCollector still are, but now support inline tags, in addition to global ones

@lyrixx : I would like some guidelines regarding how to mark the InlineTaggableGaugeableCollector and what you call providing an upgrade path. Is that a sort of documentation ?

@p3r7
Copy link
Author

p3r7 commented May 2, 2017

OK, I made the DogStatsD collector implement back InlineTaggableGaugeableCollector, and did the same to Telegraf one.
I discovered the @deprecated annotation and so deprecated the InlineTaggableGaugeableCollector interface.

This way, we should not have any BC break. @lyrixx, are you OK with this approach ?

@p3r7
Copy link
Author

p3r7 commented Nov 9, 2017

Any news concerning this PR ?

@p3r7 p3r7 closed this Nov 9, 2017
@p3r7
Copy link
Author

p3r7 commented Nov 9, 2017

Ouspy, accidental close

@p3r7 p3r7 reopened this Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants