Skip to content

Instantly share code, notes, and snippets.

global:
scrape_interval: 5s # By default, scrape targets every 15 seconds.
evaluation_interval: 5s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'MyApplication'
@romilptl
romilptl / scheduled-task.json
Created March 8, 2020 09:20
Scheduled Task of an Application
{
"cron": [
{
"runnable": {
"target": "com.learning.monitoring.client.config.ScheduledTasks.sendNotifications"
},
"expression": "0 0/10 * * * ?"
}
],
"fixedDelay": [
@romilptl
romilptl / env.json
Last active March 9, 2020 12:35
System configuration, JVM details, property configuration such as database, security, management, etc of the deployed Application
{
"activeProfiles": [],
"name": "systemProperties",
"properties": {
"sun.boot.library.path": {
"value": "C:\\ProgramFiles\\Java\\jdk1.8.0_201\\jre\\bin"
},
"java.vm.version": {
"value": "25.201-b09"
},
{
"_links": {
"self": {
"href": "http://localhost:8080/actuator",
"templated": false
},
"beans": {
"href": "http://localhost:8080/actuator/beans",
"templated": false
},
@romilptl
romilptl / http-server-requests-response.json
Created March 8, 2020 05:34
Response with different status codes, exceptions and methods
{
"name": "http.server.requests",
"description": null,
"baseUnit": "seconds",
"measurements": [
{
"statistic": "COUNT",
"value": 13.0
},
{
@romilptl
romilptl / UserController.java
Last active March 8, 2020 05:20
APIs with the required response, status code and exceptions.
@RestController
@RequestMapping("/users")
public class UserController {
@Autowired UserService userService;
@PostMapping(value = "/save", consumes = "application/json", produces = "application/json")
public ResponseEntity<User> save(@RequestBody User user) {
user = userService.save(user);
return new ResponseEntity<>(user, HttpStatus.OK);
{
"name": "http.server.requests",
"description": null,
"baseUnit": "seconds",
"measurements": [
{
"statistic": "COUNT",
"value": 1.0
},
{