Skip to content

Conversation

@SandeepD2697
Copy link
Contributor

fixes #3727

Hey @mowies I have taken the code changes from the previous contributors and updated it accordingly by adding it in the provider.go and calling when it is elastic. This is my initial version please have a look and let me know the changes I need to make or any enhancements.

For now the methods purpose are-

GetElasticClient: Creates a new Elasticsearch client.
FetchAnalysisValue: Runs a query to get analysis results and returns the metric value.
EvaluateQuery: Runs a metric query for the last 30 minutes and returns the metric value.
runElasticQuery: Executes a query on Elasticsearch and returns the result.
extractMetric: Gets the metric value from the Elasticsearch result.

@SandeepD2697 SandeepD2697 requested a review from a team as a code owner March 4, 2025 16:41
@SandeepD2697 SandeepD2697 changed the title feature: adding Elastic as a metric provider feat: adding Elastic as a metric provider Mar 4, 2025
@SandeepD2697
Copy link
Contributor Author

@mowies @odubajDT Can you please have a look at this when you got some time

@codecov
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 49.21875% with 65 lines in your changes missing coverage. Please review.

Project coverage is 77.41%. Comparing base (7eb3337) to head (ed5b994).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...or/controllers/common/providers/elastic/elastic.go 47.45% 61 Missing and 1 partial ⚠️
...-operator/controllers/common/providers/provider.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3890      +/-   ##
==========================================
- Coverage   77.74%   77.41%   -0.33%     
==========================================
  Files         219      220       +1     
  Lines       11575    11703     +128     
==========================================
+ Hits         8999     9060      +61     
- Misses       2212     2277      +65     
- Partials      364      366       +2     
Files with missing lines Coverage Δ
...rics-operator/api/v1/keptnmetricsprovider_types.go 65.21% <ø> (ø)
...-operator/controllers/common/providers/provider.go 93.61% <70.00%> (-6.39%) ⬇️
...or/controllers/common/providers/elastic/elastic.go 47.45% <47.45%> (ø)

... and 2 files with indirect coverage changes

Flag Coverage Δ
certificate-operator ∅ <ø> (∅)
component-tests ∅ <ø> (∅)
lifecycle-operator ∅ <ø> (∅)
metrics-operator ∅ <49.21%> (∅)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mowies mowies requested a review from a team as a code owner March 17, 2025 08:01
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 17, 2025
@odubajDT
Copy link
Contributor

odubajDT commented Mar 17, 2025

Please add the metrics provider also to the helm charts, helm chart tests and docs, as it was done here https://github.com/keptn/lifecycle-toolkit/pull/3361/files

@SandeepD2697
Copy link
Contributor Author

@odubajDT added elastic as metric provider in helm charts, helm chart tests and docs as suggested

mowies added 2 commits March 18, 2025 09:00
Signed-off-by: Moritz Wiesinger <[email protected]>
Signed-off-by: Moritz Wiesinger <[email protected]>
@sonarqubecloud
Copy link

Copy link
Contributor

@odubajDT odubajDT left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution :)

@mowies mowies changed the title feat: adding Elastic as a metric provider feat: adding Elastic as a metrics provider Mar 19, 2025
@mowies mowies merged commit 1802600 into keptn:main Mar 19, 2025
43 of 44 checks passed
@SandeepD2697
Copy link
Contributor Author

@mowies @odubajDT there is a small bug replated to this PR with passing provider information. I have addressed in this PR can you please have a look?
#3904

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 metrics-operator ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrating Keptn with ELK Stack

3 participants