Making operations on labels

Hello, I’m using grafana with loki and promtail to get logs of an apache server. I’m getting my response time in microseconds under the label “microseconds” and I would like to make the average of all these values. The only thing I’ve achieved is to query all the microseconds in one column with transformations in a dashboard but I can’t achieve to do the average

to get to the average you have to add the values and weight them for example by divinding through the number of points if each are equidistant.

Do you have an exemple to do it with some logs that contain 2 labels : the name and the microseconds. Can you make the average of the microseconds per name ?

yes value1 + value2 / 2

Yes the problem is that I can’t get and use the value of a defined label

what you mean with a “defined label” ?

Let’s look at the picutre. I’m making this request : {job=“apache”} et I get some results. Each of theses results have a label “microseconds” and I want to get the average of these microseconds.

Well, this feels really janky, but I am only able to get any encryption working using stunnel . I set Grafana for non-SSL LDAP authentication and pointed it at, then set up stunnel to listen on 389 and connect to my AD server on 636 via TLS v1.2. Packet captures with Wireshark show the password is not sent in plaintext to the AD server and the connection is TLS v1.2.


# Ldap server host (specify multiple hosts space separated)
host = ""
# Default port is 389 or 636 if use_ssl = true
port = 389
# Set to true if ldap server supports TLS
use_ssl = false
# Set to true if connect ldap server with STARTTLS pattern (create connection in insecure, then upgrade to secure connection with TLS)
start_tls = false
# set to true if you want to skip ssl cert validation
ssl_skip_verify = false


sslVersion = TLSv1.2

accept  = 389
connect = MY_AD:636
client = yes