how OpenTelemetry Collector holds the metrics
Answer : OpenTelemetry Collector only holds the latest metrics. If prometheus scrapes it, the latest value is exported to prometheus
My question is whether Prometheus will get the all metrics between the current time and the previous time of metrics or not?
The experimental condition is as follows.
OtelCollecotr
receivers: hostmetrics: collection_interval: 2s scrapers: cpu: load: memory: disk: Prometheus
global: scrape_interval: 15s evaluation_interval: 15s Then, the result is as follows.Thus, the latest value is hold in otel-collector, but the rest of the metrics between the scrapes will be discarded. This implicates that the interval for otel-collector to collect the metrics should be same as prometheus's scrape interval unless there are special processors are set.
hostmetrics
hostmetrics is indicating the container when the opentelemetry-collector is started up as container.
It is possible to catch the host metrics by the steps in the documentation.
(It seems impossible when windows. In windows, the hostmetrics will by default indicate the metrics of the total of docker usage)
Left Window : WSL with top command
Right Window : hostmetrics’s memory usage from otel-collector
Bottom Window: docker stats
The memory usage of hostmetrics is matched with the WSL’s memory usage