semantic_logger icon indicating copy to clipboard operation
semantic_logger copied to clipboard

Support for non-Elastic *search engines e.g. AWS Opensearch

Open antgel opened this issue 3 years ago • 3 comments

Just happily installed rails_semantic_logger in our project, very happy to be using it, thank you! However, we're migrating to AWS OpenSearch rather than Elastic's offering, due to our take on Elastic's approach to Free Software licensing and the community.

I naively added the elasticsearch gem to Gemfile and of course:

E [2308:SemanticLogger::Appender::Elas] SemanticLogger::Appender::Elasticsearch -- Async: Restarting due to exception -- Exception: Elasticsearch::UnsupportedProductError: The client noticed that the server is not Elasticsearch and we do not support this unknown product.

I can pin to 7.13.0 for now as per https://opensearch.org/docs/latest/clients/index/, but it doesn't feel like a long term solution. Will semantic_logger be able to support the opensearch-ruby as an alternative?

antgel avatar Jan 01 '22 22:01 antgel

Will it require a new appender, or can it auto-detect which gem is loaded and use that one automatically? I.e. Is the new opensearch-ruby gem a drop-in replacement?

reidmorrison avatar Jan 17 '22 19:01 reidmorrison

If the API is the same, other than the gem and class name, I can create a proof of concept branch if you want to try it out?

reidmorrison avatar Jan 17 '22 19:01 reidmorrison

Thanks for the response. At this time the gem APIs are close if not identical - who knows what will happen over time.

As for "Will it require a new appender, or can it auto-detect which gem is loaded and use that one automatically?", I'm not sure what you mean by "it", but it's pretty clear that Elastic users will continue to use the elasticsearch-ruby gem, and AWS OpenSearch users will use the opensearch-ruby gem (or elasticsearch-ruby pinned to 7.13.0). It is possible at runtime to fingerprint the ES/OS server via an HTTP request, but of course this is too late in the day to decide which gem to install.

antgel avatar Feb 08 '22 12:02 antgel