Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

more tracing #713

Merged
merged 5 commits into from
Aug 30, 2017
Merged

more tracing #713

merged 5 commits into from
Aug 30, 2017

Conversation

Dieterbe
Copy link
Contributor

  • add more spans to get more insights:
    • getSeries (minus consolidate/divide when needed, itersToPoints, Fix())
    • GetSeriesAggMetric (ringbuffer)
    • CCache.Search (chunkcache)
    • CassandraStore.SearchTable (store)
  • more stats about render:
    eg oldest_in_ring, points_fetch, points_return
  • use utility functions to aid with:
    • creating new spans
    • logging errors properly. we were abusing "error.kind"

@Dieterbe Dieterbe force-pushed the tracing-v2 branch 2 times, most recently from 36553d1 to 2aeeb51 Compare August 24, 2017 09:43
* add more spans to get more insights:
  - getSeries (minus consolidate/divide when needed, itersToPoints, Fix())
  - GetSeriesAggMetric (ringbuffer)
  - CCache.Search (chunkcache)
  - CassandraStore.SearchTable (store)
* more stats about render:
  eg oldest_in_ring, points_fetch, points_return
* use utility functions to aid with:
  - creating new spans
  - logging errors properly. we were abusing "error.kind"
This only covered the cases where we can call WriteErr explicitly,
and obviously doesn't work e.g. when bind.Bind returns an error

This reverts commit d90a3a6.
in a way that works with our own errors, as well as
those emitted by standard/3rd party middlewares like bind.Bind

error=true is set for internal errors, not for users doing
invalid requests and so on.
@Dieterbe Dieterbe requested review from replay and woodsaj and removed request for replay August 25, 2017 07:19
res := s.getSeries(ctx)
res.Points = append(s.itersToPoints(ctx, res.Iters), res.Points...)
func (s *Server) getSeriesFixed(ctx context.Context, req models.Req, consolidator consolidation.Consolidator) []schema.Point {
rctx := newRequestContext(&req, consolidator)
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it might be nicer to just make ctx an attribute of rctx, otherwise having two contexts around can be confusing.

@@ -131,7 +141,9 @@ func (c *CCache) evict(target *accnt.EvictTarget) {
}
}

func (c *CCache) Search(metric string, from, until uint32) *CCSearchResult {
func (c *CCache) Search(ctx context.Context, metric string, from, until uint32) *CCSearchResult {
ctx, span := tracing.NewSpan(ctx, c.tracer, "CCache.Search")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised the compiler doesn't complain about this ctx being unused, I assume that's probably because it's a recycled name, but anyway it's unused

}

// Basic search of cassandra in given table
// start inclusive, end exclusive
func (c *CassandraStore) SearchTable(key, table string, start, end uint32) ([]chunk.IterGen, error) {
func (c *CassandraStore) SearchTable(ctx context.Context, key, table string, start, end uint32) ([]chunk.IterGen, error) {
ctx, span := tracing.NewSpan(ctx, c.tracer, "CassandraStore.SearchTable")
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, unused ctx

Copy link
Contributor

Choose a reason for hiding this comment

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

actually that probably really doesn't matter much since that memory of ctx is already allocated anyway. the only difference is that by using a _ instead of assigning to ctx we could save a few ops for overwriting that memory, which is probably not significant

@Dieterbe
Copy link
Contributor Author

PTAL @replay

Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

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

Looks good now

@Dieterbe Dieterbe merged commit bee081d into master Aug 30, 2017
@Dieterbe Dieterbe deleted the tracing-v2 branch September 18, 2018 09:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants