-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[SLOs][Fleet] Install integration SLO assets #186974
base: main
Are you sure you want to change the base?
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
const sloAssets = assetsToInstall.filter((asset) => asset.type === KibanaSavedObjectType.slo); | ||
|
||
await installSLOAssets({ sloAssets, sloClient, soClient, esClient, spaceId }); | ||
|
||
return installedAssets; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahzad31 Don't we want to return here all installed assets including the sloAssets
?
x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts
Outdated
Show resolved
Hide resolved
...n/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx
Outdated
Show resolved
Hide resolved
@shahzad31 I noticed this You need to add in this file following:
UPDATE |
A couple more things: When I uninstall Nginx, the SLO doesn't get deleted. I guess you haven't handled this yet, right? We need to make sure that when we delete the integration, the SLO gets deleted |
const sloAssets = [ | ||
...(allAssets ?? []), | ||
{ | ||
attributes: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try to remove this hardcoded SLO and integrate it with this PR. Not sure how at the moment. Need to look into this. @muthu-mps Any idea how to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgiota - We can try getting the content using the getAssetFromAssetsMap and remove the hardcoded values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok cool! @shahzad31 If you can clean up this branch to not contain all these changes from main, then we can do the change recommended by @muthu-mps
|
||
const installedAssets = await installKibanaSavedObjects({ | ||
logger, | ||
savedObjectsImporter, | ||
kibanaAssets: assetsToInstall, | ||
kibanaAssets: assetsToInstall.filter((asset) => asset.type !== KibanaSavedObjectType.slo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it makes sense to add slo
to KibanaSavedObjectType
and KibanaAssetType
if it's not installed the same way as other kibana assets. Other types are filtered out in line 125.
SLOs could be installed in a separate function added here, where each type of asset has its own function (kibana assets, ilm policies, etc.)
If we still think semantically SLOs belong in kibana assets, I think it makes sense to keep the installation in installKibanaAssets
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 if they are installed differently it may be interesting to have his own assets type and persist it in the installation saved object as his own properties.
Having them mixed mean we will have to do some filtering in a lot of codepath deletion/upgrade and it will be easy to miss one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLOs have saved objects but it also install few other resources like ingest pipelines and transorm, so can't be just bundled under traditional kibana saved objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One do you think of introducing a new slo_assets
key (by space if SLO are space aware) for the saved object installation? instead of using the kibana_assets one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if we go that way it will be great to have a new step installSloAssets so that code is not mixed in the installKibanaAssets part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes SLOs are space aware.
Hi @shahzad31 we are in the process of making Fleet more space aware, I am curious does SLOs are space aware? in that case we may want to think of a way to install them in multiple space. Similar to what we do with kibana assets #186620 |
Pinging @elastic/fleet (Team:Fleet) |
@jsoriano Just want to let you know that this PR is under review. Once we solve some permission issues we found, I guess you need to release a new version of package registry? We will keep you posted, once this PR is merged. Please let us know if there is anything else that needs to be done on our side |
@muthu-mps Thanks! With above mentioned settings, indeed I get no transform error. |
@elasticmachine merge upstream |
Thanks for the heads-up! There are no related changes planed in the package registry for SLOs, so I don't think we need to prepare a release for it. Or is there something missing in package registry responses? |
@muthu-mps : Is this a make shift arrangement until the changes are merged into Kibana or is the customer expected to create this user post the merge as well ? |
The current shift arrangement is to test it locally. We are not going to suggest this change for the customer. Validating what is the suitable way in which we can handle this behaviour. |
Based on our weekly call today, we agreed to put this ticket on hold and look into alternative options. The main idea of making SLOs available out of the box with Integrations is not accomplished through this ticket because of the extra work around permissions, Transforms, and license checks. It appears to have the opposite effect of making it easier for customers to onboard SLOs. Further discussion needs to be done on how we can create a template and how SLO and Fleet integration permissions can be incorporated into a better user experience of onboarding SLOs |
Hello @grabowskit, This is the meta which captures all the things we require to make the SLO's work for Integration Packages. IMHO, we should carry on with this change wrt. adding the ability in Fleet to add/delete/update the SLO and carry forward the work required for licenses as part of the other issue. |
@ishleenk17 Thanks for the meta ticket. In the list I would add this issue as well, which handles the permissions errors I found in the current PR.
I made a first attempt to solve the permission issues in this commit and here's how the reauthorization workflow would look like. I haven't pushed the changes in the current PR. I first need to clarify a few things with Fleet team, since I am adapting current Fleet logic to meet our SLO needs. Screen.Recording.2024-08-01.at.16.40.39.movI have a couple more things I would like to clarify with Fleet/Integrations team.
There are quite a few open questions, that's why further discussions need to be done. As @grabowskit mentioned we put this ticket on hold. Once I am back from PTO in two weeks, we can revisit how we want to move forward. I wouldn't merge current PR as is. Permission issue needs to be solved and pushed into current PR. |
While we click the installed SLO from the integration assets tab this opens the SLO in the cc: @ishleenk17 |
I am right now reviewing this PR. Once above PR is merged, I would like to re-check current PR. I suspect that privilege issue might be solved with the use of |
|
In order to proceed on this PR, I suggest this PR be merged post checking of https://github.com/elastic/obs-integration-team/issues/50? @juliaElastic can you please help with codeowner approval? I suggest the future enhancements can be taken separately: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@shahzad31 : Can we please resolve the conflicts and merge the PR. Looks like we have all the approvals now. @pzl: Could you please provide code owner spproval. |
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled in files
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@shahzad31 - Just pulled the latest code changes to validate few scenarios. The SLO installation was not successful with the recent changes. In the assets tab the SLO ID appears, but I am unable to see the SLO getting created or viewed in the SLO page. Can you please check it once? |
@shahzad31 @mgiota do you know if there are plans to ship this feature in 8.16? |
Summary
Install integration SLO assets !!
How to test with Ngnix Integrations PR
The following instructions describe how to run kibana from source code while leveraging elastic-stack capabilities: elasticsearch, fleet-server, elastic-agent using elastic-package. On a high level, we need to
a)
build and start the stack from the integrations branch that adds the SLO to the Nginx package,b)
stop the Kibana container,c)
do some changes to thekibana.dev.yml
and thend)
start the kibana process from source code.git clone git@github.com:YOUR_USERNAME/integrations.git
cd packages/ngnix
go run github.com/elastic/elastic-package check
go run github.com/elastic/elastic-package stack up -d -v --version 8.15.0-SNAPSHOT
docker stop elastic-package-stack-kibana-1
Kibana
repo locallykibana.dev.yml
file as shown belowexport NODE_EXTRA_CA_CERTS="$HOME/.elastic-package/profiles/default/certs/kibana/ca-cert.pem"
yarn kbn bootstrap
yarn start --no-base-path
Integrations
App and install theNginx
packageconfig/kibana.dev.yml
elastic-package creates a local stack that uses HTTPS using generated CA, certificates, and keys. All the certificates are stored locally in the $HOME/.elastic-package/profiles/default/certs/ sub folders. You need to update your kibana.dev.yml file accordingly and replace $HOME to actual path.