Comments (7)
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.
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.
The cardinality capping is in the newer version, definitely not in 0.19.0!
from opentelemetry-rust.
The new SDK will impose cardinality limit, so SDK wont go OOM.
from opentelemetry-rust.
Ah, I overlooked the version
from opentelemetry-rust.
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.
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)
- [Bug]: trace state for Dropped sampler decision is not propagated
- [Bug]: counters are always reset HOT 1
- [Feature]: PartialEq support for AnyValue HOT 1
- [Feature]: Stress Test is not leveraging max threads HOT 1
- [Feature]: SimpleSpanProcessor to be consistent with SimpleLogRecordProcessor HOT 4
- Proposal: Naming for features HOT 1
- Should this repo maintain examples showing tracing-opentelemetry? HOT 3
- [Bug]: View validations to be moved elsewhere
- [Bug]: Aggregation issues when using Views to drop attributes
- Add tests for appender-log crate HOT 2
- [Bug]: TracerProvider::force_flush moved from API to SDK without any way to downcast GlobalTracerProvider HOT 9
- [Feature]: Port opentelemetry-http to hyper 1.x HOT 14
- [Bug]: Serious metric corruption HOT 1
- [Feature]: Support Metrics, BatchProcessor without async runtime
- [Bug]: `cargo test` compile errors due to log crate removals HOT 7
- [Feature]: Add predicate to MetricReader and MetricProducer
- [Feature]: opentelemetry-appender-tracing should use semantic conventions HOT 2
- [Bug]: Wrong StatusCode ordinal in stdout exporter
- [Feature]: update tonic dependency to 0.10.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentelemetry-rust.