Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 0 for model.Duration in the table manager #1839

Closed
cyriltovena opened this issue Mar 23, 2020 · 15 comments
Closed

Support 0 for model.Duration in the table manager #1839

cyriltovena opened this issue Mar 23, 2020 · 15 comments
Labels
component/loki good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! keepalive An issue or PR that will be kept alive and never marked as stale. lifecycle/upstream A change must be done to an upstream project first

Comments

@cyriltovena
Copy link
Contributor

cyriltovena commented Mar 23, 2020

Recently the table manager period has been changed to use model.Duration from Prometheus because of a vendoring in Cortex. see https://github.com/grafana/loki/blob/master/vendor/github.com/cortexproject/cortex/pkg/chunk/table_manager.go#L95 and #1838

The problem is that before time.Duration was supporting the value 0. Before it propagates to other fields we should try to suggest in the prometheus common project a change to support the 0 value. Then backport this to Cortex and Loki.

@cyriltovena cyriltovena added component/loki help wanted We would love help on these issues. Please come help us! good first issue These are great first issues. If you are looking for a place to start, start here! lifecycle/upstream A change must be done to an upstream project first labels Mar 23, 2020
@cyriltovena
Copy link
Contributor Author

PR to Prometheus. prometheus/common#226 let's see.

@cyriltovena
Copy link
Contributor Author

Prometheus won't accept this PR. I don't think it's worth wasting time arguing or pushing further. We'll have to use the new 0s default.

@cyriltovena
Copy link
Contributor Author

Change of plan upstream Prometheus accepted the PR. We need to update cortex and then get that into Loki. Should be easy for anyone to take it.

@cyriltovena cyriltovena reopened this Mar 26, 2020
@mmedum
Copy link

mmedum commented Mar 31, 2020

Hi @cyriltovena i would like to do some work on this. Could you get me up to speed quickly on this? :)

@cyriltovena
Copy link
Contributor Author

Sure:

Maybe you should wait for #1869 before starting anything so you don't get conflicts.

@mmedum
Copy link

mmedum commented Mar 31, 2020

Will do. 🙂

Just going to start on one of the other issues.

@mmedum
Copy link

mmedum commented Apr 14, 2020

Hi again @cyriltovena

From what I can tell, PRs should be merged for dependencies. Are you still missing this update or did it already get merged with resolution of #1869?

@cyriltovena
Copy link
Contributor Author

I need to check

@lukashass
Copy link

I just came across an error that I suppose would be fixed by resolving this issue.

failed parsing config: /etc/loki/local-config.yaml: not a valid duration string: "0" while using grafana/loki:latest with the default config file.

It seems this line still uses 0 while the last line in the file was changed to using 0s in 0ad1c6c.

@cyriltovena
Copy link
Contributor Author

@mmedum This is still an issue and this hasn't been fixed by #1869.

If you want to take this, first open a PR on cortex to update prometheus/common there to latest.

Once it's merged in cortex, open a PR here to update cortex to latest.

Good luck ✌️

@lukashass you're probably hitting another one.

chunk_store_config:
  max_look_back_period: 0s

Use this instead of the default and the error will go away.

@mmedum
Copy link

mmedum commented Apr 21, 2020

@cyriltovena Thanks.

But maybe I am a bit useless, from what I can see, cortexproject/cortex uses prometheus/common lastest already.

I have in my fork updated loki to use cortexproject/cortex v1.0.0, as that is the lastest release from what I can tell. But it seems I am hitting a snag with:

go: finding module for package github.com/cortexproject/cortex/pkg/ring/client
github.com/grafana/loki/pkg/distributor imports
	github.com/cortexproject/cortex/pkg/ring/client: module github.com/cortexproject/cortex@latest found (v1.0.0), but does not contain package github.com/cortexproject/cortex/pkg/ring/client

@cyriltovena
Copy link
Contributor Author

Let me check

@cyriltovena
Copy link
Contributor Author

So Cortex doesn't use latest prometheus/common, you can either try to overrides in Loki or update it first in Cortex.

@cyriltovena cyriltovena added the keepalive An issue or PR that will be kept alive and never marked as stale. label May 20, 2020
@ghostsquad
Copy link

I'm following the Tanka installation guide, and I'm running into the same problem. What keys in the jsonnet need to be updated to be 0s instead of 0 ?

@ghostsquad
Copy link

ghostsquad commented Jun 23, 2020

I think I resolved with this below. It would be nice if the defaults just worked.

  _config+:: {
    ...
    loki+: {
      chunk_store_config+: {
        max_look_back_period: "0s",
      },
      table_manager+: {
        retention_period: "0s",
      },
    },
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/loki good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! keepalive An issue or PR that will be kept alive and never marked as stale. lifecycle/upstream A change must be done to an upstream project first
Projects
None yet
Development

No branches or pull requests

4 participants