Skip to content

[Prometheus] Disable leader election; Remove default value for bearer token #4034

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

Merged

Conversation

tetianakravchenko
Copy link
Contributor

@tetianakravchenko tetianakravchenko commented Aug 18, 2022

Signed-off-by: Tetiana Kravchenko tetiana.kravchenko@elastic.co

What does this PR do?

For cases when prometheus is running not on kubernetes, prometheus integration does not work:

  • defined default value for bearer_token cause those errors:
{"log.level":"error","@timestamp":"2022-08-18T09:02:02.484Z","log.origin":{"file.name":"process/stdlogger.go","file.line":54},"message":"metricbeat_monitoring stderr: \"panic: close of closed channel\\n\\ngoroutine 2015 [running]:\\ngithub.com/elastic/beats/v7/metricbeat/beater.(*Metricbeat).Stop(0xc0009d44d0)\\n\\t/go/src/github.com/elastic/beats/metricbeat/beater/metricbeat.go:276 +0x28\\ngithub.com/elastic/beats/v7/libbeat/cmd/instance.(*Beat).launch.func5()\\n\\t/go/src/github.com/elastic/beats/libbeat/cmd/instance/beat.go:461 +0x68\\nsync.(*Once).doSlow(\"","agent.console.name":"metricbeat_monitoring","agent.console.type":"stderr","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2022-08-18T09:02:02.484Z","log.origin":{"file.name":"process/stdlogger.go","file.line":54},"message":"metricbeat_monitoring stderr: \"0xc0010807d0, 0xc001201c00)\\n\\t/usr/local/go/src/sync/once.go:68 +0x138\\nsync.(*Once).Do(0xc0010807d0, 0xc001201c00)\\n\\t/usr/local/go/src/sync/once.go:59 +0x45\\ngithub.com/elastic/elastic-agent-libs/service.HandleSignals.func1()\\n\\t/go/pkg/mod/github.com/elastic/elastic-agent-libs@v0.2.5/service/service.go:60 +0x20c\\ncreated by github.com/elastic/elastic-agent-libs/service.HandleSignals\\n\\t/go/pkg/mod/github.com/elastic/elastic-agent-libs@v0.2.5/service/service.go:49 +0x25c\\n\"","agent.console.name":"metricbeat_monitoring","agent.console.type":"stderr","ecs.version":"1.6.0"}
  • enabled leader election works only on kubernetes

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

Collector data_stream:

Screenshot 2022-08-23 at 10 10 31

Screenshot 2022-08-23 at 10 10 46

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@tetianakravchenko tetianakravchenko added the bug Something isn't working, use only for issues label Aug 18, 2022
@tetianakravchenko tetianakravchenko requested a review from a team as a code owner August 18, 2022 15:06
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@elasticmachine
Copy link

elasticmachine commented Aug 18, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-23T11:21:27.095+0000

  • Duration: 14 min 40 sec

Test stats 🧪

Test Results
Failed 0
Passed 15
Skipped 0
Total 15

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Aug 18, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚 2.836
Classes 100.0% (0/0) 💚 2.836
Methods 66.667% (6/9) 👎 -22.699
Lines 100.0% (0/0) 💚 9.085
Conditionals 100.0% (0/0) 💚

@gizas
Copy link
Contributor

gizas commented Aug 18, 2022

Adding the comment if can be out from advanced setttings.

As for k8s+prometheus the value needs to change to true and users will have to search to find it

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
@tetianakravchenko
Copy link
Contributor Author

@gizas I've changed it and moved leader election from advanced settings

@tetianakravchenko tetianakravchenko merged commit e85849e into elastic:main Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Prometheus integration] leader election enabled for non k8s environment causing metricbeat crash
4 participants