Skip to content

Release 0.3.0 #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.3.0

### Client

* Updates elastic-transport version dependency to `~> 8.3`.
* Adds native support for OpenTelemetry. See [Using OpenTelemetry](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/opentelemetry.html).

### Changes in APIs:

* Adds connector APIs: `check_in`, `delete`, `get`, `list`, `post`, `put`, `sync_job_cancel`, `sync_job_delete`, `sync_job_get`, `sync_job_list`, `sync_job_post`, `update_active_filtering`, `update_api_key_id`, `update_configuration`, `update_error`, `update_filtering`, `update_filtering_validation`, `update_index_name`, `update_name`, `update_native`, `update_pipeline`, `update_scheduling`, `update_service_type`, `update_status`.
* Updates termvectors APIs, adds deprecation notice for `termvector`, please use the plural version `termvectors` instead.
* Updates source code documentation for all APIs. Check [rubydoc](https://rubydoc.info/gems/elasticsearch-serverless/) for the API reference, or run `yardoc` in the root of the project if you've checked out the code. The API reference documentation will be generated in the `doc` folder.

## 0.2.0

### Client
Expand Down
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ You can call the `update` API to update a document:

```ruby
response = client.update(
index: 'books',
id: 'document_id',
index: 'books',
id: 'document_id',
body: { doc: { page_count: 312 } }
)
```
Expand All @@ -148,6 +148,18 @@ Now that some data is available, you can search your documents using the **Searc
=> [{"_index"=>"books", "_id"=>"Pdink4cBmDx329iqhzM2", "_score"=>1.5904956, "_source"=>{"name"=>"Snow Crash", "author"=>"Neal Stephenson", "release_date"=>"1992-06-01", "page_count"=>470}}]
```

### Using OpenTelemetry

The Client comes with built-in OpenTelemetry instrumentation that emits distributed tracing spans by default. You can find out how to use it [in the official documentation](https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/opentelemetry.html). The only difference from the Elasticsearch Stack Client is how to pass in a tracer provider when instantiating the client. In Elasticsearch Serverless, you need to use the following code:

```ruby
client = ElasticsearchServerless::Client.new(
api_key: 'your_api_key',
url: 'https://my-deployment-url',
arguments: { opentelemetry_tracer_provider: tracer_provider }
)
```

## Development

See [CONTRIBUTING](./CONTRIBUTING.md).
3 changes: 2 additions & 1 deletion lib/elasticsearch-serverless.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Client
include ElasticsearchServerless::API

VALID_PARAMETERS = [:adapter, :log, :logger, :serializer_class, :trace, :tracer, :headers,
:request_timeout, :retry_on_status, :retry_on_failure, :delay_on_retry]
:request_timeout, :retry_on_status, :retry_on_failure, :delay_on_retry,
:opentelemetry_tracer_provider]

# Initializes an Elasticsearch Serverless Client
#
Expand Down
2 changes: 1 addition & 1 deletion lib/elasticsearch-serverless/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

module ElasticsearchServerless
API_VERSION = '2023-10-31'.freeze
CLIENT_VERSION = '0.2.0'.freeze
CLIENT_VERSION = '0.3.0'.freeze
VERSION = CLIENT_VERSION
end
7 changes: 7 additions & 0 deletions spec/unit/elasticsearch_serverless_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@
end.to raise_error(ArgumentError)
end

it 'accepst opentelemetry_tracer_provider in arguments' do
require 'opentelemetry'
arguments = { opentelemetry_tracer_provider: OpenTelemetry.tracer_provider }
client = ElasticsearchServerless::Client.new(api_key: 'test', url: 'test', arguments: arguments)
expect(client.transport.options[:opentelemetry_tracer_provider])
end

context 'adapters' do
let(:arguments) { { adapter: :net_http_persistent } }

Expand Down
Loading