This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - job_name: unlabelled_job | |
| ec2_sd_configs: | |
| - region: us-east-1 | |
| port: 9000 | |
| relabel_configs: | |
| - source_labels: [__meta_ec2_tag_Name] | |
| regex: (my-cool-api) | |
| action: keep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Alert if disk usage % greater than 80 | |
| disk_space_usage_pc=job:node_filesystem_used:pc{team="cerebro"} | |
| ALERT disk_space_usage_pc_warning | |
| IF disk_space_usage_pc > 80 | |
| FOR 5m | |
| LABELS { | |
| severity = "high" | |
| } | |
| ALERT disk_space_usage_pc_alert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.inject.{Inject, Singleton} | |
| import org.lyranthe.prometheus.client._ | |
| class Filters @Inject()(prometheusFilter: PrometheusFilter) extends HttpFilters { | |
| val filters = Seq(prometheusFilter) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.inject.{Inject, Singleton} | |
| import org.lyranthe.prometheus.client._ | |
| @Singleton | |
| class PrometheusJmxInstrumentation @Inject()()(implicit registry: Registry) { | |
| jmx.register() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- gets all fields from a hash as a dictionary | |
| local hgetall = function (key) | |
| local bulk = redis.call('HGETALL', key) | |
| local result = {} | |
| local nextkey | |
| for i, v in ipairs(bulk) do | |
| if i % 2 == 1 then | |
| nextkey = v | |
| else | |
| result[nextkey] = v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package config | |
| import akka.actor.ActorSystem | |
| import com.example.driver.RedisClient | |
| import com.google.inject.name.Named | |
| import com.google.inject.{AbstractModule, Provides} | |
| class Config extends AbstractModule { | |
| override def configure(): Unit = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package services | |
| import com.example.driver.RedisClient | |
| import com.google.inject.Inject | |
| import com.google.inject.name.Named | |
| class MyRedisService @Inject()(@Named("myDbOne") redisClientOne: RedisClient, @Named("myDbTwo") redisClientTwo: RedisClient) { | |
| def doSomething = { | |
| redisClientOne.doSomething |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type" : "object", | |
| "properties" : { | |
| "address" : { | |
| "type" : "object", | |
| "properties" : { | |
| "addressLine2" : { | |
| "type" : "string" | |
| }, | |
| "addressLine1" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Address { | |
| private String addressLine1; | |
| private String addressLine2; | |
| public String getAddressLine1() { | |
| return addressLine1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Entity | |
| @Table(name ="product") | |
| public class Product { | |
| private Integer id; | |
| private String name; | |
| private List<ProductItem> productItems =new LinkedList<ProductItem>(); | |
| public Product() { | |
| } |