Giter Site home page Giter Site logo

krakendio-krakend-usage's Introduction

KrakenD usage module

An anonymous software usage reporter with proof of work.

The KrakenD usage is designed to collect anonymous information from any software and push it to a server, but it was built for KrakenD. Read the blog post. You can use it with the following code in any app:

	if err := Report(
		ctx,
		Options{
			ClusterID:       "clusterId",
			ServerID:        "serverId",
			URL:             "https://my.usage.api.tld",
			Version:         "v1.2.3",
			ExtraPayload:    someExtraPayload,
			ReportLapse:     12 * time.Hour,
			UserAgent:       "foo bar",
			ReportEndpoint:  "/report",
			SessionEndpoint: "/session",
		},
		nil,
	); err != nil {
		t.Error(err)
		return
	}

From the options above, you must implement at least the ClusterID, ServerID, and URL. We recommend using an uuid randomly-generated for the IDs. All the options are documented here.

The processing server for this report is out of the project's scope, but you can get inspiration from the tests.

On KrakenD API gateway, the module is entirely disabled by setting an environment var USAGE_DISABLE=1, but you should decide your strategy to disable it in your application.

Note on v2

The v2 API is not compatible with the previous version, although is pretty similar. Please check the new interface for the required changes.

krakendio-krakend-usage's People

Contributors

kpacha avatar alombarte 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.