@opentelemetry/resource-detector-instana
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

OpenTelemetry Resource Detector for Instana

NPM Published Version Apache License

This resource detector will detect the Instana agent to register the Opentelemetry as a Node.js process. The created resource will be automatically merged with the existing resources and contains the real PID, which is returned from the Instana agent. This mechanism is needed to connect the Node.js Otel process with the incoming Opentelemetry spans.

Installation

npm install --save @opentelemetry/resource-detector-instana

Environment variables

  • INSTANA_AGENT_HOST: The Instana agent hostname.
  • INSTANA_AGENT_PORT: The Instana agent port.
  • INSTANA_RETRY_TIMEOUT_MS: The resource detector does three retries to connect to the Instana agent. This is the timeout between the retries.
  • INSTANA_AGENT_TIMEOUT_MS: The client timeout when connecting the Instana agent.

Usage

import {
  Resource,
  processDetector,
  envDetector,
} from "@opentelemetry/resources";
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
import { NodeSDK } from "@opentelemetry/sdk-node";
import { instanaAgentDetector } from "@opentelemetry/resource-detector-instana";

const globalResource = new Resource({
   [SemanticResourceAttributes.SERVICE_NAME]: "TestService",
});

const sdk = new NodeSDK({
   resourceDetectors: [envDetector, processDetector, instanaAgentDetector],
   resource: globalResource,
});

sdk.start()

Useful links

License

Apache 2.0 - See LICENSE for more information.

Package Sidebar

Install

npm i @opentelemetry/resource-detector-instana

Weekly Downloads

3,073

Version

0.8.0

License

Apache-2.0

Unpacked Size

32.6 kB

Total Files

12

Last publish

Collaborators

  • pichlermarc
  • bogdandrutu
  • dyladan