Awesome thanks for the help! Still learning the basics.
On Tuesday, June 30, 2020 at 11:06:11 AM UTC-6, Julius Volz wrote:
>
> By default, binary operators match series from the left and right side on
> exactly identical label sets. But you keep the log_type label on the left,
> while aggregating it away on the right. You can either aggregate it away on
> both sides:
>
> sum(type_counter{log_type="ERROR"}) / sum(type_counter)
>
> ...or ignore that label for matching:
>
> type_counter{log_type="ERROR"} / ignoring(log_type) sum(type_counter)
>
> Btw., I assume type_counter is a counter metric. You should typically
> never care about the absolute value of a counter metric and instead always
> rate(...) it (or increase(), etc.) before using.
>
> On Tue, Jun 30, 2020 at 6:11 PM Cole Beasley <[email protected]
> <javascript:>> wrote:
>
>> Hi there,
>>
>> This might be a very basic question but I'm trying to get the ration of
>> error log messages / total error messages. Using grok_exporter I have the
>> metric type_counter which returns
>> ElementValue
>> type_counter{instance="localhost:9144",job="grok",log_type="AUTH"} 45
>> type_counter{instance="localhost:9144",job="grok",log_type="ERROR"} 55
>> type_counter{instance="localhost:9144",job="grok",log_type="IN"} 17603
>> type_counter{instance="localhost:9144",job="grok",log_type="NESTED"} 971
>> I simply then want (type_counter{log_type="ERROR"}) /
>> (sum(type_counter)), but this does not return a value, this is odd to me as
>> both type_counter{log_type="ERROR"} and sum(type_counter) return their
>> expected values and will divide by themselves or manually entered integers
>> (such as (18,000 / sum(type_counter)). I'm not sure why the division here
>> is not working, any ideas?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Prometheus Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/prometheus-users/c1b630e6-60de-42dd-aeab-51e57baf9dcdo%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/prometheus-users/c1b630e6-60de-42dd-aeab-51e57baf9dcdo%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Julius Volz
> PromLabs - promlabs.com
>
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/0db45f79-5bcf-46ff-847a-3ac982666dfeo%40googlegroups.com.