Skip to content
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

Add instrumentation API usage and native OpenTelemetry implementation #771

Merged
merged 16 commits into from
Dec 21, 2023

Conversation

Anaethelion
Copy link
Contributor

This adds the integration of the instrumentation found in the transport. elastic/elastic-transport-go#18

A default OpenTelemetry implementation can be set in the configuration with the elasticsearch.NewOpenTelemetryInstrumentation. If no provider is given, the instrumentation will fallback to the one set within the otel package.

Optionally, search request bodies can be recorded, such endpoints are:

  • search
  • async_search.submit
  • msearch
  • eql.search
  • terms_enum
  • search_template
  • msearch_template
  • render_search_template

More about what is recorded in the Semantic Conventions for Elasticsearch.

@Anaethelion Anaethelion merged commit 67adbfc into main Dec 21, 2023
11 of 12 checks passed
@Anaethelion Anaethelion deleted the otel_integration branch December 21, 2023 14:29
github-actions bot pushed a commit that referenced this pull request Dec 21, 2023
…#771)

* Initial otel instrumentation implementation

* add otel integration into esapi

* add tests for instrumentation integration within both APIs

* query persistence logic is embedded in otel instrumentation

* regroup cluster id and node name test in AfterResponse

* bump go.mod to 1.20, add opentelemetry dependency

* rename RecordQuery to RecordRequestBody

* add esapi integration for otel traces

* add typedapi integration for otel traces

* pin transport to commit 903383c until release

* update internal dependencies

* replace nilcheck in typedapi with type assertion

* add changelog for 8.12.0 with otel

* fix naming to please linting

* update examples dependencies

* go mod tidy for xkcdsearch
Anaethelion added a commit that referenced this pull request Dec 21, 2023
…#771) (#772)

* Initial otel instrumentation implementation

* add otel integration into esapi

* add tests for instrumentation integration within both APIs

* query persistence logic is embedded in otel instrumentation

* regroup cluster id and node name test in AfterResponse

* bump go.mod to 1.20, add opentelemetry dependency

* rename RecordQuery to RecordRequestBody

* add esapi integration for otel traces

* add typedapi integration for otel traces

* pin transport to commit 903383c until release

* update internal dependencies

* replace nilcheck in typedapi with type assertion

* add changelog for 8.12.0 with otel

* fix naming to please linting

* update examples dependencies

* go mod tidy for xkcdsearch

Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant