{"id":19991281,"url":"https://github.com/romansp/MiniProfiler.Elasticsearch","last_synced_at":"2025-05-04T10:31:20.778Z","repository":{"id":29643032,"uuid":"33184475","full_name":"romansp/MiniProfiler.Elasticsearch","owner":"romansp","description":"Elasticsearch.Net/NEST client for logging to MiniProfiler","archived":false,"fork":false,"pushed_at":"2022-11-30T19:29:38.000Z","size":1246,"stargazers_count":20,"open_issues_count":0,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-13T04:53:25.362Z","etag":null,"topics":["c-sharp","elasticsearch","miniprofiler","nest"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romansp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T12:37:03.000Z","updated_at":"2023-05-18T08:12:14.000Z","dependencies_parsed_at":"2023-01-14T15:22:18.646Z","dependency_job_id":null,"html_url":"https://github.com/romansp/MiniProfiler.Elasticsearch","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansp%2FMiniProfiler.Elasticsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansp%2FMiniProfiler.Elasticsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansp%2FMiniProfiler.Elasticsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansp%2FMiniProfiler.Elasticsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romansp","download_url":"https://codeload.github.com/romansp/MiniProfiler.Elasticsearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252320213,"owners_count":21729091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","elasticsearch","miniprofiler","nest"],"created_at":"2024-11-13T04:51:41.738Z","updated_at":"2025-05-04T10:31:18.831Z","avatar_url":"https://github.com/romansp.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# MiniProfiler.Elasticsearch\nPut your [Elasticsearch.Net and NEST](https://github.com/elastic/elasticsearch-net) requests timings directly into [MiniProfiler](https://github.com/MiniProfiler/dotnet).\n\n[![Build status](https://ci.appveyor.com/api/projects/status/m15gemuqkcs1rbv4/branch/main?svg=true)](https://ci.appveyor.com/project/romansp/miniprofiler-elasticsearch/branch/main) [![Nuget feed](https://img.shields.io/nuget/vpre/MiniProfiler.Elasticsearch.svg)](https://www.nuget.org/packages/MiniProfiler.Elasticsearch)\n\n![profiler-popup](https://user-images.githubusercontent.com/3474842/30780873-de83efd8-a11d-11e7-8735-49dea4a1d4f1.png)\n![profiler-queries](https://user-images.githubusercontent.com/3474842/30780952-edf8adea-a11e-11e7-8d64-c65331f389bf.png)\n\n## Usage\nYou have two options on how to start profiling your Elastic requests.\n\n### Option 1. Register in services collection\nIn your `Startup.cs`, call `AddElastic()`:\n\n```c#\npublic void ConfigureServices(IServiceCollection services)\n{\n    services.AddMiniProfiler(options =\u003e {\n        options.ExcludeElasticAssemblies();\n    })\n    .AddElastic();\n}\n```\n\n### Option 2. Create profiled client manually\nUpdate usages of `ElasticClient` or `ElasticLowLevelClient` with their respected profiled version `ProfiledElasticClient` or `ProfiledElasticLowLevelClient`.\n\n```c#\nservices.AddSingleton\u003cIElasticClient\u003e(x =\u003e \n{\n    var node = new Uri(\"http://localhost:9200\");\n    var connectionSettings = new ConnectionSettings(node).DefaultIndex(\"elasticsearch-sample\");\n    return new ProfiledElasticClient(connectionSettings);\n});\n```\n\n## Sample\nSee [Sample.Elasticsearch.Core](https://github.com/romansp/MiniProfiler.Elasticsearch/tree/main/samples/Sample.Elasticsearch.Core) for working example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromansp%2FMiniProfiler.Elasticsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromansp%2FMiniProfiler.Elasticsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromansp%2FMiniProfiler.Elasticsearch/lists"}