Skip to content

Conversation

@rogercoll
Copy link
Contributor

@rogercoll rogercoll commented Jan 27, 2025

Usage (composed type so extra fields can be added):

type ElasticsearchClient struct {
	configelasticsearch.ClientConfig `mapstructure:",squash"`

	CacheDuration time.Duration `mapstructure:"cache_duration"`
}
esClient, err := cfg.Elasticsearch.ToClient(ctx, host, set.TelemetrySettings)

@rogercoll rogercoll marked this pull request as ready for review January 28, 2025 08:11
@rogercoll rogercoll requested review from a team as code owners January 28, 2025 08:11
@rogercoll rogercoll requested a review from carsonip January 28, 2025 17:54
Copy link
Member

@carsonip carsonip left a comment

Choose a reason for hiding this comment

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

code lgtm. Are you planning to make es exporter use this config and client?

@rogercoll
Copy link
Contributor Author

code lgtm. Are you planning to make es exporter use this config and client?

The initial plan is to use it for a couple of extensions in Elastic's components repository, but yes, I will create an issue upstream to follow up on the exporter too.

@rogercoll rogercoll merged commit 17aa3e3 into elastic:main Feb 3, 2025
3 checks passed
@rogercoll rogercoll deleted the add_elasticsearch_config branch February 3, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants