Skip to content

Conversation

tomwilkie
Copy link
Contributor

So we can visualise query execution, to help with #132

@tomwilkie
Copy link
Contributor Author

(I'm just pushing the changes to the scope vendored code back to scope)

- Add grpc middleware to client and server
- Emit spans from TimeRequestHistogram
@tomwilkie
Copy link
Contributor Author

Pay attention to the bits in:

  • cmd/cortex/main.go
  • distributor/distributor.go
  • util/middleware/auth.go
  • util/http.go

Have tested extensively locally.

"github.com/mwitkow/go-grpc-middleware"
"github.com/opentracing-contrib/go-stdlib/nethttp"
"github.com/opentracing/opentracing-go"
"github.com/tomwilkie/loki/client"
Copy link
Contributor

Choose a reason for hiding this comment

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

After all we went through before, this really should be "weaveworks/loki".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a personal project right now.

prometheus.MustRegister(resourceWatcher)
}

tracer, err := loki.NewTracer(loki.DefaultConfig)
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be command-line options for scrape intervals & timeouts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scrape intervals are defined by loki (as it is in prometheus).

Copy link
Contributor

Choose a reason for hiding this comment

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

In Prometheus, they are defined in the configuration file. Here, we're using the defaults in Loki with no way of customizing them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've literrally copied the exact way prometheus does this: https://github.com/tomwilkie/loki/blob/master/pkg/config/config.go

Are we talking cross purposes?

return nil, err
}

// TODO push ctx all the way through, so we can do cancellation (eventually!)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we doing this TODO now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, done.

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.

2 participants