Git Product home page Git Product logo

Comments (8)

kakkoyun avatar kakkoyun commented on June 8, 2024

Hey @darwin67, thanks a lot for reaching out. I'm happy that you're using it.

From your log output, I suspect you have multiple entries for rule groups in your Prometheus configuration.

level=error ts=2019-09-24T17:44:32.749Z caller=manager.go:833 component="rule manager" msg="loading groups failed" err="groupname: \"thanos-querier.rules\" is repeated in the same file"
level=error ts=2019-09-24T17:44:32.749Z caller=manager.go:833 component="rule manager" msg="loading groups failed" err="groupname: \"thanos-receive.rules\" is repeated in the same file"
level=error ts=2019-09-24T17:44:32.749Z caller=manager.go:833 component="rule manager" msg="loading groups failed" err="groupname: \"thanos-store.rules\" is repeated in the same file"

Could you share more of your jsonnet files, especially the ones that you use mixin.libsonnet?

from kube-thanos.

darwin67 avatar darwin67 commented on June 8, 2024

@kakkoyun this is the full list of imports I have in my jsonnet.

local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-static-etcd.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-anti-affinity.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-thanos-sidecar.libsonnet') +

           (import 'kube-thanos/kube-thanos-querier.libsonnet') +
           (import 'kube-thanos/kube-thanos-store.libsonnet') +
           // (import 'kube-thanos/kube-thanos-pvc.libsonnet') + // Uncomment this line to enable PVCs
           (import 'kube-thanos/kube-thanos-compactor.libsonnet') +
           (import 'kube-thanos/kube-thanos-receive.libsonnet') +
           (import 'kube-thanos/kube-thanos-sidecar.libsonnet') +
           (import 'kube-thanos/kube-thanos-servicemonitors.libsonnet') +

           // (import 'thanos-mixin/mixin.libsonnet') +

           (import 'lib/node-tolerations.libsonnet') +

I think the only other mixin besides thanos are the etcd stuff. I haven't configured any rules of my own so there's nothing custom that could have caused the collusion.
So the only thing that might have collided would be the things generated from the kube-prometheus. Ring any bells on your end?

This is the source for jsonnetfile.json btw.

{
  "dependencies": [
    {
      "name": "kube-prometheus",
      "source": {
        "git": {
          "remote": "https://github.com/coreos/kube-prometheus",
          "subdir": "jsonnet/kube-prometheus"
        }
      },
      "version": "v0.2.0"
    },
    {
      "name": "kube-thanos",
      "source": {
        "git": {
          "remote": "https://github.com/metalmatze/kube-thanos",
          "subdir": "jsonnet/kube-thanos"
        }
      },
      "version": "master"
    },
    {
      "name": "thanos-mixin",
      "source": {
        "git": {
          "remote": "https://github.com/metalmatze/kube-thanos",
          "subdir": "jsonnet/thanos-mixin"
        }
      },
      "version": "master"
    }
  ]
}

from kube-thanos.

darwin67 avatar darwin67 commented on June 8, 2024

Oh wait, could it be because I'm importing it twice?
And it somehow duplicated the rules?

from kube-thanos.

darwin67 avatar darwin67 commented on June 8, 2024

So I tried changing the jsonnetfile.json to this.

{
  "dependencies": [
    {
      "name": "kube-prometheus",
      "source": {
        "git": {
          "remote": "https://github.com/coreos/kube-prometheus",
          "subdir": "jsonnet/kube-prometheus"
        }
      },
      "version": "v0.2.0"
    },
    {
      "name": "kube-thanos",
      "source": {
        "git": {
          "remote": "https://github.com/metalmatze/kube-thanos",
          "subdir": "jsonnet"
        }
      },
      "version": "master"
    }
  ]
}

Then updated the subpath in the jsonnet like the following.

local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-static-etcd.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-anti-affinity.libsonnet') +
           (import 'kube-prometheus/kube-prometheus-thanos-sidecar.libsonnet') +

           (import 'kube-thanos/kube-thanos/kube-thanos-querier.libsonnet') +
           (import 'kube-thanos/kube-thanos/kube-thanos-store.libsonnet') +
           // (import 'kube-thanos/kube-thanos/kube-thanos-pvc.libsonnet') + // Uncomment this line to enable PVCs
           (import 'kube-thanos/kube-thanos/kube-thanos-compactor.libsonnet') +
           (import 'kube-thanos/kube-thanos/kube-thanos-receive.libsonnet') +
           (import 'kube-thanos/kube-thanos/kube-thanos-sidecar.libsonnet') +
           (import 'kube-thanos/kube-thanos/kube-thanos-servicemonitors.libsonnet') +

           (import 'kube-thanos/thanos-mixin/mixin.libsonnet') +

           (import 'lib/node-tolerations.libsonnet') +

And problem still persist. I'm now suspecting one of the two,

  • there are duplicate rules in kube-prometheus and kube-thanos
  • there are duplicate rules in kube-thanos

from kube-thanos.

metalmatze avatar metalmatze commented on June 8, 2024

You don't want to import the thanos-mixin with the rest of the kube-thanos ksonnet/Kubernetes files.
Here's an example on how we use it ourselves:
https://github.com/observatorium/configuration/blob/master/environments/sre/prometheusrules.jsonnet#L1
https://github.com/observatorium/configuration/blob/master/environments/sre/prometheusrules.jsonnet#L52

from kube-thanos.

darwin67 avatar darwin67 commented on June 8, 2024

You don't want to import the thanos-mixin with the rest of the kube-thanos ksonnet/Kubernetes files.

Ugh, is this by design? It does seems to be a leaky abstration to me if that's what I need to do...

from kube-thanos.

metalmatze avatar metalmatze commented on June 8, 2024

Yes, this is by design. In the future, maybe the thanos-mixin would be moved to Thanos directly, as this is strictly coupled to what metrics Thanos exposes in each version.
Think of kube-thanos as a project for Kuberentes and thanos-mixin is completely separate defining rules, alerts and dashboards.

from kube-thanos.

darwin67 avatar darwin67 commented on June 8, 2024

Okay, got it. Closing then.

from kube-thanos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.