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

Document common metric names and when they should be used #211

Open
trask opened this issue Jul 25, 2023 · 6 comments
Open

Document common metric names and when they should be used #211

trask opened this issue Jul 25, 2023 · 6 comments
Assignees

Comments

@trask
Copy link
Member

trask commented Jul 25, 2023

E.g.

  • .count
  • .total
  • .duration
  • .time
  • .usage
  • .size
  • .utilization
  • .limit
  • .io
@trask
Copy link
Member Author

trask commented Jul 25, 2023

.duration vs .time

looking at current usage:

.time:

  • system.cpu.time
  • process.cpu.time
  • jvm.cpu.time

.duration:

  • http.server.duration
  • http.client.duration
  • rpc.server.duration
  • rpc.client.duration
  • jvm.gc.duration

it's not clear to me that having both .time and .duration is justified, as I think using .time for them all is equally good:

  • http.server.request.time
  • http.client.request.time
  • rpc.server.request.time
  • rpc.client.request.time
  • jvm.gc.time

EDIT: a couple possible pros about keeping .duration

  • the .duration name matches the span attribute duration, and in the http/rpc cases these metrics match the corresponding span duration
  • .duration could be reserved for histograms, which capture individual durations instead of total time
  • .duration is measuring discrete events

@trask
Copy link
Member Author

trask commented Jul 25, 2023

.count vs .usage vs .size

looking at current usage:

.count

.usage

  • db.client.connections.usage / db.client.connections.max
  • hw.gpu.memory.usage / hw.gpu.memory.utilization / hw.gpu.memory.usage
  • hw.logical_disk.usage / hw.logical_disk.utilization / hw.logical_disk.limit
  • process.memory.usage
  • jvm.memory.usage / jvm.memory.limit
  • jvm.buffer.usage / jvm.buffer.limit
  • system.memory.usage / system.memory.utilization
  • system.paging.usage / system.paging.utilization
  • system.filesystem.usage / system.filesystem.utilization

.usage appears to be primarily used for metrics with unit Byte

interestingly, jvm.buffers.* has both .count (number of buffers) and .usage (bytes used by those buffers), which makes it confusing which one jvm.buffers.limit applies to (at least without looking at the unit for jvm.buffers.limit)

.size

  • http.server.request.size
  • http.server.response.size
  • http.client.request.size
  • http.client.response.size
  • rpc.server.request.size
  • rpc.server.response.size
  • rpc.client.request.size
  • rpc.client.response.size
  • hw.physical_disk.size

@trask
Copy link
Member Author

trask commented Jul 26, 2023

Some notes on usage vs limit vs utilization:

.count vs .usage

  • usage has a real unit (Bytes)
  • count is for unitless, i.e. {request}, {connection}

nice to always use .usage whenever there's a .limit

db.client.connections.usage / db.client.connections.max

  • option a: db.client.connections.count / db.client.connections.limit
  • option b: db.client.connections.usage / db.client.connections.limit

connections don't necessarily have to use connection pool, in which case you could still report db.client.connections.usage and just not report a limit

@mateuszrzeszutek
Copy link
Member

it's not clear to me that having both .time and .duration is justified, as I think using .time for them all is equally good:

Not sure if it matters that much, but all of your .time examples are counters, and all .durations are histograms.

@trask
Copy link
Member Author

trask commented Jul 31, 2023

notes from semconv meeting:

db.client.connections.usage isn't "current number of active connections", it has dimensions "active"/"idle", so .limit is sum of .usage

@joaopgrassi
Copy link
Member

This was closed by mistake by the stale bot. Re-opening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants