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 db and rpc metrics to use seconds #618

Closed
wants to merge 2 commits into from

Conversation

MadVikingGod
Copy link
Contributor

Fixes use of ms when the recommendation is s.

Changes

Updated db.client.connections.create_time, db.client.connections.wait_time, db.client.connections.use_time rpc.server.duration, and rpc.client.duration to use the unit s instead of ms

Merge requirement checklist

@MadVikingGod MadVikingGod requested review from a team December 19, 2023 17:06
@@ -9,6 +9,12 @@ release.

### Breaking

- Update `db.client.connections.create_time` unit to `s` ([#???](https://github.com/open-telemetry/semantic-conventions/pull/???))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can already update ??? with 618

@@ -142,7 +142,7 @@ This metric is [recommended][MetricRecommended].
<!-- semconv metric.db.client.connections.create_time(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `db.client.connections.create_time` | Histogram | `ms` | The time it took to create a new connection |
| `db.client.connections.create_time` | Histogram | `s` | The time it took to create a new connection |
Copy link
Contributor

@trisch-me trisch-me Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware that the current recommendation is in seconds, but given the minimal time required to establish a connection, possibly in a tiny fraction of a second, should we change it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Double floating points have enough precision to capture nano-second precision durations until the durations get quite large. I believe you need to be recording something on the order of a few years in nanoseconds before precision is lost.

Backends can easily translate from seconds to ms, us, or ns without loosing precision so I think its best to conform to the recommendation.

@pyohannes
Copy link
Contributor

There was some discussion about doing this change a while ago. As those metrics are currently in use and the proposed changes would be breaking, the consensus was to do those changes as part of stabilization efforts for DB and RPC semantic conventions and to cover the changes by a compatibility mechanism.

The following issues were created for tracking this:

I'd suggest closing this PR for now. Those changes should definitely be done, but as part of overall stabilization efforts.

@@ -174,7 +174,7 @@ This metric is [recommended][MetricRecommended].
<!-- semconv metric.db.client.connections.use_time(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `db.client.connections.use_time` | Histogram | `ms` | The time between borrowing a connection and returning it to the pool |
| `db.client.connections.use_time` | Histogram | `s` | The time between borrowing a connection and returning it to the pool |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this also use a different histogram buckets?

@trask
Copy link
Member

trask commented Jan 3, 2024

hi @MadVikingGod! check out #176 (review), and somewhat related open-telemetry/community#1848

Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 25, 2024
Copy link

github-actions bot commented Feb 2, 2024

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants