Skip to content

Elasticsearch instrumentation doesn't follow database spec #708

@remram44

Description

@remram44

Describe your environment
Using opentelemetry-instrumentation-elasticsearch 0.24b0 with elasticsearch 7.14.1

What is the expected behavior?
The instrumentation should follow the semantic conventions for database clients, notably use span names in the format <db.operation> <db.name>.<db.sql.table>.

What is the actual behavior?
Span names are built from the request URL without any form of parsing. In particular, the operation (index/delete/...) is missing, and the database name is not necessarily present.

Example span names:

  • Elasticsearch/indexname/_doc/documentid (insert operation if PUT, read operation if GET)
  • Elasticsearch/indexname/_doc (probably an insert without a set primary key)
  • Elasticsearch/indexname (either reading metadata or changing schema/settings), Elasticsearch/indexname/_search (query operation)

Many attributes are also missing or are only present in the request path, because they get encoded in the URL before perform_request() is called, which is the only instrumented method.

An unbounded number of span names can also be created, which is a more urgent issue tracked by #704.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions