Skip to content

sidecar: wait on ext labels before uploading#1287

Merged
bwplotka merged 2 commits intothanos-io:masterfrom
mjd95:wait-on-ext-labels-before-uploading
Jul 5, 2019
Merged

sidecar: wait on ext labels before uploading#1287
bwplotka merged 2 commits intothanos-io:masterfrom
mjd95:wait-on-ext-labels-before-uploading

Conversation

@mjd95
Copy link
Contributor

@mjd95 mjd95 commented Jun 28, 2019

Addresses #1239 by adding a step that will force a wait on external labels before starting the shipper (when upload is enabled).

Note that the case of len(m.Labels()) is already checked in the sidecar when it initially syncs with Prom. However, we don't currently hard-fail if len(m.Labels())==0as we retry indefinitely. With this PR, we would now hard-fail in that case (after 2 minutes).

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Just not sure about number - otherwise perfect, thanks! 👍

At some point we will have nice healthyness checks we can control the readiness as well a bit more.

g.Add(func() error {
defer runutil.CloseWithLogOnErr(logger, bkt, "bucket client")

extLabelsTimeout := 2 * time.Minute
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if 2 min is ok, maybe worth to increase or expose via flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah fair point. I've increased it, quite a lot actually to 10 minutes. We should probably be conservative here (don't want to kill anything we shouldn't) and I'd rather avoid a flag if possible. Feel free to adjust the value though, I might be missing some context on startup times :)

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks!

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