Socket
Book a DemoInstallSign in
Socket

monday-observability-kit

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

monday-observability-kit

This kit responsible of tools that we use here in Monday to make our Microservices observable. By using this package, your microservice will get out-of-the-box Tracing, Metrics, and logs that will be combined toghether to make the microservice monitored a

unpublished
latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Monday Observability Kit

This kit responsible of tools that we use here in Monday to make our Microservices observable. By using this package, your microservice will get out-of-the-box Tracing, Metrics, and logs that will be combined toghether to make the microservice monitored and contain our best practices and policies.✨

Trace Your Application

In order to get started with tracing, you will need to first register the Tracer. The Tracer you are using may provide a convenience method which calls the registration methods for you, but if you would like to call them directly using the OpenTelemtry API. We recomment reading the Api documentation before calling the api directly. Once you have registered the Tracaer, you'll start receiveing start & end spans in the vendor automatically. Also, you can start and end spans manually. A simple example of basic registration and tracing a simple operation is below.

Installation

Install the dependencies and devDependencies and start the server.

yarn add @mondaydotcomorg/monday-observability-kit

Basic Registration

// tracer.ts
import { Tracer } from "@mondaydotcomorg/monday-observability-kit"
import executionContext from "./execution-context"
const collectorUrl = process.env.TRACER_URL
// Create and register the SDK
const tracer = Tracer.initialize({
    collector: {
      url: collectorUrl
    },
    serviceName: "service-name"
    authExecutionContext: executionContext,
})

return tracer;

// That's it!

By doing that, the package automatically instrument a variety of technologies that we use. You can see here the supported instrumentations: Supported Instrumentations

Those instrumentations can be controlled as well. Please refer to the API documentation for more details.

Manual Instrumentation

There will be times where we'll want to manually instrument part of the code, or adding some attributes to a span. Here are few examples. For full documentation check out the API reference.

WrapMethodWithActiveSpan:

// tracer.ts
import { WrapMethodWithActiveSpan, StartActiveSpan } from "src/tracer"

function a() {
    await doSomething()
}

export default WrapMethodWithActiveSpan(a);

// another thing we could do is:
function b() {
        Tracer.startActiveSpan("someMeaningfulAction", (span) => {
            await doSomething();
            span.end();
        })
    }
}

Want to contribute?

Clone the repo to your personal env, Open your favorite Terminal and run these commands.

    yarn && yarn link

Open a PR with your changes. We expect every PR to include tests.

Approvers (@observability-kit/approvers):

FAQs

Package last updated on 07 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts