Skip to content

pawel-madurski/MiniProfiler.OpenSearch

 
 

Repository files navigation

MiniProfiler.OpenSearch

*** This project has been forked from https://github.com/romansp/MiniProfiler.Elasticsearch and compiled against OpenSearch ***

Put your OpenSearch.Net and OpencSearch.Client requests timings directly into MiniProfiler.

Build status Nuget

image

Usage

You have two options on how to start profiling your OpenSearch requests.

Option 1. Register in services collection

In your Startup.cs, call AddOpenSearch():

public void ConfigureServices(IServiceCollection services)
{
    services.AddMiniProfiler(options => {
        options.ExcludeOpenSearchAssemblies();
    })
    .AddOpenSearch();
}

Option 2. Create profiled client manually

Update usages of OpenSearchClient or OpenSearchLowLevelClient with their respected profiled version ProfiledOpenSearchClient or ProfiledOpenSearchLowLevelClient.

services.AddSingleton<IOpenSearchClient>(x => 
{
    var node = new Uri("http://localhost:9200");
    var connectionSettings = new ConnectionSettings(node).DefaultIndex("opensearch-sample");
    return new ProfiledOpenSearchClient(connectionSettings);
});

Sample

See Sample.OpenSearch.Core for working example.

About

OpenSearch client for logging to MiniProfiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%