Grafana - IQR for Alerts - data-visualization

How to use Inter Quartile Range (IQR) (for setting up alerts) in grafana dashboard??
Is this possible in grafana?
I couldnt find any setting on grafana for custom range setting..!

Related

Traefik - apply middleware to router except a specific path

I use a IP whitelist middleware to filter the access of my web application to some IPS only and it works.
But, I want to unprotect a specific path to make it public (the path is /api/transaction).
For now, I have (in my docker-comose.yml) :
varnish:
labels:
- "traefik.http.routers.api_varnish.rule=Host(`api.local`, `api`)"
- "traefik.http.routers.api_varnish.tls=true"
- "traefik.http.routers.api_varnish.middlewares=https-redirect#file"
- "traefik.http.routers.api_varnish.middlewares=https-whitelist#file"
- "traefik.http.services.api_varnish.loadbalancer.server.port=80"
This part works, then I added:
# Open middleware for payment IPN calls
- "traefik.http.routers.api_varnish_transaction.rule=(Host(`api.local`, `api`) && PathPrefix(`/api/transaction`))"
- "traefik.http.routers.api_varnish_transaction.tls=true"
- "traefik.http.routers.api_varnish_transaction.priority=2"
- "traefik.http.routers.api_varnish_transaction.middlewares=https-redirect#file"
I duplicated the lines, but I didn't apply the middleware https-whitelist#file to the new host.
It doesn't work, I can't find the correct syntax or be sure if I can do it ? documentation is pretty poor.
Any idea?
Have 2 routers, 1 for /api/transaction and another one for /* and give the first router a higher priority (set a higher number) e.g.
# ...
labels:
- traefik.http.routers.router_1.priority=2
Now requests to /api/transaction will only hit router_1
https://doc.traefik.io/traefik/routing/routers/#priority

Applying filters on Google Cloud API - Instance list

I was trying to filter GCP instance based on IP Range or subnet.
API : https://cloud.google.com/compute/docs/reference/rest/v1/instances/list
I am able to use below CLI commands and get the list of desired instances
gcloud compute instances list --filter="networkInterfaces.networkIP>172.23.0.0 AND networkInterfaces.networkIP<172.23.0.170"
gcloud compute instances list --filter="networkInterfaces.subnetwork:default"
But I am not able to use these filters in API explorer provide by GCP.
When I use networkInterfaces.networkIP = "some IP" as filter I am getting below error
"Invalid value for field 'filter': 'networkInterfaces.networkIP = "172.23.0.10"'.
Is there any way we can filter the instance based on IPs?
I am aware that we can filter out once we get the response, but I am looking to apply the filter at request level itself.
Thanks,
Rmp

Serverless.yml VPC parameters

I would just like to ask what are the correct format for the value in the vpc section in serverless.yml especially the securityGroupIds field and the subnetIds field. It is confusing me cause if I go to lambda service in aws console, when we add vpc settings in there the string format for securityGroupIds is something like:
xx-xxxxxxxx(xx_xx_xxx_xxxxxx_xxxxxx)|xx_xx_xxx_xxxxx_xxxxxx
while if I go to vpc service in aws console and click the security group, the security group id has a string format of:
xx-xxxxxxxx | xx_xx_xxx_xxxxxx_xxxxxx
And for subnet ids, the one in lambda page has a format like this:
subnet-xxxxxxxx(xx.xxx.xx.0/xx)|ap-southeast-1a subnet-public-1a
while in the vpc page the format is this:
subnet-xxxxxxxx
My question is which format should I enter in the serverless.yml. The on in the lambda page or the one in the vpc page?
vpcConfig.yml file format should be like
vpcId: vpc-xxxxxxxxxxxxxxxxx
securityGroupIds:
- sg-xxxxxxxxxxxxxxxxx
subnetId:
- subnet-xxxxxxxxxxxxxxxxx
- subnet-xxxxxxxxxxxxxxxxx
- subnet-xxxxxxxxxxxxxxxxx
your lambda should have the subnet-xxxxxxxx

Is there have any API to reset the adapter successStateExpirationSec?

I defined a security check adapter and configured the property which is shown below.
<securityCheckDefinition name="MySecurityTest" class="com.sample.MyTest">
<property name="successStateExpirationSec" defaultValue="30" description="How long is a successful state valid for (seconds)"/>
</securityCheckDefinition>
The configuration means that when I pass the security check, I can access the protected resource under the scope for 30 seconds.
After 30 seconds, the server will force client to logout.
However, no user want their app repeatedly doing validation with high frequency.
We know we can increase the value of successStateExpirationSec, unfortunately, it cannot meet our requirement.
How can I extend the property "successStateExpirationSec" before the time
expired and without revalidation ?
It is not recommended to update the "SuccessStateExpirationSecond" after setting it and before it expires. I think Logical approach for your usecase is to determine the proper value "SuccessExpirationSecond" and set the properties to that value.
Instead of updating in the SecurityCheckDefinition in adapter.xml, you can also set it programatically by Extending "CredentialValidationSecurityCheck" .
Refer sample here .This allows you to set the default properties value.

Google Sheets Api v4 getBatch() range limit

I'm trying to get data from a spreadsheet (59 sheets) using this get request:
https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values:batchGet
I have noticed that 40 ranges (sheets) is the limit before I get illegal request.
Does anyone know if this is normal behaviour and where it is documented?
I just found out that the issue has to do with the length of the url request. I shortened the name of the sheets and I could fit more into the request.