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

Add show plan endpoint #961

Merged
merged 6 commits into from
Jul 25, 2018
Merged

Add show plan endpoint #961

merged 6 commits into from
Jul 25, 2018

Conversation

saheemg
Copy link
Contributor

@saheemg saheemg commented Jul 12, 2018

This is the first step in implementing #864.
It is needed now to help us at Bloomberg provide a programmatic interface to metrictank for native functions ONLY.

@saheemg
Copy link
Contributor Author

saheemg commented Jul 12, 2018

@shanson7

@shanson7
Copy link
Collaborator

I already did an internal review of this function. My only outstanding comment is the duplication of code, but @saheemg decided that the simpler duplication was easier.

api/graphite.go Outdated
response.Write(ctx, response.NewError(http.StatusBadRequest, err.Error()))
return
}
response.Write(ctx, response.NewJson(200, plan, ""))
Copy link
Contributor

@replay replay Jul 23, 2018

Choose a reason for hiding this comment

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

models.GraphiteRender allows the caller to choose one out of four formats, but this will always return Json. I think it probably makes sense that this reuses the model, but for consistency there should either be some error or a correctly formatted response if another format than json was specified.

api/graphite.go Outdated
return
}

reqRenderTargetCount.Value(len(request.Targets))
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 confusing if this target count shows up in the same metric as the target count of actual render requests. Often when we need to analyse an MT that's in trouble due to heavy requests we rely on this metric, if showPlan() also records the evaluated number of targets in that same metric it could lead to confusion.

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 will remove this.

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.

LGTM

@replay replay merged commit 1bc5b4c into grafana:master Jul 25, 2018
Dieterbe added a commit that referenced this pull request Aug 6, 2018
@shanson7 shanson7 deleted the addShowPlan branch February 24, 2020 11:30
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.

None yet

4 participants