-
Notifications
You must be signed in to change notification settings - Fork 107
meta-tags (previously known as extrinsic tags) #660
Comments
these are all known issues.
related : #352 |
We would love to be able to add detailed descriptions of metrics, with some way to access this if clicking on some visual indicator on a panel that uses the metric. Users would then be able to really understand what the metric means. Other static data would include things like: |
you're describing a feature request for grafana. maybe @daniellee or @torkelo can advise where to direct that topic. |
Some additional details about the additional meta data / extrinsic tags. The goal is to provide better filtering and group by capabilities in Grafana / MetricTank, by being able to augment the core tags with additional tags / meta data that should work like any first class tags in Grafana. So we would like to be able to upload a set of tags that refer to a core tag on a daily or weekly basis. Initially it's ok if we only have one version of the extrinsic tags, having historical versions and handle changes in them overtime is a nice to have. But not a requirement at this point. |
The big question here I think is how do we want to do the associations? looping in @DanCech we've previously discussed this. but i don't remember the outcome. |
You got it. Basically a "table join" on a given tag the provided (per metric point) tags and the additional tags. As a future enhancement it might be interesting to have two primary tags, so we can limit additional tags to a given namespace. (No need to do this for MVP) As for "the upload" probably the easiest to via special message / topic over kafka. I don't think one upload needs to be atomic, but individual "key tag vale" and "additional tags" can be handled independently from the other tag values. |
After some lengthy discussions, we came up with a concept that may work for this functionality. We would start by adding a separate index to hold meta-records that map tag queries (used to identify target series) with a set of "extrinsic" tag/value pairs to be added to those series. We would then add a second reverse index to allow looking those records up by tag & value, in the same way as the existing reverse index is used to look up series. The existing index would be augmented by adding a list of the meta-records associated with each series. When altering the meta-records the system would look up the associated series (by executing the tag queries against the primary reverse index) and update their lists. When adding a series, it would be compared against each entry in the meta-index to build the list. We may also want to maintain in the meta-index a list of all series that are associated with each record, since we already have to do the work to produce the lists of meta-records associated with each series. This would be a cost in terms of index size, but would potentially be a big performance boost at query time (see below). When executing a query, there are quite a few complex scenarios that would need to be dealt with, mostly around how to deal with query conditions. Basically we would need to pick a query condition that requires a non-empty value (as we do already), then do a lookup for that condition in both reverse indexes. Series matched from the primary index would be added to the prospective result set as normal, while any results from the lookup in the second reverse index would be used to look up series associated with the meta-records (either by executing the tag queries against the main reverse index or by getting a list of matching series directly if they were stored in the meta-record), and those would also be added to the prospective result set. At this point each entry in the result set would need to be "enriched" with the tags from the associated meta-records by walking the list of meta-records in each series (we need to determine how conflicts would be handled when a meta-record contains extrinsic tag values that conflict with other meta-records associated with the series or with intrinsic tags), then we would be able to apply the rest of the query conditions to filter the enriched result down to the final set of series. |
For a concrete use case, we will have tags like As an alternative implementation, it could be possible to send the extrinsic tags along with the normal tags, but not use them to calculate the series id. In that case, metrictank would just need to update the index when a full MetricData message is received with different extrinsic tags. If they don't change then the MetricPoint optimization can still be used. This would mean that the application of extrinsic tags would be handled externally to MT. |
Thinking about this a little this morning, I've got the following notes:
In our particular use case, what we actually need is a mapping from one tag key/value to another. As alluded to in the primary post, most of ours will be keyed off of the That way we could upload something like At query time, we determine if the expressions references an extrinsic tag and do an efficient lookup (likely map) to determine if the current series mapped key matches the requested. e.g. if someone asks for something like
|
from here on, this ticket is about the meta tags. the other tangential ideas (such as uploading generic info for display only but not for searching/filtering) can be done in a new ticket. we're in the design phase for this feature. @replay can you share your work-in-progress design doc. |
This is a status update where I describe where we are at: Over the course of this and next week I'll implement the procedures to update the new index data structures when meta-records get added/modified/deleted and when metrics get added/deleted. @shanson7 I would like to come up with an estimate how much additional memory those new data structures are going to consume, I will already take the current plans to optimize memory efficiency into account (@robert-milan is working on that). Could you maybe provide some numbers of your typical planned use cases of the meta tag index? Such as:
|
We have about 4 million series in the index per MT instance
I'm not sure how to calculate this, but every series has at least 5 tags, so average would be 6 or 7 tags.
We would likely have at least one per host, so in the tens of thousands, each one effecting a small set of the series.
Probably 5-10 |
For reference i'm linking the current design doc from here: https://docs.google.com/document/d/1Kk3QYd3X1yIEUcRFigEjdx23dgZMEH2lM4pmka9oAcc |
Update: There will be at least 4 follow-up PRs, 2-4 are mostly just copying the modifications from the branch of #960 :
After the above is done, I'll need to:
|
Status Update: This refers to the above comment (#660 (comment)): The features listed in points 1 - 4 are done and working in my test environment. Also the "enrichment cache" which is mentioned at the bottom is done and merged. These changes have not been deployed in any production environment yet as far as I'm aware. A PR for the ability to swap out a whole set of meta records is waiting for review: #1442 The persisting of meta records is not implement yet, I'm currently working on that. The plan is to add a new table in Cassandra/BigTable if the feature flag Ideas for improvements:
|
We did some preliminary research with Bloomberg's metrictank setup and enabling metatags comparing setups with varying amounts of metatags (no metatgas to 3 metatags). Details can be found here: https://gist.github.com/agao48/e3e2681d3652b8ca083b32b40733e550. More information like memory and cpu performance while ingesting and querying can also be provided. |
Thanks for the results @agao48. Based on your profile, it looks to me like the enrichment phase is slower than expected. The enrichment works like this:
I have a few questions regarding your benchmarks:
|
For completeness I'm copy pasting the reply that I got from agao48
|
@replay Rebuilt and tested with the master that has that fix. Results in table format below, but looks a lot better. Query:
Test: Before: results from initial benchmarking After: results after fixing bug in get enricher
|
Can we close this issue? As far as I'm aware the feature is "done" as in "it works". If there are any further issues coming up, these would then be a new issue. Or would you prefer to wait with that until you deployed it @agao48? |
I'm ok with closing this. I think we can open more specific issues if/when we find the need. |
Metrics 2.0 supports adding meta data to metrics, however this is at the cost of network bandwidth. A lot of meta data could be very static (e.g. the data-center a machine is in). It would be very nice to have a means for bulk-loading / updating static meta-data and having it merge in with tags.
For example every metric might have a tag host. Associated with the host is a collection of static data, cluster, data-center, os, os-version, etc. We would like to feed this in. From grafana this would appear as tags to the metric.
The text was updated successfully, but these errors were encountered: