metrics
metrics copied to clipboard
Feature/inline tags for all
PR to answer enhancement reported in issue https://github.com/beberlei/metrics/issues/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!
OK, just discovered those automated travis UT checks.
Nevertheless, I'ms struggling to debug my Prometheus UT, due to the aforementioned reasons :anguished:
@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?
@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...
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.
:+1:
This PR needs a rebase BTW.
:raised_hands: 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 nowTaggableCollector
+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 ?
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 ?
Any news concerning this PR ?
Ouspy, accidental close