On 10/31/2016 11:59 PM, Matt Wringe wrote:
hmm, interesting, we can list all the values values of a key, but not
get the list of the key itself?
No one has asked for such feature (or created a
ticket) ;)
Very simple to do though:
return (SELECT DISTINCT tenant_id, tname FROM metrics_tags_idx)
.filter(r -> tenantId.equals(row.getString(0))
.map(r -> r.getString(1))
.distinct()
.toList()
.map(HashSet<T>::new); // Technically redundant, distinct uses a Set already
And there you have it. Now go code ;)
But the more important tag we want to keep track of is labels, and in
this case the value is an array of key:value pairs, which doesn't work
too nicely. We store this as a comma separated string and its possible
to use regex in this case, but it starts to be really messy to write
and is prone to errors. Its really not a great solution and looks
really bad when people have to write these complex queries which
should be really easy.
For quick fix, we could use a workaround like some
applications that
have had this feature introduced later in the life-cycle: Use some
non-visible Unicode to separate the labels. Then just recreate them as
an array when returning the values.
This is simple to do and regexp matching is easy to fix without any user
visibility (we split the value before doing the matching).
This feels like an 'event' what could be marked. I don't
know if it
needs to be applied to a datapoint directly, or stored in a separate
list, or if it even needs to be stored in Hawkular Metrics.
I'd store it separately and then just in the reading phase enrich the
data with this. Such as event "deployment started", "deployment ended"
in the strings metrics (or something like it) and then merge that with
the datapoints fetched.
The main thing I think is to be able to query the list of events
which have occurred over a specific time frame.
And the previous suggestion answers
this one.
OpenShift has a lot of events it can gather, it could be really cool
if we could display these events as marks in the graphs. I don't know if we can use
Hawkular Metric string metrics to store these, or something in Alerts to do it. Heapster
has a component to gather these events for us
(
https://github.com/kubernetes/heapster/tree/master/events).
I think we discussed
this year or so ago, but nothing ever happened to
it (I think I even asked if I should implement the events part of
Heapster, but no one needed it at that point).
Actually, I discussed this first time when I sent the original mail to
Google guys if we can create the integration to Hawkular from Heapster.
We may want to keep track of historic changes to tags. I know in
OpenShift we store values in tags which can change at any point in time but I don't
believe we can query what the values was at time X.
This will require some changes
to the data storage, the previous
suggestions do not. This is a snapshot feature, but we don't have that
in Cassandra (unlike Accumulo has for example).