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

Align naming convention for db.operation.batch.size and messaging.batch.message_count? #1984

Open
trask opened this issue Mar 11, 2025 · 3 comments

Comments

@trask
Copy link
Member

trask commented Mar 11, 2025

Not (necessarily) suggesting we need a top-level batch.* namespace but wondering if it makes sense to align the naming pattern at least.

Maybe the most straightforward solution would be to rename messaging.batch.message_count to messaging.operation.batch.size.

@sreenath-tm
Copy link

Hi @trask , I would like to contribute to the issue. This is my first time contributing to Otel so what would be a good starting point to approach this issue?

@lmolkova
Copy link
Contributor

lmolkova commented Mar 21, 2025

Alternatives:

  • db.batch.query.count

Also align with db.response.returned_rows:

  • can we populate it without iterating to the end?
  • is it a total number or a number of rows user iterated over?
  • what does it do in a batch?
    • is it per-query in a batch - probably not an option
    • not populated for batch?
    • sum for all - consistent with joining query texts with ; - and this gives users someting
    • if wanted to do something per batch we could also do db.response.batch.returned_rows[] ?
    try (Statement stmt = con.createStatement()) {
      ResultSet rs = stmt.executeQuery(query);
      while (rs.next()) {
        String coffeeName = rs.getString("COF_NAME");
        int supplierID = rs.getInt("SUP_ID");
        float price = rs.getFloat("PRICE");
        int sales = rs.getInt("SALES");
        int total = rs.getInt("TOTAL");
        System.out.println(coffeeName + ", " + supplierID + ", " + price +
                           ", " + sales + ", " + total);
      }
    } 

need to document what's the boundary of sql span and whether it includes next (probably not).

Might be a problem with db.operation.parameter.<key> if there is a parameter per query in a batch

@matt-hensley
Copy link

One thing to consider: there is not an easy way to determine if a query returns multiple result sets. Common databases can return multiple results from a single stored procedure. May need to clarify whether the batch size attribute is for returned data, or if some batch detection is needed.

need to document what's the boundary of sql span and whether it includes next (probably not).

Aside: span per result set is an interesting thought exercise. Is there high level guidance for where to draw boundaries?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Need triage
Status: V1 - Stable Semantics
Development

No branches or pull requests

4 participants