Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ramesh Lingappa ramesh-dev

🎯
Focusing
View GitHub Profile
View PushGatway_HelloService.java
package com.example.prometheuspushgateway;
import io.micrometer.core.annotation.Timed;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.stereotype.Service;
@Service
public class HelloService {
@ramesh-dev
ramesh-dev / prometheus.yml
Created Jul 9, 2020
pushgateway sample prometheus config file
View prometheus.yml
# my global config
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
@ramesh-dev
ramesh-dev / pushgateway_docker-compose.yml
Created Jul 9, 2020
PushGateway docker compose file
View pushgateway_docker-compose.yml
version: '3'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
pushgateway_data: {}
services:
prometheus:
View secretmanager-demo_app.yml
service: secrets-demo
runtime: java11
instance_class: F2
env_variables:
SPRING_PROFILES_ACTIVE: "prod"
GCP_SECRETS_ENABLED: true
View secretmanager-demo_HelloController.java
package com.rameshl.demo.secretmanager;
import com.rameshl.demo.secretmanager.config.AppSecrets;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
public class HelloController {
View secretmanager-demo_AppSecrets.java
package com.rameshl.demo.secretmanager.config;
import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "app.secrets")
View secretmanager-demo_application-prod.yml
spring:
profiles:
active: prod
app:
secrets:
googleClientId: ${gcp-secrets.google_client_id}
googleClientSecret: ${gcp-secrets.google_client_secret}
@ramesh-dev
ramesh-dev / secretmanager-demo_bootstrap.yml
Created Apr 4, 2020
SecretManager Bootstrap yaml configuration
View secretmanager-demo_bootstrap.yml
spring:
cloud:
gcp:
secretmanager:
enabled: ${GCP_SECRETS_ENABLED:false}
bootstrap:
enabled: ${GCP_SECRETS_ENABLED:false}
secret-name-prefix: gcp-secrets.
View run_grpc_demo_makefile.make
# Pass the following environment variables while calling the command \
GCP_PROJECT - the gcp project name \
SERVICE_NAME - the name of the service to be deployed
# build
.PHONY: build
build:
@echo "🍳 Building docker image using Cloud build"
gcloud builds submit --tag gcr.io/$(GCP_PROJECT)/$(SERVICE_NAME):0.1 --project $(GCP_PROJECT)
View run_grpc_demo_dockerfile.dockerfile
FROM gradle:6.3.0-jdk11 as builder
# Copy local code to the container image.
WORKDIR /app
COPY build.gradle .
COPY settings.gradle .
COPY src ./src
# Build a release artifact.
RUN gradle build -x test
You can’t perform that action at this time.