opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

[telemetry] - It would be great to have addtitional metrics

Open VihasMakwana opened this issue 1 year ago • 8 comments

Component(s)

No response

Is your feature request related to a problem? Please describe.

We currently have some metrics exposed via ObsReport, such as: refusedLogRecords, droppedLogRecords etc.

However, these don't consider the body's size(in bytes). Such metrics can provide another perspective regarding collector's capabilities for various users.

Describe the solution you'd like

Expose some additional metrics. We can enable this via the feature gate

Describe alternatives you've considered

None yet.

Additional context

No response

VihasMakwana avatar Jan 19 '24 17:01 VihasMakwana

@open-telemetry/collector-contrib-approvers can you share your thoughts? I can roll out a draft PR soon.

VihasMakwana avatar Jan 29 '24 15:01 VihasMakwana

the body's size(in bytes)

How will the size be defined when it is not a string?

What other metrics are you proposing?

djaglowski avatar Jan 29 '24 15:01 djaglowski

This feels like it belongs in Core, gonna transfer it there

TylerHelmuth avatar Jan 29 '24 16:01 TylerHelmuth

As per

the body's size(in bytes)

How will the size be defined when it is not a string?

What other metrics are you proposing?

I see, as per https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-body it can any. For calculating the size of such cases, there are multiple ways:

  1. use reflection
  2. "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1" defines the accepted values and they implement a common interface. It has a Size() which I believe returns the bytes it took.

We can also explore a similar option for metrcis/trace.

VihasMakwana avatar Feb 03 '24 11:02 VihasMakwana

pdata also has a built in way to determine size. In theory this could be used but we'd need to document clearly what this means because it is often not the same size that the user cares about.

It's previously been discussed whether this is appropriate to enable by default at each component boundary but it was suggested it would add too much overhead. My opinion is that if disabled by default it would be very useful without adding overhead.

djaglowski avatar Feb 05 '24 14:02 djaglowski

This also appears to be related to this discussion.

djaglowski avatar Feb 05 '24 14:02 djaglowski

Similar to the issue here: https://github.com/open-telemetry/opentelemetry-collector/issues/6638. In https://github.com/open-telemetry/otel-arrow/tree/main/collector/netstats, the OTel-Arrow components implements metrics that could be reused by any gRPC receiver or exporter. I would like to see this standardized and moved into the core.

By the way, https://github.com/open-telemetry/oteps/pull/249 replaced OTEP 238, and I see network-bytes metrics as complimentary to item-outcome metrics discussed in those two drafts.

jmacd avatar Apr 11 '24 19:04 jmacd

@jmacd thanks for pointing that out. Indeed we can reuse the ones defined here.

VihasMakwana avatar Apr 12 '24 07:04 VihasMakwana