5.16.1 • Published 9 months ago

@luvio/service-instrumentation v5.16.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
9 months ago

This software is provided as-is with no support provided.

Instrumentation Service

We are about standards around here. OpenTelemetry is the standard. We are also about exposing what makes sense from their API for a library. We want to trace and record metrics. We want to log too, but that component is under development (as of March 2024), so for the sake of stability we will hold off on that.

No-Op Implementation

We provide a no-op implementation OOTB, so things run smoothly when an actual implementation is not provided.

Use buildNoopInstrumentationService when building out your services.

import { buildNoopInstrumentationService } from '@luvio/service-instrumentation/v1';

Aside: We originally tried using the no-op implementations provided by the OTel API, but it came with a cost of 7kb, which was a little rich for our taste, especially when this service exposes a relatively small subset of the API. I'm sure there is a way to scope it down, but for now we make due with our own

Adding to the interface

So you realized we have to have DiagAPI as part of the API? (We probably should add it at some point)

The process is pretty simple, albeit tedious (with the handrolling of a No-Op implementation and the unit-testing). What's important is that we are only pulling in the portion of the API that makes sense. For example, with the TraceAPI, setGlobalTracerProvider is the responsibility of the runtime application, and we shouldn't have the power to set it ourselves, so we leave that out. With that in mind, there are only a few steps to take.

  1. Create a type from the OTel API you'd like to include, use Pick<> to select what makes sense
  2. Add it to the service interface
  3. Create a No-Op implementation, along with unit tests to keep our code coverage happy
  4. Update the buildNoopInstrumentationService function we export with the service

Checkout this PR that adds the MetricsAPI to the service interface for guidance.

5.15.0

9 months ago

5.16.1

9 months ago

5.16.0

9 months ago

5.14.0

9 months ago

5.13.1

9 months ago

5.13.0

9 months ago

5.10.3-alpha.0

10 months ago

5.12.1

9 months ago

5.12.0

9 months ago

5.10.2

10 months ago

5.11.0

10 months ago

5.10.1

10 months ago

5.10.0

10 months ago

5.3.2-dev2

10 months ago

5.9.0

10 months ago

5.3.2-dev1

10 months ago

5.8.0

10 months ago

5.7.1

10 months ago

5.7.0

10 months ago

5.6.0

11 months ago

5.5.0

11 months ago

5.4.0

11 months ago

5.3.1

1 year ago

5.3.0

1 year ago

5.2.0

1 year ago

5.1.0

1 year ago

5.0.0

1 year ago

4.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

3.4.4

1 year ago

3.4.3

1 year ago

3.4.0

1 year ago

3.4.2

1 year ago

3.4.1

1 year ago

3.3.5

1 year ago

3.3.4

1 year ago

3.3.3

1 year ago

3.3.2

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago