ballerinax/amp Ballerina library

1.1.0

Package Overview

The Amp Observability Extension is one of the tracing extensions of the Ballerina language.

It provides an implementation for tracing and publishing traces to a WSO2 AI Agent Platform using OpenTelemetry Protobuf HTTP endpoint.

Enabling Amp Extension

To enable the AMP extension in a Ballerina program, follow the below steps.

  1. Create a program with an AI agent eg: https://ballerina.io/learn/by-example/chat-agents/

  2. Add the following import to your program.

Copy
import ballerinax/amp as _;
  1. Add the following to the Ballerina.toml when building your program.
Copy
[package]
org = "my_org"
name = "my_package"
version = "1.0.0"

[build-options]
observabilityIncluded=true
  1. Add the following to the Config.toml when running your program.
Copy
[ballerina.observe]
tracingEnabled=true
tracingProvider="amp"

[ballerinax.amp]
# OpenTelemetry endpoint for Amp
otelEndpoint="http://localhost:22893/otel"  # Optional. Default: http://localhost:22893/otel

# Amp authentication and identification (optional)
# If passed empty string (default value) these will not be added.
apiKey=""          # API key for authentication send via Authorization header
orgUid=""          # Organization UID send as a resource attribute
projectUid=""      # Project UID send as a resource attribute
componentUid=""    # Component UID send as a resource attribute
environmentUid=""  # Environment UID send as a resource attribute
  1. Use Try It feature in Ballerina plugin or AI Chat view in BI plugin to send a message to the agent. This will result in a trace being published to the WSO2 AI Agent Platform.

Import

import ballerinax/amp;Copy

Other versions

1.1.0

1.0.0

Metadata

Released date: 15 days ago

Version: 1.1.0


Compatibility

Platform: java21

Ballerina version: 2201.13.0

GraalVM compatible: Yes


Pull count

Total: 17

Current verison: 5


Weekly downloads