Giter VIP home page Giter VIP logo

metrics-demo's Introduction

metrics-demo

Just a basic HTTP Server on port 8080 to provide some prometheus and otlp metrics (good for testing)

The following path are available:

  • / returns 200 and Headers
  • /ping returns pong
  • /q/health/ready readiness check
  • /q/health/live liveness check
  • /q/metrics metrics
  • /metrics on standard path
  • / same as '/'
  • /otlpmetrics increase otlp metric counter

run locally

set otel collector http endpoint (if available) :

docker run -d --name otel-collector -v $(pwd)/otel-config.yaml:/etc/otelcol/config.yaml otel/opentelemetry-collector:0.73.0
docker logs otel-collector -f
# in new terminal
ip=$(docker inspect otel-collector -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}')
#now pick one of the configurations below
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL="http/protobuf" OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://$(echo $ip):4318/v1/metrics go run main.go
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL="http/protobuf" OTEL_EXPORTER_OTLP_ENDPOINT=http://$(echo $ip):4318 go run main.go
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL="grpc" OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://$(echo $ip):4317 go run main.go

stop it:

docker stop otel-collector
docker rm otel-collector

For otlp metrics to work endpoint must be running.

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.