You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2022. It is now read-only.
Fix starttime and summary has no quantiles for prometheus receiver (#597)
* To address start time for counter/histogram/summary, and take deltas as values for these types. It also fixes the issue when summary has no quantiles, allow it to produce a summary with nil snapshots
* rephase README as per comment
* fix concurrent issue on adjuster and add more integration tests
* test again
* Restructure end to end test with comments and more
* remove empty tests
Copy file name to clipboardExpand all lines: receiver/prometheusreceiver/README.md
+96-35Lines changed: 96 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,7 @@ object of OpenCensus. The target object is not accessible from the Appender inte
176
176
ocagent appender, we need to have a way to inject the binding target into the appender instance.
177
177
178
178
179
-
3. Group metrics from the same family together
179
+
2. Group metrics from the same family together
180
180
181
181
In OpenCensus, metric points of the same name are usually grouped together as one timeseries but different data points.
182
182
It's important for the appender to keep track of the metric family changes, and group metrics of the same family together.
@@ -186,17 +186,24 @@ and `summary`, not all the data points have the same name, there are some specia
186
186
we need to handle this properly, and do not consider this is a metric family change.
187
187
188
188
189
-
4. Group complex metrics such as histogram together in proper order
189
+
3. Group complex metrics such as histogram together in proper order
190
190
191
191
In Prometheus, a single aggregated type of metric data such as `histogram` and `summary` is represent by multiple metric data points, such as
192
192
buckets and quantiles as well as the additional `_sum` and `_count` data. ScrapeLoop will feed them into the appender individually. The ocagent
193
193
appender need to have a way to bundle them together to transform them into a single Metric Datapoint Proto object.
194
194
195
-
5. Tags need to handle carefully
195
+
4. Tags need to handle carefully
196
196
197
197
ScrapeLoop strips out any tag with empty value, however, in OpenCensus, the tag keys is stored separately, we need to able to get all the possible tag keys
198
198
of the same metric family before committing the metric family to the sink.
199
199
200
+
5. StartTimestamp and values of metrics of cumulative types
201
+
202
+
In OpenCensus, every metrics of cumulative type is required to have a StartTimestamp, which records when a metric is first recorded, however, Prometheus
203
+
dose not provide such data. One of the solutions to tackle this problem is to cache the first observed value of these metrics as well as
204
+
the timestamp, then for any subsequent data of the same metric, use the cached timestamp as StartTimestamp and the delta with the first value as value.
205
+
However, metrics can come and go, or the remote server can restart at any given time, the receiver also needs to take care of issues such as a new value is
206
+
smaller than the previous seen value, by considering it as a metrics with new StartTime.
200
207
201
208
## Prometheus Metric to OpenCensus Metric Proto Mapping
202
209
@@ -232,16 +239,27 @@ Counter as described in the [Prometheus Metric Types Document](https://prometheu
232
239
> is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be
233
240
> reset to zero on restart
234
241
235
-
It is one of the most simple metric types we can be found in both systems. Examples of Prometheus Counters is as shown
236
-
below:
242
+
It is one of the most simple metric types we can find in both systems. However, it is a cumulative type of metric,
243
+
considering with have two continuous scrapes from a target, with the first one as shown below:
237
244
```
238
245
# HELP http_requests_total The total number of HTTP requests.
0 commit comments