Socket
Socket
Sign inDemoInstall

@opentelemetry/exporter-metrics-otlp-http

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/exporter-metrics-otlp-http

OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector


Version published
Maintainers
3
Created

What is @opentelemetry/exporter-metrics-otlp-http?

@opentelemetry/exporter-metrics-otlp-http is an npm package that allows you to export OpenTelemetry metrics data using the OTLP (OpenTelemetry Protocol) over HTTP. This package is part of the OpenTelemetry project, which provides a set of APIs, libraries, agents, and instrumentation to enable observability in your applications.

What are @opentelemetry/exporter-metrics-otlp-http's main functionalities?

Export Metrics

This feature allows you to export metrics data to an OTLP endpoint over HTTP. The code sample demonstrates how to set up a MeterProvider with an OTLPMetricExporter and create a counter metric that is incremented every second.

const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-http');

const exporter = new OTLPMetricExporter({
  url: 'http://localhost:4318/v1/metrics',
});

const meterProvider = new MeterProvider({
  exporter,
  interval: 2000,
});

const meter = meterProvider.getMeter('example-meter');
const counter = meter.createCounter('example_counter');

setInterval(() => {
  counter.add(1, { key: 'value' });
}, 1000);

Other packages similar to @opentelemetry/exporter-metrics-otlp-http

Keywords

FAQs

Package last updated on 26 Jan 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc