Socket
Socket
Sign inDemoInstall

@opentelemetry/semantic-conventions

Package Overview
Dependencies
0
Maintainers
3
Versions
103
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @opentelemetry/semantic-conventions

OpenTelemetry semantic conventions


Version published
Weekly downloads
11M
decreased by-1.81%
Maintainers
3
Install size
1.58 MB
Created
Weekly downloads
 

Package description

What is @opentelemetry/semantic-conventions?

The @opentelemetry/semantic-conventions package provides standardized naming and semantic conventions for attributes in OpenTelemetry. These conventions help ensure that telemetry data is consistent, interpretable, and analyzable across different systems and services. The package includes constants for resource attributes, span attributes, and event names that are recommended by the OpenTelemetry specification.

What are @opentelemetry/semantic-conventions's main functionalities?

Resource Attributes

Defines standard attributes to be used for service resources, allowing you to annotate your telemetry data with information about the service instance.

{"service.name": 'my-service', "service.version": '1.0.0', "service.instance.id": 'instance-123'}

Span Attributes

Provides a set of standard attributes for spans, which represent individual operations within a trace. These attributes can be used to add metadata about the operation, such as HTTP method, URL, and status code.

{"http.method": 'GET', "http.url": 'https://example.com', "http.status_code": 200}

Event Names

Includes standardized event names for logging exceptions, messages, and metrics within spans. This helps in categorizing and querying telemetry events.

"exception", "message", "metric"

Other packages similar to @opentelemetry/semantic-conventions

Changelog

Source

1.24.0

:rocket: (Enhancement)

  • feat(sdk-trace-base): log resource attributes in ConsoleSpanExporter #4605 @pichlermarc
  • feat(propagator-aws-xray): moved AWS Xray propagator from contrib 4603 @martinkuba
  • feat(resources): new experimental detector ServiceInstanceIdDetectorSync that sets the value for service.instance.id as random UUID. #4608 @maryliag

:bug: (Bug Fix)

  • fix(sdk-trace-web): fix invalid timings in span events #4486 @Abinet18
  • fix(resources): ensure BrowserDetector does not think Node.js v21 is a browser #4561 @trentm

Readme

Source

OpenTelemetry Semantic Conventions

NPM Published Version Apache License

Semantic Convention constants for use with the OpenTelemetry SDK/APIs. This document defines standard attributes for traces.

Installation

npm install --save @opentelemetry/semantic-conventions

Usage

import { SemanticAttributes } from '@opentelemetry/semantic-conventions';

const span = tracer.startSpan().startSpan(spanName, spanOptions)
  .setAttributes({
    [SemanticAttributes.NET_PEER_NAME]: 'localhost',
  });

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Last updated on 24 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc