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

Update OpenTelemetryEcto attributes to conform with semantic conventions 1.27 #430

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

danschultzer
Copy link

@danschultzer danschultzer commented Dec 14, 2024

Stacked on #429 which needs to get in first. Check the latest commit for the changes here.

This conforms the attributes and span names to the 1.27 docs: https://github.com/open-telemetry/semantic-conventions/blob/v1.27.0/docs/database/database-spans.md

It does introduce a bunch of breaking changes so let me know if backwards compability is required. I can keep the old attributes, but not sure if we should just go with major release instead since there's a lot of things that are different now?

I can also update the changelog in this PR.

Changes

  • db.name/db.instance -> db.namespace
  • source -> db.collection.name
  • db.statement -> db.query.text
  • db.url -> server.address/ server.port
  • total_time_ -> db.client.operation.duration (in seconds as float)
  • idle_time_ -> db.client.connection.create_time (in seconds as float)
  • queue_time_ -> db.client.connection.wait_time (in seconds as float)
  • query_time_ -> db.client.connection.use_time (in seconds as float)
  • The : db_statement config option to :db_query (not necessary but it conforms closer to the otel attribute name)
  • Span name changed from ecto.repo.query to {db.operation.name} {target} or just {target} if it is a general db operation conforming to 1.27 guidelines

Removes

  • db.type
  • decode_time_ (I couldn't find a metric that matched it)
  • The :span_prefix config option
  • The :time_unit config option

Adds

  • db.operation.name

Resolves #364

@danschultzer danschultzer changed the title Update Phoenix attributes Update OpenTelemtryEcto attributes to conform with semantic conventions Dec 14, 2024
@danschultzer danschultzer changed the title Update OpenTelemtryEcto attributes to conform with semantic conventions Update OpenTelemetryEcto attributes to conform with semantic conventions Dec 14, 2024
@danschultzer danschultzer force-pushed the update-ecto-attributes branch 2 times, most recently from 519f936 to bc95444 Compare December 14, 2024 14:57
@danschultzer danschultzer changed the title Update OpenTelemetryEcto attributes to conform with semantic conventions Update OpenTelemetryEcto attributes to conform with semantic conventions 1.27 Dec 14, 2024
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.

Ecto -SemConv 1.26
1 participant