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

feat(metrics-operator): add support for user-friendly duration string for specifying time frame #2147

Merged
merged 26 commits into from
Sep 27, 2023

Conversation

bacherfl
Copy link
Member

@bacherfl bacherfl commented Sep 21, 2023

Closes #2129

This PR adds the feature described in #2129. The name of the new property is spec.timeframe.recent and it accepts a duration string as an input. As the name suggests, if this property is set to a value x, the timeframe for the analysis will be between now() - x and now(). This timeframe is derived at the first time the Analysis is being reconciled. The derived timestamps are then stored in the status of the Analysis, otherwise the timeframe might shift over the course of multiple reconciliation loops.

@netlify
Copy link

netlify bot commented Sep 21, 2023

Deploy Preview for keptn-lifecycle-toolkit ready!

Name Link
🔨 Latest commit 1ab71d7
🔍 Latest deploy log https://app.netlify.com/sites/keptn-lifecycle-toolkit/deploys/6513f15da741950008b0dae9
😎 Deploy Preview https://deploy-preview-2147--keptn-lifecycle-toolkit.netlify.app/docs/crd-ref/metrics/v1alpha3
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #2147 (eb005a6) into main (98097e6) will increase coverage by 0.04%.
The diff coverage is 91.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2147      +/-   ##
==========================================
+ Coverage   84.52%   84.57%   +0.04%     
==========================================
  Files         152      153       +1     
  Lines        9804     9881      +77     
==========================================
+ Hits         8287     8357      +70     
- Misses       1230     1237       +7     
  Partials      287      287              
Files Coverage Δ
metrics-operator/api/v1alpha3/analysis_types.go 100.00% <100.00%> (ø)
...etrics-operator/controllers/analysis/controller.go 84.74% <100.00%> (+0.39%) ⬆️
...rator/controllers/analysis/objectives_evaluator.go 77.27% <100.00%> (ø)
...or/controllers/common/providers/datadog/datadog.go 89.36% <100.00%> (ø)
...trollers/common/providers/prometheus/prometheus.go 84.04% <100.00%> (ø)
...-operator/controllers/common/providers/provider.go 100.00% <ø> (ø)
...ollers/common/providers/dynatrace/dynatrace_dql.go 80.75% <0.00%> (ø)
...ontrollers/common/providers/dynatrace/dynatrace.go 83.87% <0.00%> (ø)
metrics-operator/api/v1alpha3/analysis_webhook.go 91.66% <91.66%> (ø)

... and 4 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 65.91% <ø> (ø)
component-tests 58.65% <ø> (ø)
lifecycle-operator 85.02% <ø> (ø)
metrics-operator 87.50% <91.95%> (+0.09%) ⬆️
scheduler 32.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Signed-off-by: Florian Bacher <[email protected]>
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 21, 2023
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
…ion-string-support

# Conflicts:
#	metrics-operator/controllers/analysis/controller.go
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
@bacherfl bacherfl marked this pull request as ready for review September 25, 2023 06:28
@bacherfl bacherfl requested review from a team as code owners September 25, 2023 06:28
Signed-off-by: Florian Bacher <[email protected]>
odubajDT
odubajDT previously approved these changes Sep 25, 2023
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
RealAnna
RealAnna previously approved these changes Sep 27, 2023
Signed-off-by: Florian Bacher <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Sep 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@RealAnna RealAnna left a comment

Choose a reason for hiding this comment

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

🎃

@bacherfl bacherfl merged commit 34e5384 into keptn:main Sep 27, 2023
40 checks passed
RealAnna pushed a commit that referenced this pull request Sep 27, 2023
… for specifying time frame (#2147)

Signed-off-by: Florian Bacher <[email protected]>
RealAnna pushed a commit that referenced this pull request Sep 27, 2023
… for specifying time frame (#2147)

Signed-off-by: Florian Bacher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation helm lifecycle-operator metrics-operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analysis: Add support for duration string time selector
5 participants