Skip to content

BUG: metrics "opendal_operation_duration_seconds_count" gets HTTP request count for chunk reads #7339

@dentiny

Description

@dentiny

Feature Description

Hi team, I notice for simple 1-1 mapping read + write operations (i.e., read an object from bucket A and write it to bucket B), read and write request rate shows completely different results (read RPS is several times larger than write RPS), both are backed by metrics opendal_operation_duration_seconds_count.

If I don't read it wrong:

  • For read operations, the metrics is actually counting for HTTP requests for chunk reader
  • For write operations, things are different, all writes through the same writer created here
    let (_, w) = ctx.acc.write(ctx.path(), ctx.args().clone()).await?;
  • In one word, for read operations, the operation count metrics is measuring the HTTP request count, while for write operations, it's measuring the write operation/function call count.

It's not ideal from my perspective:

  • Read and write operation counts are completely different if I call Operation::read and Operation::write the same time, which causes user confusion
  • Read operation count overlaps with HTTP request count

Problem and Solution

I made my workaround to collect and emit these metrics at application level.
But would be good to calculate these two metrics in the same way for both operations.

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreenhancementNew feature or requestreleases-note/featThe PR implements a new feature or has a title that begins with "feat"

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions