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

too many open files #69

Closed
juev opened this issue Nov 2, 2021 · 4 comments · Fixed by #71
Closed

too many open files #69

juev opened this issue Nov 2, 2021 · 4 comments · Fixed by #71

Comments

@juev
Copy link

juev commented Nov 2, 2021

Hello, thx for linter!

We have repository with prometheus-alerts:

$ find conf -type f | wc -l
263

When we run linter we got error:

./pint --config rules.hcl lint conf/test
...
level=fatal msg="Execution completed with error(s)s" error="open conf/test/file.yml: too many open files"

update
if we run without config parameters, its work fine:

./pint lint conf/test
...
level=info msg="File parsed" path=conf/test/file.yml rules=1
@prymitive
Copy link
Collaborator

What's your ulimit -n output?
How many Prometheus servers do you have in your config?

@juev
Copy link
Author

juev commented Nov 3, 2021

I use MacOS:

ulimit -n
256

I dont use prometheus servers in config:

rule {
  # Disallow spaces in label/annotation keys, they're only allowed in values.
  reject ".* +.*" {
    label_keys      = true
    annotation_keys = true
  }

  # Disallow URLs in labels, they should go to annotations.
  reject "https?://.+" {
    label_keys   = true
    label_values = true
  }

  # Check if all queries use correct vector matching rules
  vector_matching {}
}

rule {
  match {
    kind = "alerting"
  }

  # This block will apply to all alerting rules.
  # Each alert must have a 'summary' annotation on every alert.
  annotation "summary" {
    severity = "bug"
    required = true
  }

  # Each alert must have a 'grafana' annotation that links to grafana.
  annotation "grafana" {
    severity = "bug"
    value    = "(<|)http(s|)://(grafana.example.com)/(.+)"
  }

  # Each alert must have a 'wiki' annotation that links to wiki.
  annotation "wiki" {
    severity = "bug"
    value    = "(<|)https://(.+).example.com/(.+)"
  }

  # Each alert must have a 'severity' annotation that's either 'critical' or 'warning'.
  label "severity" {
    severity = "bug"
    value    = "(disaster|critical|high|warning|info)"
    required = true
  }

  # Check how many times each alert would fire in the last 1d.
  alerts {
    range   = "1d"
    step    = "1m"
    resolve = "5m"
  }

  # Check if templates used in annotations and labels are valid.
  template {}
}

prymitive added a commit that referenced this issue Nov 3, 2021
@prymitive
Copy link
Collaborator

There was a missing file close, should be fixed via #71

prymitive added a commit that referenced this issue Nov 3, 2021
prymitive added a commit that referenced this issue Nov 3, 2021
@juev
Copy link
Author

juev commented Nov 3, 2021

thx!

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 a pull request may close this issue.

2 participants