last day (82 days later) » 

hi
@KyleBrandt interesting, this chat thing
 
@user2757887: I don't know who you are...
 
it's me dieter. i changed my name on my profile but this doesn't update.
 
Ah, what about your profile I posted above :-P
 
ah i think i have 2 profiles
 
8:09 PM
Anyways, we can post images in here, and also due to the holidays they might be a lot of delay in our chat, so this keeps a transcript you can always go back and read
Also, no netsplits
I wonder if we onebox github code...
Nope :-(
 
question about opentsdb parseduration:
// ParseDuration is equivalent to time.ParseDuration, but supports time units specified at http://opentsdb.net/docs/build/html/user_guide/query/dates.html.
func ParseDuration(s string) (Duration, error) {
but the input of that function is whatever the user entered in the alert def right? shouldn't that always be something like "10m" ?
i.e. <number>m ?
 
@user2757887: Supports all the relative time units as specified in the link you posted
ie. can be 1h, 2w
 
but if it's the native opentsdb format, why does it need to be parsed at all? can't bosun then just use the literal variables given by the user and pass those on straight to opentsdb?
 
we used to do that
 
I think we changed it for result caching?
 
8:20 PM
but sometimes we need to move "now" around, so bosun now converts relative times into absolute times
yes
 
Oh right, in our testing interface you can change the time of "now"
 
bosun lets us execute rules in the past to see how they would have resulted then. so we can't just pass on the "10m-ago" format.
 
so it probably makes most sense that i reuse the existing duration stuff for graphite
 
Ya I think so, part of what makes this hard is the code refactoring for this. i.e. it shouldn't be opentsdb.ParseDuration, it should be bosun.ParseDuration or something
 
yup
 
8:24 PM
err, maybe
 
Maybe not hard, but "involved"
 
i think it should perhaps stay where it is, because it's definitely paring OpenTSDB-style durations
 
Ah this makes sense
 
it actually is the most general purpose simple way to do it, it just happens to be the opentsdb way
but it also seems the best way for graphite, so that makes it general purpose :?
 
@mjibson: For reference Dieter is behind metrics20.org , works as Vimeo, we met at LISA
 
8:28 PM
that's how i think of it, at least
 
the graphite docs say they support: "The following time units can be used to specify the amount: years, months, weeks, days, hours, minutes, or seconds. These units can be used in singular or plural form, and abbreviated naturally or to a single letter (e.g. +3days, -1wk, -3y). Several time units can be combined (e.g., -5mon1w2d) or concatenated (e.g., -5h45min = -5h-45min = -6h+15min = -7h+1h30m-15min, etc.)"
 
Kyle are your in NYC, just curious
 
@user2757887: Nope I'm down in Hollywood, FL
Matt is NY though
 
Matt, true, graphite's native format is different, but i don't think bosun should write parsers for all timeformats of all backends just to able to do that go-back-in-history thing
i rather tell bosun users "do it in this format" and we make sure we generate a request to graphite it understands
 
ok, that's reasonable
 
8:33 PM
if we're parsing and converting to time.Duration and then generating the opentsdb/graphite/... request later we can make the accepted format as simple or complex as we want to support
 
@user2757887: I'm going to ask to get your SO accounts merged, that cool?
 
yes please, thanks!
if my email address could somehow become dieter@plaetinck.be that'd be nice too
whenever i try to login with that email, it says it doesn't exist
but it claims it can send "forgot password mails" to it..
.. which then don't arrive
so i never understood what was going on
 
@Dieter_be: There we go
 
func timeRequest(e *State, T miniprofiler.Timer, req *opentsdb.Request) (s opentsdb.ResponseSet, err error) {
what's that for?
 
When using the interface you can get performance breakdowns of how long stuff took via some console commands - @mjibson can tell more
 
8:50 PM
can i just not do the timeRequest in my GraphiteQuery() ? (the function in funcs.go that takes the query and emits the *Results)
it seems complicated so i rather just not invoke it at all
 
Yup
 
also why is the opentsdb Request Start and End not just a time.Duration? it seems to be the string format, which means that func (r *Request) SetTime(t time.Time) has to parse the Start for example, add the diff, and then format as string again.
 
timeRequest is just a wrapper for opentsdb queries (no need to use this for graphite)
because opentsdb supports absolute or relative times
 
but bosun generates all requests programatically, so it could just generate whatever based on a time.Duration, no?
 
the opentsdb package is not bosun-specific
it is useable by any one who wants to work with opentsdb
 
8:55 PM
oh, ok
 
and a time.Duration doesn't support absolute times
which are used in the graph page or when running rule checks in the past
 
since graphite supports unix timestamps for from/until, i think i'ld just make the graphite Request Start/End unix timestamps; that way it doesn't support the full graphite from/until spec, but i'm not that ambitious
and it keeps the parsing and generation of timestamps easy. thoughts?
 
9:10 PM
In meeting, be back in 1hr
 
9:30 PM
hey @mjibson i'm getting a bit confused. i've tried stacktracing but there's so much walk/walkbinary/walkFunc going on and i lost track.
func GraphiteQuery(e *State, T miniprofiler.Timer, query string, sduration, eduration string) (r *Results, err error) { <-- is anything ever being done with the r being returned?
cause right now my r is just a pointer to a new Results, but it doesn't contain anything, should it?
 
That result is what gets returned to bosun, i.e. you might avg(graphiteq(...))
 
o_O
the default Query() returns:
(*expr.Results)(0xc208101110)({
Results: ([]*expr.Result) <nil>,
IgnoreUnjoined: (bool) false,
IgnoreOtherUnjoined: (bool) false,
NaNValue: (*float64)(<nil>)
})
so it's just a struct with some options? i don't see a reference to the query string in there
 
9:45 PM
i oops that's my current graphite result, i was trying to inspect the one from an opentsdb Query() call
but i probably can't cause i don't have opentsdb :p
 
If you need an opentsdb instance and you have docker, I have a docker public image for opentsdb available, docker pull petergrace/opentsdb-docker
 
or expose the opentsdb port 4242 when running the bosun image (http://bosun.org/quickstart.html#docker)
docker run -d -p 4242:4242 -p 8070:8070 stackexchange/bosun
 
@mjibson @KyleBrandt i'm realizing i can't just uncomment the timeRequest() call because that's what actually executes the check, via e.context.Query(), but the whole context/state thing all seems very opentsdb specific, so i'm trying to turn that into a generic interface, but that seems a bit like a rabbithole
mostly because it has a bunch of properties.. i'll just have 1 State type that has properties for both opentsdb and graphite
 
10:01 PM
We put the query strings in computations
@Dieter_be: Also for reference godoc.org/bosun.org/cmd
@Dieter_be: The computations are a member of expr.Result , and we have a method for adding those godoc.org/bosun.org/cmd/bosun/expr#Result
But yes the results is a little bit confusing. Results is a struct, one of that struct's members is Results, which is an array (slice) of pointers to expr.Result
But browsing that godoc link might help you figure things out a lot more
So in funcs.go, there is the builtins. That maps the function you enter in bosun to functions in Go code. It also creates a signature
Okay, thia actually just changed, need @mjibson to explain
But roughly if we look at "q" in builtins
"q": {
[]parse.FuncType{parse.TypeString, parse.TypeString, parse.TypeString},
parse.TypeSeries,
tagQuery,
Query,
},
It takes 3 arguments that all must be strings, and returns a Series. It does this by calling the Query Go func
I don't know what tagQuery is about, that is new
 
yeah
so i have a GraphiteQuery that's kindof like Query
 
expr.State adds context to the query
But yes this is kind of hard, we didn't design this with the idea of supporting multiple backends, so State problably needs refactoring
 
yeah i refactored it and it compiled, so that's something :p
 
hopefully that doesn't look too awfull
 
@Dieter_be: Once you get it working, @mjibson can comment up all the things to make for better Go code :-)
 
the way the opentsdb Context is done is interesting, it's an interface, but the only implementation of it i could find is Host, which is just a type alias for a string and just calls the request.Query with itself as arg
 
Ya, so I'm not entirely sure what the right pattern is there, maybe the interface should be expr.Context or something, and both graphite and opentsdb fulfill it
 
anyway my main problem is figuring out where the context is being set
because when i call e.graphiteContext.Query(&r) , i get a nilpointer
confirmed: e.graphiteContext is nil
do you know @KyleBrandt ?
 
10:30 PM
Looking
 
thanks
 
So lets see...
expr.Execute is what creates the state...
when a builtin is called it is passed the State somehow
Ya, I'd just skip the timing :-P
@mjibson: Calling uncle on the state context stuff, can you fill in @Dieter_be and me?
 
10:47 PM
but execute gets the context as an argument
so who calls execute
 
@Dieter_be: Either The schedule package or the web package
 
it'd be nice to do a hangout @KyleBrandt & @mjibson to familiarize with the code base.
 
@Dieter_be: I can hangout in just a few minutes, let me walk the dog
 
i have to leave in 15min
and i was hoping it would be with matt cause you're not being very useful lol
;)
 
@Dieter_be: K, well to answer the question it is either the schedule package, which is running the alert rules loaded from the conf, or the web package which is gettings its requests via the web api (which the web interface calls)
 
10:51 PM
oh
 
I think what needs to happen is that it should take an expr.Context, and both opentsdb and graphite should fulfill that interface. But I haven't really created many interfaces, only used them, so haven't had much practice with design there
 
ack 'Execute(' reveals a bunch of calls, anyway i can just panic() and see which one itis
 
hmm checkExpr takes the context from rh *RunHistory
 
Ya the second example from the web is clearer
 
10:55 PM
@Dieter_be opentsdb.Cache is also an implementation of opentsdb.Context
 
aha indeed kyle. and yep matt
 
i can hangout now if you like
or tomorrow after 1PM EST
 
matt just so you know the problem is my GraphiteQuery() in funcs.go needs to call e.graphiteContext.Query() and i was trying to figure out where to set the graphitecontext (graphite hostname) on the state
can't do now, i have to go somewhere unfortunately
tomorrow afternoon works!
 
godoc.org/bosun.org/cmd/bosun/expr#Expr.Execute is the function where the OpenTSDB host and other things are set
it creates the expr.State and passes that around to functions
there is an opentsdb.Context interface because I wanted a simple one (Host) and a caching one (Cache)
 
k yeah, i think i know enough to proceed, thanks guys!
 
11:01 PM
@mjibson so shouldn't we change the signature on that and state to be noon opentsdb specific?
 
but that's the only reason i needed it. for graphite, you may not need a context
@kyle no, because a graphite query function or context will be another parameter to expr.Execute
you can just use nil for the opentsdb context to disable opentsdb queries
 
i do need a graphite context, because the graphite context is ust the graphite url (just like opentsdb does it), how else would i track the graphite url?
s/ust/just/
 
@Dieter_be we used to just pass the opentsdb host as a string and not an interface
it later got upgraded to an interface because i wanted a fancy and a simple implementation
 
Why does the expr package care if it is graphite or OpenTSDB?
 
@kyle because the q and band functions use opentsdb, not graphite
this is about supporting multiple backends at once
not a single, pluggable backend
 
11:04 PM
right
 
Ah okay, I was thinking graphite should be pluggable
 
i also like the idea of being able to use multiple backends
 
I see graphite and opentsdb to be primary stores. I wouldn't someone to use both
 
if someone somehow has that kindof environment, why not? :)
 
we could potentially only support one backend, so all of our existing query functions work the same across all of them
i'd rather not worry about that, though, because it can lead to difficulties when various services act slightly different than others
and it becomes a very leaky abstraction
 
11:08 PM
gotta go, see you guys
 
@mjibson: hang?
 
yes
 
in sre
 
11:33 PM
Okay, n backends is right - I understand now
 

  last day (82 days later) »