GithubHelp home page GithubHelp logo

Prometheus rework about pelorus HOT 3 OPEN

mateusoliveira43 avatar mateusoliveira43 commented on June 12, 2024
Prometheus rework

from pelorus.

Comments (3)

weshayutin avatar weshayutin commented on June 12, 2024

this does in fact seem to be a nice written representation of what we spoke about.

  • add time window to exporters (only accept data with timestamp as value that is higher than exporter instance creation, but it not more than a threshold) (except committime exporter, because it only collects commit after a deployment)
  • explain this new behavior in the docs to user

I don't recall discussing these two, but seems like the right move to me.

  • remove deploy active metric
  • add clean up to metrics endpoint and increase scrapping time interval (no need to be every 15s)

from pelorus.

mpryc avatar mpryc commented on June 12, 2024
  • remove deploy active metric
  • This is resolved by #943
  • OPTIONAL Test if it is possible to deploytime metric do not use exactly timestamp (prometheus would use timestamp it received (because of ~3horus receive problem) and use exactly timestamp as value)
  • agree, additional tests:
    • check scenario where we deploy test application let's call it TestApp
      • deploy TestApp it 10 times every 30min (can be a simple shell script with sleep)
      • wait 2h before going into grafana
      • After that test number of deploymets over the following periods:
        • last 2 hours, should give 0
        • previous 2h (so 4h ago -> 2h ago) should give 4 deployments;
        • last week - should give 10 deployments.
    • check scenario where we create 10 deployments using webhook exporter and then restart webhook exporter (just delete running webhook instance).
      • wait 10 min
      • check how many deployments happened in the last week
      • check how many deployments happened in the last 5 minutes
  • add clean up to deploytime, committime and failure exporter
  • This I think is't really required as the scrape always get the new Gauge object, so we could have this for free. Just need to check if the caching in committime requires some cleanup.
  • add clean up to webhook exporter (seems harder than on the old exporters)
  • Agree. There should be a lifetime of metric after which it is removed. The way I see it:
    • Collect metrics not older than X (as implemented in #943)
    • Add function to check if the time of event where it happened is not greater then Y and remove it if it's true.
  • add time window to exporters (except committime exporter)
  • explain this new behavior in the docs to user
  • Agree.

from pelorus.

mpryc avatar mpryc commented on June 12, 2024

RE: cleanup functionality

I think we should create a new class for the metrics that inherits from GaugeMetricFamily, let's call it PelorusGaugeMetricFamily.

This class should have at least three additional methods:

def clear_all_metrics(self) -> int:
"""
Clears out all the in memory metrics from the GaugeMetricFamily.

Returns:
  - number of metrics removed
"""

def clear_metrics(self, threshold_sec: int) -> int:
"""
Clears out the in memory metrics from the GaugeMetricFamily, which are
above certain threshold 

Arg:
  - threshold_sec (int): The time threshold in seconds. All metrics that occurred `threshold_sec` seconds ago or earlier will be removed.

Returns:
  - number of metrics removed.
"""

def remove_metric(self, labels: Sequence[str]) -> int:
"""
Remove particular metric from the GaugeMetricFamily.
Reverse function to GaugeMetricFamily.add_metric().

Arg:
  - labels Sequence[str]: The labels representing metric to be removed.

Returns:
  - number of metrics removed.
"""

from pelorus.

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.