Module prometheus

ballerinax/prometheus Ballerina library

1.0.1

Overview

The Prometheus Observability Extension provides an implementation for exporting metrics to a Prometheus Server.

Key Features

  • Export application metrics to a Prometheus Server
  • Configurable host and port for the metrics endpoint
  • Simple configuration via import and Config.toml
  • Seamless integration with observability tooling

Enabling Prometheus Extension

To package the Prometheus extension into the Jar, follow the following steps.

  1. Add the following import to your program.
Copy
import ballerinax/prometheus 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

To enable the extension and export metrics to Prometheus, add the following to the Config.toml when running your program.

Copy
[ballerina.observe]
metricsEnabled=true
metricsReporter="prometheus"

[ballerinax.prometheus]
host="127.0.0.1"  # Optional Configuration. Default value is localhost
port=9797         # Optional Configuration. Default value is 9797

Import

import ballerinax/prometheus;Copy

Other versions

See more...

Metadata

Released date: 1 day ago

Version: 1.0.1


Compatibility

Platform: any

Ballerina version: 2201.11.0

GraalVM compatible: Yes


Pull count

Total: 20228

Current verison: 60


Weekly downloads