Set opentelemetry_ecto span kind to CLIENT (#38)

From the [semantic conventions][1]:

> Span kind: MUST always be CLIENT.

[1]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md

Co-authored-by: Bryan Naegele <bryannaegele@users.noreply.github.com>
This commit is contained in:
Indrek Juhkam 2021-11-22 20:49:58 +02:00 committed by GitHub
parent 3f43f8dd9f
commit 4aaf86181a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -97,7 +97,8 @@ defmodule OpentelemetryEcto do
s = s =
OpenTelemetry.Tracer.start_span(span_name, %{ OpenTelemetry.Tracer.start_span(span_name, %{
start_time: start_time, start_time: start_time,
attributes: attributes ++ base_attributes attributes: attributes ++ base_attributes,
kind: :client
}) })
OpenTelemetry.Span.end_span(s) OpenTelemetry.Span.end_span(s)

View File

@ -39,7 +39,8 @@ defmodule OpentelemetryEctoTest do
assert_receive {:span, assert_receive {:span,
span( span(
name: "opentelemetry_ecto.test_repo.query:users", name: "opentelemetry_ecto.test_repo.query:users",
attributes: list attributes: list,
kind: :client
)} )}
assert [ assert [