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

need new platform plugin access to kibana.index config value currently available in legacy plugins #46240

Closed
pmuellr opened this issue Sep 20, 2019 · 9 comments · Fixed by #51478
Assignees
Labels
blocker Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@pmuellr
Copy link
Member

pmuellr commented Sep 20, 2019

For the Make it Action project, we're adding a new index to be managed by Kibana to store "events" that have occurred with alerts and actions. Current plan is to name this index .kibana-event-log (and there are other resources like an index template and ilm policy, will be using the same .kibana-event-log prefix.

For legacy plugins, this value is available as config.get('kibana.index'), however this config value does not appear to be available in new platform plugins (np plugins only see their own config). Guessing this would be made available by some core or platform API, or perhaps another NP plugin, any of which is fine.

@timroes timroes added Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Oct 1, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@rudolf
Copy link
Contributor

rudolf commented Oct 11, 2019

Based on the discussion in #46705 it seems to make sense to expose the kibana. config namespace as a global configuration namespace available to all plugins. Since we expose the config to plugins through PluginInitializerContext it probably makes sense to also expose the kibana config values here:

export interface PluginInitializerContext<ConfigSchema = unknown> {
  opaqueId: PluginOpaqueId;
  env: { mode: EnvironmentMode };
  logger: LoggerFactory;
  config: {
    /* Global configuration from the 'kibana' configPath */
    kibana$: Observable<KibanaConfigSchema>;
    create: <T = ConfigSchema>() => Observable<T>;
    createIfExists: <T = ConfigSchema>() => Observable<T | undefined>;
  };
}

@mshustov
Copy link
Contributor

@rudolf what other "kibana-wide" config values we will provide there?

@rudolf
Copy link
Contributor

rudolf commented Oct 11, 2019

These are all the current values, we know kibana.enabled isn't needed anymore so we can filter that out, but I think we have to include all the other values until we've decided what to do with our kibana.yml refactor in #46705:

kibana.enabled (should be removed)
kibana.defaultAppId
kibana.index move into saved objects domain as saved_objects.index
kibana.disableWelcomeScreen
kibana.autocompleteTerminateAfter
kibana.autocompleteTimeout

@mshustov
Copy link
Contributor

I'm curious about path.data as well. Does it belong to a particular domain?

@rudolf
Copy link
Contributor

rudolf commented Oct 24, 2019

It seems like path.data is only used for the optimizer and storing a uuid file. If we move uuid to core #48956 there might not be a need to expose this to any other plugins?

But I can imagine that path.data could be useful to other plugins and it would make sense to expose it from the same location.

@mshustov
Copy link
Contributor

@rudolf plugins might want to store their artifacts somewhere in path.data. I can see that reporting and code plugins use this parameter as well.

@lukasolson
Copy link
Member

We also need access to the elasticsearch.shardTimeout in the data plugin. Alternatively, the elasticsearch plugin could be responsible for applying that value as the timeout in all search requests.

@joshdover
Copy link
Contributor

We discussed this in our Platform Weekly meeting today and decided to move forward with providing a non-optimal but quick solution for now:

  • Expose any globally needed config values on single observable on PluginInitializerContext for 7.x (similar to @rudolf's suggestion above)
  • Mark this observable as deprecated and make it obvious in the naming that this will go away.
  • Move these global configs to the appropriate services as part of [New Platform] 8.0 Refactor kibana.yml #46705 and remove the globally exposed config.

This will allow us to move quickly during the migration period so that we can reduce the number of decisions that need to be made right now by having one place where we can add any other needed global config keys.

Example

export interface PluginInitializerContext<ConfigSchema = unknown> {
  opaqueId: PluginOpaqueId;
  env: { mode: EnvironmentMode };
  logger: LoggerFactory;
  config: {
    /**
     * Global configuration
     * Note: naming not final here, do we have any existing convention for naming deprecated properties?
     * @deprecated
     */
    globalConfig__deprecated$: Observable<GlobalConfigSchema>;
    create: <T = ConfigSchema>() => Observable<T>;
    createIfExists: <T = ConfigSchema>() => Observable<T | undefined>;
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants