Expose elasticsearch config schema#57655
Merged
mshustov merged 5 commits intoelastic:masterfrom Feb 21, 2020
Merged
Conversation
Contributor
|
Pinging @elastic/kibana-platform (Team:Platform) |
Contributor
|
We could expose an Observable interface that consumes the raw config and produces clients: // on ElasticsearchSetup
// This would automatically swap out client instances under-the-hood just like
// dataClient
createClusterClient(config$: Observable<ElasticsearchConfigType>): ClusterClient;
// in plugin code
export const config = {
schema: schema.object({
monitoringCluster: coreConfig.elasticsearch.schema
})
}
class Plugin {
setup(core) {
const monitoringCluster = core.elasticsearch.createClusterClient$(
this.config$.pipe(map(c => c.monitoringCluster))
);
}
} |
Contributor
|
I like the suggestion of a |
Contributor
Author
|
@joshdover @rudolf any actionable comments to merge this PR? |
Contributor
Author
|
@elasticmachine merge upstream |
joshdover
approved these changes
Feb 20, 2020
Contributor
joshdover
left a comment
There was a problem hiding this comment.
Don't have any reason to block on this, but one suggestion might be to mark these exports as @alpha since we may (will?) change these later.
Contributor
There was a problem hiding this comment.
Wow api-extractor, this is ugly 🙁
5c0193c to
cab9176
Compare
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
mshustov
added a commit
to mshustov/kibana
that referenced
this pull request
Feb 21, 2020
* expose elasticsearch config schema * update docs * mark export as alpha since it can be deleted Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 task
jloleysens
added a commit
to jloleysens/kibana
that referenced
this pull request
Feb 21, 2020
…-out-of-legacy * 'master' of github.com:elastic/kibana: (109 commits) document difference between log record formats (elastic#57798) Expose elasticsearch config schema (elastic#57655) [ui/agg_response/tabify] update types for search/expressions/build_tabular_inspector_data.ts (elastic#58130) [SIEM] Cleans Cypress tests code (elastic#58134) fix: 🐛 make dev server Storybook builds work again (elastic#58188) Prevent core savedObjects plugin from being overridden (elastic#58193) Expose serverBasePath on client-side (elastic#58070) Fix legend sizing on area charts (elastic#58083) Drilldown plugin (elastic#58097) [skip-ci] Fix broken links to saved objects APIs in MIGRATION.md (elastic#58033) [ML] New Platform server shim: update datafeed routes (elastic#57739) Add flag for building static storybook site (elastic#58050) add monaco to kbn/ui-shared-deps and load required features for all uses (elastic#58075) [SIEM] Let us try out code owners for a little while and see what happens Add throttle param to Alerting readme (elastic#57609) [NP] Move ui/saved_objects to NP (elastic#57452) [Logs UI] Fix column reordering in settings page (elastic#58104) Fix browser date format (elastic#57714) Add filter for ILM phase to Index Management (revert elastic#45486) (elastic#57402) Clarify Precision function in Timelion Kibana (elastic#58031) ... # Conflicts: # x-pack/.i18nrc.json
mshustov
added a commit
that referenced
this pull request
Feb 21, 2020
* expose elasticsearch config schema * update docs * mark export as alpha since it can be deleted Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
mbondyra
added a commit
to mbondyra/kibana
that referenced
this pull request
Feb 21, 2020
…_improve-advanced-settings-save * commit '02efb01c481f9f24d8d707f06dfc68b2fb805001': (43 commits) [Endpoint] Add a flyout to alert list. (elastic#57926) Make sure index pattern has fields before parsing (elastic#58242) Sanitize workpad before sending to API (elastic#57704) [ML] Transform: Support multi-line JSON notation in advanced editor (elastic#58015) [Endpoint] Refactor Management List Tests (elastic#58148) [kbn/optimizer] include bootstrap cache key in optimizer cache key (elastic#58176) Do not refresh color scale on each lookup (elastic#57792) Updating to @elastic/lodash@3.10.1-kibana4 (elastic#54662) Trigger context (elastic#57870) [ML] Transforms: Adds clone feature to transforms list. (elastic#57837) [ML] New Platform server shim: update fields service routes (elastic#58060) [Endpoint] EMT-184: change endpoints to metadata up and down the code base. (elastic#58038) document difference between log record formats (elastic#57798) Expose elasticsearch config schema (elastic#57655) [ui/agg_response/tabify] update types for search/expressions/build_tabular_inspector_data.ts (elastic#58130) [SIEM] Cleans Cypress tests code (elastic#58134) fix: 🐛 make dev server Storybook builds work again (elastic#58188) Prevent core savedObjects plugin from being overridden (elastic#58193) Expose serverBasePath on client-side (elastic#58070) Fix legend sizing on area charts (elastic#58083) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #56872, #56618
Required to unblock Monitoring plugin migration.
Plugins are allowed to create a custom elasticsearch config that will be used for custom elasticsearch clients. Although I only found that
monitoringallows to re-define elasticsearch config values.The current implementation is the most straightforward and there are several things that I don't like:
@kbn/config-schemadoesn't allow to re-write validation rules locally. YAGNI, but I can imagine such a requirement in the future.I think we can live with it for some time, but I assume we may want to refactor this part. To get rid of
ElasticsearchConfigclass of to move elasticsearch config validation to the platform, for example. Should I open a discussion about it or we are okay with the current approach?For maintainers