metrics_label_names = ['tenant', 'namespace', 'name', 'instance_id', 'cluster', 'fqfn']
stat_total_processed_successfully = Counter(PULSAR_FUNCTION_METRICS_PREFIX + TOTAL_SUCCESSFULLY_PROCESSED,
'Total number of messages processed successfully.', metrics_label_names)
stat_total_sys_exceptions = Counter(PULSAR_FUNCTION_METRICS_PREFIX+ TOTAL_SYSTEM_EXCEPTIONS, 'Total number of system exceptions.',
metrics_label_names)
stat_total_user_exceptions = Counter(PULSAR_FUNCTION_METRICS_PREFIX + TOTAL_USER_EXCEPTIONS, 'Total number of user exceptions.',
metrics_label_names)
type Opts struct {
Namespace string
Subsystem string
Name string
Help string
ConstLabels Labels
}
def __init__(self,
name,
documentation,
labelnames=(),
namespace='',
subsystem='',
unit='',
registry=REGISTRY,
labelvalues=None,
):
def labels(self, *labelvalues, **labelkwargs):
The labelnames field in Python allows me to pass an array, but for Go, ConstLabels is a Labels type, which is a string-> string map. So, I have no idea what the equivalent is. If the labelnames are the keys, then what would be the values?Can someone please help me understand the differences and what my migration path looks like?Thanks,Devin
--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/fe228dd4-8f00-438e-9043-133326ae5c08%40googlegroups.com.
def labels(self, *labelvalues, **labelkwargs):
Thanks!That answers my first question.What about this method?
def labels(self, *labelvalues, **labelkwargs):Python method from the Counter base type (https://github.com/prometheus/client_python/blob/87d08deaa94ac3a981755c99ab2a83d3e63891a6/prometheus_client/metrics.py#L123).It's not clear to me what it's used for.
counter._value.get()
observer._count.get()
observer._sum.get()
counter.set(time)
On Tue, 14 Jan 2020 at 16:55, Devin Bost <devi...@gmail.com> wrote:
Thanks!That answers my first question.What about this method?
def labels(self, *labelvalues, **labelkwargs):Python method from the Counter base type (https://github.com/prometheus/client_python/blob/87d08deaa94ac3a981755c99ab2a83d3e63891a6/prometheus_client/metrics.py#L123).It's not clear to me what it's used for.That's WithLabelValues in Go.Brian
To unsubscribe from this group and stop receiving emails from it, send an email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/fe228dd4-8f00-438e-9043-133326ae5c08%40googlegroups.com.
Thanks again!That brings me almost to completion.The last ones I have to migrate are:
counter._value.get()
observer._count.get()
observer._sum.get()
counter.set(time)
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f96b5710-f1a5-4178-910d-cb003f47fb84%40googlegroups.com.
counter.set(time)
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f96b5710-f1a5-4178-910d-cb003f47fb84%40googlegroups.com.
Take a look at our example Python implementation here: https://github.com/apache/pulsar/blob/master/pulsar-functions/instance/src/main/python/function_stats.py#L128Is there a better way for us to get this data back to our end-users?
Regarding:
counter.set(time)
that's here: https://github.com/apache/pulsar/blob/master/pulsar-functions/instance/src/main/python/function_stats.py#L177
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3480a316-748c-4351-8a15-1ac88971fd24%40googlegroups.com.
That looks to be trying to build a different style of instrumentation client on top of a Prometheus client. . . You shouldn't have to do any math, gets, or resets when doing Prometheus instrumentation.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3480a316-748c-4351-8a15-1ac88971fd24%40googlegroups.com.
That looks to be trying to build a different style of instrumentation client on top of a Prometheus client. . . You shouldn't have to do any math, gets, or resets when doing Prometheus instrumentation.
It is true that we're building a different style of instrumentation client on top of a Prometheus client. However, we are also using the library to keep track of these statistics, and it's redundant to have another library keep track of these stats again. We have multiple ways users can get stats, such as: from Prometheus, REST, etc. Ideally, we use one library to keep track of all these stats and massage the data if needed to support other stats use cases. We are doing the same thing in our Java client, such as here: https://github.com/apache/pulsar/blob/master/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/stats/FunctionStatsManager.java#L352
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8315f565-c137-4ad1-9886-5660f41f1bfe%40googlegroups.com.
Do you have an example?
On Tue, 14 Jan 2020 at 22:21, Devin Bost <devi...@gmail.com> wrote:
Do you have an example?The graphite bridges in the various client libraries are one example.Brian
--
Devin G. BostOn Tue, Jan 14, 2020, 2:51 PM Brian Brazil <brian...@robustperception.io> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8315f565-c137-4ad1-9886-5660f41f1bfe%40googlegroups.com.
Does that require Prometheus to be running and wired up? In our current approach, even if Prometheus isn't running, we can still get the statistics from our service.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9e4637b6-bd18-49de-b76d-34106773d898%40googlegroups.com.
mfs, err := reg.Gather()
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9e4637b6-bd18-49de-b76d-34106773d898%40googlegroups.com.
mfs, err := reg.Gather()
vec, err2 := expfmt.ExtractSamples(&expfmt.DecodeOptions{
Timestamp: now,
}, mfs...)
I have several concerns with the suggested approach.First of all, based on the example from the graphite bridge, it appears that I would need to filter the MetricFamily instances like this:
mfs, err := reg.Gather()
vec, err2 := expfmt.ExtractSamples(&expfmt.DecodeOptions{
Timestamp: now,
}, mfs...)How am I supposed to know what Timestamp value to filter them on?
Even if I did, how do I get my required information out of the resulting *model.Vector instances?It appears that *model.Vector is really a model.Sample type, but model.Sample is comprised of Metric, SampleValue, and Time. Nowhere in there is it clear what parameter I can use to filter down to the information I'm looking for.Now, let's say that we figure out how to do that. Wouldn't it be prohibitively expensive to need to perform this kind of filter every single time we need to get the information from each of those getters?
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0b0a6e74-c1bc-4a74-bf65-3d50363ab1c9%40googlegroups.com.
Okay, it sounds like it won't be too expensive.So, how do I filter down to the values I'm looking for? This is still not clear to me, and the examples haven't been sufficient.Devin G. Bost
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0b0a6e74-c1bc-4a74-bf65-3d50363ab1c9%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0b0a6e74-c1bc-4a74-bf65-3d50363ab1c9%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/NpkERPC17H4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e7589cfc-ddf4-45f0-b237-719312c911e3%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/0b0a6e74-c1bc-4a74-bf65-3d50363ab1c9%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Prometheus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/prometheus-users/NpkERPC17H4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to prometheus-users+unsubscribe@googlegroups.com.