This file contains 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
protected void configure(HttpSecurity http) throws Exception { | |
http.authorizeRequests() | |
.requestMatchers(EndpointRequest.to(MetricsEndpoint.class)).hasRole("admin") | |
.requestMatchers(EndpointRequest.to(CustomEndpoint.class)).hasRole("admin"); | |
http.csrf().and().httpBasic(); | |
} |
This file contains 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
@Endpoint(id = "customEndpoint") | |
@Component | |
public class CustomEndpoint { | |
@ReadOperation | |
public String customEndpoint(int id) { | |
HashMap<Integer, String> fruitsMap = new HashMap<>(); | |
fruitsMap.put(1, "kiwi"); | |
fruitsMap.put(2, "apple"); | |
fruitsMap.put(3, "banana"); |
This file contains 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 com.monitoring.demo.config; | |
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest; | |
import org.springframework.boot.actuate.metrics.MetricsEndpoint; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | |
@Configuration |
This file contains 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
version: '2.1' | |
services: | |
prometheus: | |
image: prom/prometheus:v2.38.0 | |
network_mode: host | |
container_name: prometheus-container | |
volumes: | |
- ./prometheus/:/etc/prometheus/ |
This file contains 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
scrape_configs: | |
- job_name: 'Spring Boot Application input' | |
metrics_path: '/actuator/prometheus' | |
scrape_interval: 3s | |
static_configs: | |
- targets: ['localhost:8080'] | |
labels: | |
application: 'My Spring Boot Application' | |
This file contains 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
spring: | |
application: | |
name: monitoring-demo | |
management: | |
endpoints: | |
web: | |
base-path: /actuator | |
exposure: | |
include: [ "health","prometheus", "metrics" ] |
This file contains 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
scipy | |
numpy | |
Pillow | |
opencv-python-headless | |
dlib-bin | |
streamlit |
This file contains 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
#! /usr/bin/env python | |
import os | |
import cv2 | |
import numpy | |
import argparse | |
import streamlit as st | |
from PIL import Image, ImageEnhance | |
from face_detection import select_face, select_all_faces | |
from face_swap import face_swap |
This file contains 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
@AnalyzeClasses(packages = "org.mypackage", importOptions = {ArchUnitTest.ExcludeControllerImportOption.class, ImportOption.DoNotIncludeTests.class}) | |
public class ArchUnitTest { | |
static class ExcludeControllerImportOption implements com.tngtech.archunit.core.importer.ImportOption { | |
@Override | |
public boolean includes(Location location) { | |
return !location.contains("SomeControllerClassThatNeedsToBeExcluded"); | |
} | |
} |
This file contains 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
@AnalyzeClasses(packages = "org.mypackage", importOptions = ImportOption.DoNotIncludeTests.class) |