Git Product home page Git Product logo

Comments (8)

sv2 avatar sv2 commented on May 30, 2024

Hi! To connect to ElasticSearch, specify ES URL in options when initializing swagger-stats:

        var swsOptions = {
            name: 'swagger-stats-spectest',
            version: '0.95.0',
            hostname: "hostname",
            ip: "127.0.0.1",
            swaggerSpec:swaggerSpec,
            uriPath: '/swagger-stats',
            durationBuckets: [10, 25, 50, 100, 200],
            requestSizeBuckets: [10, 25, 50, 100, 200],
            responseSizeBuckets: [10, 25, 50, 100, 200],
            apdexThreshold: 25,
            elasticsearch = 'http://localhost:9200'
        };
        app.use(swStats.getMiddleware(swsOptions));

The schema (index template) of the documents written to ElasticSearch by swagger-stats is available in /schema/elasticsearch/api_index_template.json

Will be adding more docs ...

from swagger-stats.

dduo518 avatar dduo518 commented on May 30, 2024

i use

var swStats = require('swagger-stats');
// var apiSpec = require('swagger.json');
webApp.use(swStats.getMiddleware({
    elasticsearch: "http://xx.xx.xx.xx:9200"
}));

but the' http://xx.xx.xx.xx:30001/swagger-stats/ui#sws_rates'
rtx
when i restart app server the data is disappear
How to persist data๏ผŸ

from swagger-stats.

sv2 avatar sv2 commented on May 30, 2024

Hi ! The data in built-in telemetry dashboard is not persisted across restarts. Swagger-stats shows built-in dashboard based on in-memory data only. This is to ensure that built-in telemetry does not depend on any external server.
Now, if you have ElasticSearch enabled, swagger-stats wrintes info about each API requests to ElasticSearch. This data is persistent. You can use Kibana to analyze data written into ElasticSearch. You may load provided Kibana dashboard, or create your own, and of course use Discover in Kibana.

from swagger-stats.

dduo518 avatar dduo518 commented on May 30, 2024

@sv2 thk u for woking all very much

from swagger-stats.

charlie-harvey avatar charlie-harvey commented on May 30, 2024

How come memory and cpu stats are not sent to ES? Would be really nice instead of only Prometheus.
Thanks.

from swagger-stats.

sv2 avatar sv2 commented on May 30, 2024

Makes sense, will do. Thanks !

from swagger-stats.

sv2 avatar sv2 commented on May 30, 2024

#85 - for tracking

from swagger-stats.

jungrylls avatar jungrylls commented on May 30, 2024

@sv2 "You may load provided Kibana dashboard,"
Could you explain how to load the provided Kibana dashboard please ?

from swagger-stats.

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.