Giter VIP home page Giter VIP logo

Comments (7)

cijothomas avatar cijothomas commented on June 12, 2024 1

OTel SDK offers a View concept which can be leveraged to drop unwanted metric attributes.
https://github.com/open-telemetry/opentelemetry-rust/blob/main/examples/metrics-advanced/src/main.rs#L24-L31

Another alternative is, if you control the code, you can simply chose to add only the required metric attributes. If you cannot control the code, then View is the right solution from the SDK. (OTel Collector has similar mechanisms as well, if you are running OTel Collector in your environment)

from opentelemetry-rust.

lalitb avatar lalitb commented on June 12, 2024 1

Curious, as we have the upper cardinality limit of 2000, the memory shouldn't be increasing continuously leading to OOM. What is the machine configuration? Eventually, we should be able to control the upper limit through Views (#1065). But as mentioned by @cijothomas, the right approach would be to filter the attributes through Views.

from opentelemetry-rust.

cijothomas avatar cijothomas commented on June 12, 2024 1

The cardinality capping is in the newer version, definitely not in 0.19.0!

from opentelemetry-rust.

cijothomas avatar cijothomas commented on June 12, 2024 1

The new SDK will impose cardinality limit, so SDK wont go OOM.

from opentelemetry-rust.

lalitb avatar lalitb commented on June 12, 2024

Ah, I overlooked the version

from opentelemetry-rust.

yunbo-xufeng avatar yunbo-xufeng commented on June 12, 2024

OTel SDK offers a View concept which can be leveraged to drop unwanted metric attributes. https://github.com/open-telemetry/opentelemetry-rust/blob/main/examples/metrics-advanced/src/main.rs#L24-L31

Another alternative is, if you control the code, you can simply chose to add only the required metric attributes. If you cannot control the code, then View is the right solution from the SDK. (OTel Collector has similar mechanisms as well, if you are running OTel Collector in your environment)

Thanks for your reply!
I just checked the View feature, and found it can only filter attribute keys, not including the values?
Actually, in my scenario, the metrics keys are not changed, only the values in the attributes changed when I call:

fn observe(&self, cx: &Context, value: T, attributes: &[KeyValue])

Any solution to resolve this "attributes key is constant but value is changing" problem?

from opentelemetry-rust.

yunbo-xufeng avatar yunbo-xufeng commented on June 12, 2024

Curious, as we have the upper cardinality limit of 2000, the memory shouldn't be increasing continuously leading to OOM. What is the machine configuration? Eventually, we should be able to control the upper limit through Views (#1065). But as mentioned by @cijothomas, the right approach would be to filter the attributes through Views.

Many thanks!
So the newer version OTel can resolve this memory problem implicitly by the cardinality limit?
My scenario is special: only the value changes, the key remains the same.

from opentelemetry-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.