Giter Club home page Giter Club logo

hidden-gems's Introduction

How to use the examples in this repo

Batch processing

The default processor config is set to batch:

processors:
  batch:
  spanmetrics:
    metrics_exporter: prometheus

service:
  pipelines:
    traces:
      receivers: [jaeger]
      processors: [spanmetrics, batch]

Tail-sampling

To enable tail_sampling, make sure your otel-collector-config.yml has the following configuration:

  tail_sampling:
    decision_wait: 10s
    num_traces: 100
    expected_new_traces_per_sec: 10
    policies:
      [
        {
          name: latency-policy,
          type: latency,
          latency: { threshold_ms: 5000 }
        },
        {
          name: status-code-policy,
          type: status_code,
          status_code: { status_codes: [ ERROR, OK ] }
        },
        {
          name: string-policy,
          type: string_attribute,
          string_attribute: { key: alarm, values: [ unexpected ] }
        }
      ]
  spanmetrics:
    metrics_exporter: prometheus

service:
  pipelines:
    traces:
      receivers: [jaeger]
      processors: [spanmetrics, tail_sampling]

Also, use quarkus.opentelemetry.tracer.sampler=on in Quarkus configuration.

curl -X 'POST' 'http://activity:80/api/send-request' -H 'trace-debug-id:local' -H 'accept: /' -H 'Content-Type: application/json' -d '{"uppercase": true,"reverse": true}'

Rate of requests for a specific status in the 5 minutes

(sum by (job, uri, status)(rate(http_server_requests_seconds_sum{job="hobby", method="POST", uri="/api/send-request"}[5m])))
or
(sum by (job, uri, status)(rate(http_server_requests_seconds_sum{job="activity", method="GET", uri="/activity"}[5m])))

Using the trace-debug-id header

If you would like to use the extra attribute for debugging, you can try the following command:

curl -H 'trace-debug-id:local' http://localhost:8080/activity/

Query for a cache hit rate graph with Prometheus

You can simulate some load using hey:

hey -n 20 -c 10 -H 'trace-debug-id:local' http://localhost:8080/activity

sum(delta(cache_gets_total{result="hit",cache="activity"}[1m]))/sum(delta(cache_gets_total{cache="activity"}[1m]))

hidden-gems's People

Contributors

ammbra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

agautam-qa

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.