Skip to content
Draft
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
a5c164a
Add configurable offset
Mar 9, 2021
c0fc041
chore: release 1.5.1 (#118)
slo-generator-bot May 31, 2021
ac3ee2f
ci: Update CI steps (#136)
May 31, 2021
8703c1b
refactor: Update .gitignore and Makefile (#134)
May 31, 2021
8a2525b
feat!: Split dependencies by backend (#129)
May 31, 2021
ecdf9bd
feat!: Support slo-generator config v2 format (core changes) (#126)
May 31, 2021
eeed1b6
feat!: Upgrade slo-generator CLI to Click library (#131)
May 31, 2021
cd30489
docs: Update documentation for v2 (#133)
May 31, 2021
be27c4a
refactor: Upgrade unit tests to v2 (#132)
May 31, 2021
191f36c
feat: Add migrator for v1 to v2 migration (#127)
May 31, 2021
73a3ee0
feat: Add slo-generator Functions Framework API (#130)
May 31, 2021
1705d21
fix: Migrate sample configurations to v2 (#128)
May 31, 2021
a596d57
fix: Minor v2 fixes (#142)
May 31, 2021
d58c4bb
fix: v2 deployment fixes (#143)
Jun 2, 2021
686b6b9
ci: Add quiet flag to alpha builds submit command (#144)
Jun 2, 2021
8455699
ci: Add gcloud components install alpha cmd (#145)
Jun 2, 2021
306a26b
ci: Update workflow to return true (#146)
Jun 2, 2021
392c1ae
fix: Support JSON or text data in API (#147)
Jun 2, 2021
d7f9743
fix: update migrator to fail softly when invalid YAMLs are found (#154)
Jun 21, 2021
ae06013
Trigger new build
Sep 3, 2021
74a2501
fix: Migrator and dependency issues fixes (#160)
Sep 3, 2021
2d3115d
ci: Remove release workflows (#163)
Sep 3, 2021
ee3cac5
ci: Add || true to make cloudbuild cmd (#164)
Sep 3, 2021
d72cfc2
docs: Add Cloudrun docs (#165)
Sep 3, 2021
2fb3f48
Update cloudrun.md
Sep 10, 2021
9f0c2bc
Update cloudrun.md
Sep 10, 2021
52ffd7c
fix: migrator glob catch .yml, .yaml and .json ext
Sep 14, 2021
d5d89a9
Fix typo in converted config
Sep 21, 2021
a894984
style: fix lint after pylint upgrade (#170)
Sep 28, 2021
2d0e03d
feat: add slo-generator JSON schemas (#169)
Sep 28, 2021
b61f51e
fix: migrator not listing all files (#167)
Sep 28, 2021
4888f84
fix: migrator target path locations (#171)
Sep 28, 2021
d539374
feat: add Dynatrace method to query SLO (#116)
clement-pruvot Sep 28, 2021
3b71339
ci: add cloudbuild, rename build to test and deploy to Cloud Run (#168)
Sep 28, 2021
6c0cecf
ci: fix container deploy workflow
Sep 28, 2021
06fc711
Trigger build
Sep 28, 2021
bf4c376
docs: add pointers to v1 docs and v1 to v2 migration
Sep 28, 2021
b88ea7f
ci: fix release workflow
Sep 28, 2021
e762a6b
ci: fix deploy workflow
Sep 28, 2021
badbf79
Remove concurrency for build
Sep 28, 2021
a5e0083
ci: delete sample error budget policy ssm
Sep 28, 2021
cbf7c0f
chore: release 2.0.0 (#139)
slo-generator-bot Sep 28, 2021
711a2a3
docs: update badges
Sep 28, 2021
683320e
docs: add cURL example
Sep 28, 2021
66d2e6b
docs: update readme
Sep 28, 2021
79f9209
fix: yaml loader security issue (#173)
Sep 29, 2021
05318b1
chore: release 2.0.1 (#172)
slo-generator-bot Sep 29, 2021
83cfd13
docs: How to define a latency SLI-SLO from an exponential distributio…
BrunoReboul Sep 29, 2021
74b4541
docs: improve datastudio md (#54)
BrunoReboul Sep 29, 2021
0f37442
Update latency_slo_distrib_metric_cloud_monitoring.md
Sep 29, 2021
ec4534e
Rename docs/pratices/latency_slo_distrib_metric_cloud_monitoring.md t…
Sep 29, 2021
07aaf86
doc: missing labels key
eraac Nov 3, 2021
64dd452
fix: Set Python version to 3.9 (#179)
Nov 25, 2021
d5d1516
fix: bigquery exporter lint (#183)
Dec 9, 2021
71c0820
style: formatting improvements (#178)
yezz123 Dec 9, 2021
c7e4649
docs: correct bigquery.md (#182)
eraac Dec 10, 2021
f6d843a
feat: search SLO configs in subdirectories (#181)
eraac Jan 18, 2022
23b83cf
Revert "feat: search SLO configs in subdirectories (#181)" (#189)
Jan 18, 2022
b8ff3c0
fix: dependency issue with google-cloud-monitoring for the bazilliont…
Jan 18, 2022
cd04d6a
Update README.md
Jan 19, 2022
6ca4d71
fix: better exception handling and error logging (#187)
Jan 19, 2022
13082f8
chore: release 2.1.0 (#188)
slo-generator-bot Jan 19, 2022
770488b
fix: dynatrace slo import (#198)
BatRaph Jan 25, 2022
7e623b0
fix: remove row_ids to solve de-duplication issues (#200)
Jan 25, 2022
1f88aaf
fix: alerting burn rate threshold null in BQ (#201)
Jan 25, 2022
ef76ca6
fix: custom backend path for integration tests (#203)
Jan 25, 2022
feaa637
feat: add batch mode, better error reporting, cloud run docs (#204)
Feb 1, 2022
1279899
docs: clarify API export-only docs (#206)
Feb 2, 2022
75df96d
chore: release 2.2.0 (#205)
slo-generator-bot Feb 2, 2022
64290c6
fix: prevent gcloud crash with python 3.10 during release workflow
lvaylet Mar 24, 2022
67583b2
fix invalid target name in Makefile (#221)
lvaylet Mar 26, 2022
ccbfb5c
fix: add timeFrame to retrieve_slo dynatrace (#212)
florianmartineau Mar 26, 2022
d10fc42
feat: add Prometheus Self exporter for API mode (#209)
djetelina Mar 26, 2022
6b44f53
docs: add missing 'method' field in readme (#213)
Mar 26, 2022
7e1aec9
docs: add Python 3.9 classifier (#226)
lvaylet Mar 27, 2022
393960d
fix: make unit tests pass again with elasticsearch 8.x client (#223)
lvaylet Mar 28, 2022
aeae96e
ci: prevent setup-gcloud actions from failing after master branch get…
lvaylet Apr 2, 2022
391e440
remove deprecated option value for 'disable' (#237)
lvaylet Jun 28, 2022
28582c0
fix: remove useless and unknown Pylint options (#247)
lvaylet Oct 1, 2022
7eaaf8c
feat: add pytype linting (#249)
lvaylet Oct 10, 2022
0ad7ff2
ci: replace deprecated `set-output` command with `GITHUB_OUTPUT` envi…
k1rnt Oct 13, 2022
98a25a7
tests: replace `nose` (in maintenance mode) with `pytest` (#254)
lvaylet Oct 14, 2022
fca2409
ci: run linting and unit tests on multiple python versions (#256)
lvaylet Oct 14, 2022
ecca999
ci: let all `lint`and `unit` jobs complete even if one fails (#261)
lvaylet Oct 16, 2022
9baa33e
feat: add Cloud Monitoring MQL backend (#245)
lvaylet Oct 17, 2022
b045eb9
fix: support custom exporters (#235)
pradeepbbl Oct 19, 2022
8748445
docs: document how to write and configure filters in Cloud Monitoring…
Oct 21, 2022
75b4d71
test: add type hints and `mypy` linting (#239)
faissaloux Oct 23, 2022
fc38839
ci: improve development and CI workflows (#267)
lvaylet Oct 23, 2022
8cb0f1b
fix: update "Development Status" classifier
lvaylet Oct 24, 2022
fdad50c
ci: increase timeout on `build` stage to account for tests added in P…
lvaylet Oct 24, 2022
3003356
chore(master): release 2.3.0 (#270)
slo-generator-bot Oct 24, 2022
dfb70a4
docs: refine development workflow instructions (#275)
lvaylet Oct 25, 2022
79e2cb8
docs: document Cloud Monitoring MQL backend (#277)
lvaylet Oct 25, 2022
3345ca1
fix: migrate `cloud_service_monitoring` backend to `google-cloud-moni…
lvaylet Oct 27, 2022
df335de
chore(master): release 2.3.1 (#276)
slo-generator-bot Oct 27, 2022
60b7dce
docs: update docs and samples with all backends (#283)
lvaylet Oct 27, 2022
4f3c815
fix: remove calls to list and create metric descriptors in Cloud Moni…
realschwa Oct 29, 2022
186b0d7
chore(master): release 2.3.2 (#284)
slo-generator-bot Oct 29, 2022
b1146b5
fix: compute the time horizon of MQL requests more accurately so they…
lvaylet Nov 2, 2022
d355e5b
chore(master): release 2.3.3 (#291)
slo-generator-bot Nov 2, 2022
6e947de
chore: add templates for bug reports and feature requests (#299)
lvaylet Nov 16, 2022
ea48267
fix: implicit Optional type hints are now forbidden (cf. PEP 484) (#301)
lvaylet Nov 16, 2022
09e9dcf
doc: update BigQuery and Data Studio report instructions for Looker S…
lvaylet Nov 23, 2022
22b316b
Merge branch 'master' into add-configurable-offset
lvaylet Nov 25, 2022
3e6545a
reformat with black + fix undefined variable
lvaylet Nov 25, 2022
b01073b
move definition of variable with default value
lvaylet Nov 25, 2022
6b164bf
get class attribute with __dict__
lvaylet Nov 25, 2022
01ff53b
Merge branch 'master' into add-configurable-offset
lvaylet Mar 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions slo_generator/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class SLOReport:
# Data validation
errors: List[str] = field(default_factory=list)

# Global (from error budget policy)
offset: int = 0

# pylint: disable=too-many-arguments
def __init__(self, config, backend, step, timestamp, client=None, delete=False):
# Init dataclass fields from SLO config and Error Budget Policy
Expand Down Expand Up @@ -219,6 +222,14 @@ def run_backend(self, config, backend, client=None, delete=False):
method = instance.delete
LOGGER.info(f"{self.info} | Delete mode enabled.")

# Set offset from class attribute if it exists in the class, otherwise
# keep the value defined in config.
self.offset = max(cls.__dict__.get("DEFAULT_OFFSET", 0), self.offset)
LOGGER.debug(f"{self.info} | Running with offset {self.offset}s")

# Substract offset from start timestamp
self.timestamp = self.timestamp - self.offset

# Run backend method and return results.
try:
data = method(self.timestamp, self.window, config)
Expand Down