Skip to content

[postgres, mysql, mysql2] Update database connection semantic conventions #781

@dyladan

Description

@dyladan

It appears it is just drastically outdated. The spec at the time of writing the postgres instrumentation was this: https://github.com/open-telemetry/opentelemetry-specification/blob/c8109895a989480028b282fa796ed87ad1421b8a/specification/data-database.md which specified the JDBC substring.

The recent spec is quite different and requires:

  • db.system - postgresql
  • One of net.peer.name OR net.peer.ip - hostname or ip respectively
  • net.peer.port only if using nonstandard port
  • net.transport recommended in general, required only if using in-process - tcp or inproc

db.connection_string is not required but seems to be the replacement for the jdbc string.

This most likely also affects the mysql and mysql2 instrumentations

Originally posted by @dyladan in #473 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions