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

Fix exporter; bring up-to-date; add flake8 #3

Merged
merged 6 commits into from
Mar 21, 2024
Merged

Fix exporter; bring up-to-date; add flake8 #3

merged 6 commits into from
Mar 21, 2024

Conversation

TobiasKadelka
Copy link
Collaborator

@TobiasKadelka TobiasKadelka commented Mar 20, 2024

The exporter did error, possibly because the website queried changed a value from int to float.
Another bug I noticed was that a script for CI was added before, but never triggered.

Changes:

  • Change wind_power to float
    • This bug caused the exporter to crash
  • Replace CI workflow file
    • CI was never triggered before
    • adds pyre type checks
  • make code flake8 compliant
    • like the CI file theoretically tried to specify before already
  • Update minimal python version 3.11
    • 3.6 made problems during CI
  • Update readme, imports, usage, comments
    • a lot of information was out of date

The upstream-website seems to have changed the format in which they provide
this value. After changing it to a float the exporter works for me again
like expected.
@TobiasKadelka TobiasKadelka force-pushed the repair branch 2 times, most recently from 6842562 to e24684b Compare March 20, 2024 10:17
@TobiasKadelka TobiasKadelka changed the title WIP: Fix exporter; bring up-to-date; add flake8 Fix exporter; bring up-to-date; add flake8 Mar 20, 2024
The usage did error for me because of the format --web.listen-address
seems to expect -- I assume that comment was out of date.

The relative import did only work when I then run the project from the
directory in which main.py is, not from the root of the repository.
Copy link
Contributor

@aqw aqw left a comment

Choose a reason for hiding this comment

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

LGTM!

A few nits here and there, but no blockers.

I do recommend looking into the change in behavior on listen address.

prometheus_fzj_weather_exporter/main.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
prometheus_fzj_weather_exporter/fzj_weather_crawler.py Outdated Show resolved Hide resolved
group = parser.add_argument_group()
group.add_argument(
'-w', '--web.listen-address',
type=str,
dest='listenaddress',
help='Address and port to expose metrics and web interface. Default: ":9184"\n'
'To listen on all interfaces, omit the IP. ":<port>"\n'
'To listen on all interfaces, omit the IP: ":<port>"\n'
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, this behavior recently changed...

See psyinfra/prometheus-eaton-ups-exporter@162c390

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Dang it, I forgot about that.
I would follow the eaton-ups-exporter and change it to 0.0.0.0

@TobiasKadelka
Copy link
Collaborator Author

Thanks, I added your suggestions and changed the default address to 0.0.0.0 to follow the eaton ups exporter.

Copy link
Contributor

@aqw aqw left a comment

Choose a reason for hiding this comment

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

There's some mixup around 0.0.0.0 vs 127.0.0.1 and what behavior actually changed upstream.

If you have questions, just ask. :-)

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -27,7 +27,7 @@ def main():
else: # listen on all interfaces
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the behavior that changed upstream.

IIRC, the old behavior was to listen on all interfaces if it's not specified. Now it's 127.0.0.1.

I'm not certain though, so you should check into that.

Copy link
Contributor

Choose a reason for hiding this comment

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

We talked and the changes around this will be addressed in another PR.

@aqw aqw merged commit 58c05d8 into main Mar 21, 2024
2 checks passed
@aqw aqw deleted the repair branch March 21, 2024 06:21
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