Code Monkey home page Code Monkey logo

Comments (2)

jmarantz avatar jmarantz commented on July 17, 2024

there's some discussion of the stats architecture here: https://github.com/envoyproxy/envoy/blob/main/source/docs/stats.md

This is not really a how-to guide to add new stats but it might be a good start, as well as grepping around the source.

It also might be interesting to explore the codebase using the sourcegraph tool, e.g. with this as a starting point: https://sourcegraph.com/github.com/envoyproxy/envoy/-/blob/source/common/stats/utility.h?L95:16&popover=pinned

from envoy.

ppourali avatar ppourali commented on July 17, 2024

Thanks Joshua for the links. I ended up using adding the metric using

scope_ = server_context_->scope().createScope("mymetric")
stats_ = {ALL_TCP_PROXY_STATS(POOL_COUNTER(*scope), POOL_GAUGE(*scope))};

from my extension and it worked. I think the important part is to keep the pointer to the created scope and the stat itself alive for the lifetime of the server since they seem to be a RefPointer.

Thanks,
Parsa

from envoy.

Related Issues (20)

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.