elastic / elastic/go-docappender

[o11y] Publish `go-elasticsearch` transport metrics through OTel measures

Open
#156 0 comments 0 reactions 0 assignees View on GitHub
enhancement o11y
Dominant language
Go
Stars
11
Forks
20
PR merge metrics
No merged PRs in 30d

Description

**Describe the current state**

The docappender Elasticsearch client used to perform HTTP requests has built-in support for some metrics (see https://github.com/elastic/elastic-transport-go/blob/6475398eb2a0e8fbef658ff3960f1f0c20741fb6/elastictransport/metrics.go#L43-L460)

We don't publish any of those at the moment through the docappender monitoring and have limited visibility on the performance and behavior of the client.

**Describe the desired state**

We would capture, transform to OTel format and publish the `go-elasticsearch` Transport metrics populated by the client lib.
With them we could be able to plot HTTP-request-level success rate (`Failures` / `Requests` ratio) as well as per-HTTP-status code rates (`Responses by [key]` / `Requests`).

**Additional context**

When designing how to expose the metrics, we should consider the possibility of adding arbitrary metadata to the data points exported. This is typically done with an `attribute.Set` in OTel, likely the existing `MetricAttributes` config field can be already serve this purpose.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linked elastic-transport-go metrics.go implementation and then locate the docappender monitoring code and existing MetricAttributes configuration. Determine how transport metrics can be transformed into OTel measures and published, including request failures and response status rates. Done means these metrics are exported with supported arbitrary attributes and can be used for the described rates.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, go
Domain
observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.