I am using:
var registry = prometheus.NewRegistry()
I know I can do for some goroutine (etc.) related metrics:
registry.MustRegistry(collectors.NewGoCollector());
But, I cannot see http metrics which I see when using default registry, like:
promhttp_metric_handler_requests_total{code="200"} 1
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0
How to bring these metrics?
Also, I cannot see http_requests_total irrespective of the registry I use. Is there a way to automatically expose it (instead of defining it)?
You also need to register your custom defined metric like http_requests_total (in this case).
This should solve your problem :
`registry.MustRegistry(promHttpRequestTotal)
Here promHttpRequestTotal is the variable in which your metric http_requests_total is defined.
Related
Where can the $PEERID be found, which is used in Chainlink Offchain Reporting Jobs .toml file
--> P2P BootstrapPeers =[...] ?
This is the link to Offchain Reporting Jobs in Chainlink:
https://docs.chain.link/docs/jobs/types/offchain-reporting/
Question concerning the OCR toml job specification:
The syntax of p2pBootstrapPeer is the following:
/dns4/$DNS/tcp/$PORT/p2p/$PEERID
---> where in my specifications can I find the $PEERID ?
In the Chainlink Nodeoperator GUI? If yes, where exactly?
If not, where else? (edited)
Couple ways to set this:
You can manually set it via an env_car called P2P_PEER_ID. If you don't override it, it will try use this value by default
As per the docs you linked, set the p2pPeerID value in your job spec, which will become the $PEERID. eg
p2pPeerID = "12D3KooWPjceQrSwdWXPyLLeABRXmuqt69Rg3sBYbU1Nft9HyQ6X"
I'm trying to modify prometheus mesos exporter to expose framework states:
https://github.com/mesos/mesos_exporter/pull/97/files
A bit about mesos exporter - it collects data from both mesos /metrics/snapshot endpoint, and /state endpoint.
The issue with the latter, both with the changes in my PR and with existing metrics reported on slaves, is that metrics created lasts for ever (until exporter is restarted).
So if for example a framework was completed, the metrics reported for this framework will be stale (e.g. it will still show the framework is using CPU).
So I'm trying to figure out how I can clear those stale metrics. If I could just clear the entire mesosStateCollector each time before collect is done it would be awesome.
There is a delete method for the different p8s vectors (e.g. GaugeVec), but in order to delete a metric, I need to not only the label name, but also the label value for the relevant metric.
Ok, so seems it was easier than I thought (if only I was familiar with go-lang before approaching this task).
Just need to cast the collector to GaugeVec and reset it:
prometheus.NewGaugeVec(prometheus.GaugeOpts{
Help: "Total slave CPUs (fractional)",
Namespace: "mesos",
Subsystem: "slave",
Name: "cpus",
}, labels): func(st *state, c prometheus.Collector) {
c.(*prometheus.GaugeVec).Reset() ## <-- added this for each GaugeVec
for _, s := range st.Slaves {
c.(*prometheus.GaugeVec).WithLabelValues(s.PID).Set(s.Total.CPUs)
}
},
We need to enable milliseconds in only one specific facility of ryslog. I think $ActionFileDefaultTemplate RSYSLOG_FileFormat would enable milliseconds for all syslogs not to a specific local facility.
How to add this template just to a local facility of the below kind:
local5.* /opt/logs/my_app.log
You could create a named template, that outputs the milliseconds, and
them bind it to the action like:
local5.* /opt/logs/my_app.log;template-name
See this for further info: https://www.thegeekdiary.com/understanding-rsyslog-templates/
Using rest I got this exception
http://localhost:8080/customgroups?_queryFilter=(members/uid+co+%22test%22)
{"code":413,"reason":"Request Entity Too Large","message":"Administrative Limit Exceeded"}
I turned all limits off:
ds-cfg-lookthrough-limit: 0
ds-cfg-size-limit: 0
Is there another constrain? The result should be 1-3 entries. Other requests like get all customGroups = 83 or users = 1300 works fine, so why does the query_filter making problems?
Thank You
There are a few things you might try out:
can you check the ds-rlim-lookthrough-limit operational attribute is correctly set? Especially for cn=Directory Manager if you are using it to make requests.
I can see there is a special config for collective attributes ds-rlim-lookthrough-limit;collective: 0. Maybe does it apply to your request?
References:
http://ludopoitou.com/2012/04/10/tips-resource-limits-in-opendj/
http://opendj.forgerock.org/opendj-server/configref/global.html#lookthrough-limit
http://docs.forgerock.org/en/opendj/2.6.0/admin-guide/index/chap-resource-limits.html
In a web page, i start an FTSearch using an agent called via ajax.
Is there a way to programmatically stop this agent (for example, using a button)?
Not really. You could programmatically restart the http task...
There's a server setting which defines a timeout for webagents, which should be set.
You could add a check to your code, testing an environment variable for its value... For example, use this (in pseudo-code):
count= count + 1
if count modulo 100 = 0 then // only once per 100 docs
if getEnvironmentVar("STOP_MY_AGENT")=1 then
exit
fi
fi
And then you need some button to set the environment variable. Make sure that in both cases you use the same environment, i.e. the same notes.ini file!