Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions example-apps/otel/README.md

This file was deleted.

3,717 changes: 0 additions & 3,717 deletions example-apps/otel/package-lock.json

This file was deleted.

25 changes: 0 additions & 25 deletions example-apps/otel/package.json

This file was deleted.

126 changes: 0 additions & 126 deletions example-apps/otel/server.js

This file was deleted.

35 changes: 35 additions & 0 deletions example-apps/otel/serverless-instana-format-grpc/tracing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* (c) Copyright IBM Corp. 2026
*/

'use strict';

const process = require('process');
require('@opentelemetry/api');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');

// Require the Instana OpenTelemetry Exporter
const { InstanaExporter } = require('@instana/opentelemetry-exporter');

// Instantiate the Instana Exporter.
// Make sure to provide the agent key and the serverless endpoint URL via the following environment variables:
// * INSTANA_AGENT_KEY
// * INSTANA_ENDPOINT_URL
const instanaTraceExporter = new InstanaExporter();

/*
* If you have not provided the agent key and the serverless endpoint URL via environment variables:
* const instanaTraceExporter = new InstanaExporter({ agentKey: 'agent_key', endpointUrl: 'endpoint_url' });
*/

const nodeAutoInstrumentations = getNodeAutoInstrumentations();

const sdk = new opentelemetry.NodeSDK({
traceExporter: instanaTraceExporter,
instrumentations: [nodeAutoInstrumentations]
});

sdk.start();
30 changes: 30 additions & 0 deletions example-apps/otel/serverless-otlp-format-grpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Serverless OpenTelemetry OTLP traces and metrics

## Requirements

- Choose an [OTLP acceptor endpoint](https://www.ibm.com/docs/en/instana-observability/current?topic=instana-backend#endpoints-of-the-instana-backend-otlp-acceptor).
- Read the x-instana-key from the agent installation docs of the target SaaS instance.

## Installation

```sh
npm install @grpc/grpc-js --save
npm install @opentelemetry/api --save
npm install @opentelemetry/auto-instrumentations-node --save
npm install @opentelemetry/exporter-metrics-otlp-grpc --save
npm install @opentelemetry/exporter-trace-otlp-grpc --save
npm install @opentelemetry/host-metrics --save
npm install @opentelemetry/instrumentation-kafkajs --save
npm install @opentelemetry/sdk-metrics --save
npm install @opentelemetry/sdk-node --save
npm install express --save
npm install kafkajs --save
```

## Start

```sh
INSTANA_KEY=xxx OTEL_EXPORTER_OTLP_ENDPOINT=yyy OTEL_LOG_LEVEL=debug OTEL_SERVICE_NAME=node-otlp-grpc npm start

node kafka-consumer.js
```
Loading