[ 
https://issues.apache.org/jira/browse/IGNITE-17721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kirill Gusakov updated IGNITE-17721:
------------------------------------
    Description: 
For dynamic configuration of metrics exporters here 
https://issues.apache.org/jira/browse/IGNITE-17358 we need to have the config 
like:
{code:java}
metrics.exporters
  http:
    port: 19191
  opentelementry:
    agent_port: 18{code}
So:
 * every exporter have it's config with unique config schema
 * this configs placed in named list with appropriate name

But there are no ways to do it at the moment:
 * if we use AbstractConfiguration we can't place it inside the NamedConfigValue
 * if we use PolymorphicConfigwe need to manually set the name of exporter 
twice, like:

{code:java}
metrics.exporters
  http:
    type: http
    port: 19191
  opentelementry:
    type: opentelemetry
    agent_port: 18{code}
Code example:
{code:java}
@ConfigurationRoot(rootName = "metrics", type = ConfigurationType.DISTRIBUTED)
public class MetricConfigurationSchema {
    @NamedConfigValue
    public ExporterConfigurationSchema exporters;
}

@PolymorphicConfig
public class ExporterConfigurationSchema {
    @PolymorphicId
    public String exporterName;
}

@PolymorphicConfigInstance("jmx")
public class JmxExporterConfigurationSchema extends ExporterConfigurationSchema 
{} {code}
 

> Make AbstractConfiguration a legal inside NamedConfigValue
> ----------------------------------------------------------
>
>                 Key: IGNITE-17721
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17721
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Kirill Gusakov
>            Priority: Major
>              Labels: ignite-3
>
> For dynamic configuration of metrics exporters here 
> https://issues.apache.org/jira/browse/IGNITE-17358 we need to have the config 
> like:
> {code:java}
> metrics.exporters
>   http:
>     port: 19191
>   opentelementry:
>     agent_port: 18{code}
> So:
>  * every exporter have it's config with unique config schema
>  * this configs placed in named list with appropriate name
> But there are no ways to do it at the moment:
>  * if we use AbstractConfiguration we can't place it inside the 
> NamedConfigValue
>  * if we use PolymorphicConfigwe need to manually set the name of exporter 
> twice, like:
> {code:java}
> metrics.exporters
>   http:
>     type: http
>     port: 19191
>   opentelementry:
>     type: opentelemetry
>     agent_port: 18{code}
> Code example:
> {code:java}
> @ConfigurationRoot(rootName = "metrics", type = ConfigurationType.DISTRIBUTED)
> public class MetricConfigurationSchema {
>     @NamedConfigValue
>     public ExporterConfigurationSchema exporters;
> }
> @PolymorphicConfig
> public class ExporterConfigurationSchema {
>     @PolymorphicId
>     public String exporterName;
> }
> @PolymorphicConfigInstance("jmx")
> public class JmxExporterConfigurationSchema extends 
> ExporterConfigurationSchema {} {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to