Giter VIP home page Giter VIP logo

adservice's Introduction

NOTE: The overall helm chart

https://github.com/openinsight-proj/openinsight-helm-charts

adservice-springcloud

This repo re-implements opentelemetry-demo-webstore's adservice with nacos registry and sentinel.

integrate list

  • nacos
  • sentinel

curl

grpcurl -plaintext -d '{"context_keys": ["binoculars","telescopes"]}' localhost:8080 hipstershop.AdService/GetAds

metrics

adservice-springcloud will emit two metrics:

Name Description Unit Type
adservice_grpc_call_total record grpc call totals N/A Counter
adservice_grpc_duration_seconds_bucket record grpc call latency ms histogram

mock latency

the hipstershop.AdService/GetAds API will do a matrix calculation internally, you can use -Dspring.matrixRow=200 to specific the matrix size

mock error

the hipstershop.AdService/GetAds API will return error randomly(50%), you can use -Dspring.randomError=false to disable this feature.

Integrate to Nacos and Sentinel

  • Please notes the bootstrap.yml file:

    adservice/src/main/resources/bootstrap.yml
    
  • Make sure your Dockerfile has: JAVA_OPTS env:

    $JAVA_OPTS -jar /bin/xxx.jar
    
  • Update the -D parms as you want, example like below:

    # Export Sentinel Prometheus metrics
    -javaagent:./jmx_prometheus_javaagent-0.17.0.jar=12345:./prometheus-jmx-config.yaml \
    # Enable Nacos integration
    -Dspring.cloud.nacos.discovery.enabled=true \
    # Nacos configuration server address
    -Dspring.cloud.nacos.config.server-addr=nacos-test.skoala-test:8848 \
    # Nacos service name
    -Dspring.application.name=adservice-springcloud \
    # Nacos registry server address
    -Dspring.cloud.nacos.discovery.server-addr=nacos-test.skoala-test:8848 \
    # For DCE 5.0 need below Kubernetes metadata
    -Dspring.cloud.nacos.discovery.metadata.k8s_cluster_id=xxx \
    -Dspring.cloud.nacos.discovery.metadata.k8s_cluster_name=xxx \
    -Dspring.cloud.nacos.discovery.metadata.k8s_namespace_name=xxx \
    -Dspring.cloud.nacos.discovery.metadata.k8s_workload_type=deployment \
    -Dspring.cloud.nacos.discovery.metadata.k8s_workload_name=adservice-springcloud \
    -Dspring.cloud.nacos.discovery.metadata.k8s_service_name=adservice-springcloud \
    -Dspring.cloud.nacos.discovery.metadata.k8s_pod_name=${HOSTNAME} \
    # Enable Sentinel integration
    -Dspring.cloud.sentinel.enabled=true \
    # Sentinel dashboard address
    -Dspring.cloud.sentinel.transport.dashboard=nacos-test-sentinel.skoala-test:8080
    

adservice's People

Contributors

accelerator96 avatar cynthia-yun avatar frapschen avatar jaredtan95 avatar jzhupup avatar muma378 avatar panpan0000 avatar wilsonwu avatar yangyy93 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.