Skip to content

Enable multi instances metrics#108

Open
jansouza wants to merge 13 commits intoMiguelNdeCarvalho:mainfrom
jansouza:main
Open

Enable multi instances metrics#108
jansouza wants to merge 13 commits intoMiguelNdeCarvalho:mainfrom
jansouza:main

Conversation

@jansouza
Copy link
Copy Markdown

  • Use python:3.10-slim
  • Include Packet Loss metric (speedtest_packet_loss)
  • Remove speedtest_server_id metric and Add server_id to the metric label
  • Use logging for debug/info (SPEEDTEST_LOG_LEVEL)
  • Add /health

@MiguelNdeCarvalho
Copy link
Copy Markdown
Owner

Hey

@jansouza really thanks for your contribution, whenever I can I will take a look on that!

Thanks,
MiguelNdeCarvalho

Copy link
Copy Markdown
Owner

@MiguelNdeCarvalho MiguelNdeCarvalho left a comment

Choose a reason for hiding this comment

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

Hey.

@jansouza really thanks for you PR. I have made some comments in things that I think that should be changed. Sorry for the delay.

Thanks,
MiguelNdeCarvalho

Comment thread Dockerfile Outdated
@@ -1,29 +1,30 @@
FROM python:3.10.1-alpine3.15
FROM python:3.10-slim as build
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do we need to change the base image?

Comment thread Dockerfile
RUN apt-get update && apt-get -y install curl

WORKDIR /app
RUN python -m venv /app/venv
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is there a specific way to use a venv inside the container?

Comment thread build.sh
#!/bin/bash
set -e

docker build -t speedtest-img .
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do we need this build.sh as all builds are done by CI

Comment thread destroy.sh
@@ -0,0 +1,8 @@
#!/bin/bash
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do we need this destroy.sh script too?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

since hes not using docker-compose. hes building with "build.sh" and destroying with "destroy.sh"

  • stop both servers
  • remove both containers
  • remove the image

Comment thread src/.flake8
@@ -0,0 +1,5 @@
[flake8]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Any specific reason for ignoring this?

Comment thread src/exporter.py
return ("<h1>Welcome to Speedtest-Exporter.</h1>" +
"Click <a href='/metrics'>here</a> to see metrics.")
"Click <a href='/metrics'>here</a> to see metrics.<br>" +
"Click <a href='/health'>here</a> to see healthy.")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

There is no need to add the /health path here in my opinion!

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.

4 participants