rc/observability

Definition · Catalog README · Source

Use this extension to say how the platform can see what your workload is doing: its traces, metrics and logs.

There are two ways, and each one is an interface type:

  • otlp_export: your workload sends its traces, metrics or logs to a receiver, using OpenTelemetry (OTLP). The platform gives it a receiver to send to.
  • prometheus_scrape: your workload shows its metrics on a web address, and a Prometheus server reads them from time to time. The platform sets up the reading.

If your workload does both, add one Condition for each.

Documentation

This extension declares how a workload sends or exposes telemetry. Each Condition describes one endpoint: otlp_export requires a compatible OTLP receiver, while prometheus_scrape identifies a metrics endpoint that a scraper must reach. A workload using both forms declares two Conditions.

The first release is 0.1.0. The newest is 0.2.0, with the same rules and simpler descriptions and examples. See the OTLP export and Prometheus scrape examples.

OTLP export

interface.signals is a nonempty set of traces, metrics, and logs. A collector must accept every declared signal. interface.transport selects grpc, http/protobuf, or http/json; the receiving endpoint must support that transport and encoding. The workload sends telemetry to the receiver.

The Condition's name identifies the logical receiver requirement. The fulfilling platform chooses its address and supplies runtime configuration to the workload. A fixed collector URL, authentication credentials, exporter headers, retries, and sampling settings are not part of this contract.

Prometheus scrape

The workload exposes metrics on interface.port at the absolute HTTP interface.path, using interface.scheme (http or https). All three fields are required. An adapter can use them to configure discovery and scraping; the workload must still serve a Prometheus-compatible metrics response at that endpoint. The platform chooses the target address, scrape schedule, and any TLS or authentication configuration.

These Conditions describe requirements, not how a particular collector, scraper, or cluster is provisioned.

Packages

Install the package for your language to declare this extension's Conditions from your code.

Go

Package
runtimeconditions.io/x/rc/observability
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

go get runtimeconditions.io/x/rc/observability@v0.2.0

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.observability · otlp_export: Your workload sends telemetry to an OpenTelemetry (OTLP) receiver.

observability.OtlpExport is the interface of a rc.observability Condition.

Field Type Required Description
Signals Signals yes The kinds of telemetry that your workload sends, such as traces, metrics and logs. At least one of traces, metrics and logs, each one once.
Values:
logs: Logs, which are the lines of text that your workload writes about what it does.
metrics: Metrics, which are numbers measured over time, such as the number of requests.
traces: Traces, which show how one request moves through your services.
Transport Transport yes How your workload sends the telemetry. The receiver must accept this way. grpc, http/protobuf or http/json. The receiver must accept it.
Values:
grpc: OTLP over gRPC, with the data in Protocol Buffers.
http/json: OTLP over HTTP, with the data in JSON.
http/protobuf: OTLP over HTTP, with the data in Protocol Buffers.
rc.observability · prometheus_scrape: Your workload shows metrics that a Prometheus server can read.

observability.PrometheusScrape is the interface of a rc.observability Condition.

Field Type Required Description
Path string yes The web path where your workload shows its metrics, such as /metrics. The web path. It must start with /.
Port int64 yes The TCP port where your workload shows its metrics. A TCP port, from 1 to 65535.
Scheme Scheme yes Whether Prometheus reads the metrics over http or https. http or https.
Values:
http: Read the metrics over plain HTTP.
https: Read the metrics over HTTPS.

RcObservability

observability.RcObservability declares a rc.observability Condition.

Example: a workload that sends its traces and logs with OpenTelemetry over gRPC.

observability.RcObservability(
	observability.OtlpExport{
		Signals: observability.Signals{
			observability.SignalsItemTraces,
			observability.SignalsItemLogs,
		},
		Transport: observability.TransportGrpc,
	},
)

The full API, with every type, field and constant documented, is in the Go package documentation.

Python

Package
runtimeconditions-observability
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

pip install runtimeconditions-observability

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.observability · otlp_export: Your workload sends telemetry to an OpenTelemetry (OTLP) receiver.

OtlpExport is the interface of a rc.observability Condition.

Field Type Required Description
signals Signals yes The kinds of telemetry that your workload sends, such as traces, metrics and logs. At least one of traces, metrics and logs, each one once.
Values:
logs: Logs, which are the lines of text that your workload writes about what it does.
metrics: Metrics, which are numbers measured over time, such as the number of requests.
traces: Traces, which show how one request moves through your services.
transport Transport yes How your workload sends the telemetry. The receiver must accept this way. grpc, http/protobuf or http/json. The receiver must accept it.
Values:
grpc: OTLP over gRPC, with the data in Protocol Buffers.
http/json: OTLP over HTTP, with the data in JSON.
http/protobuf: OTLP over HTTP, with the data in Protocol Buffers.
rc.observability · prometheus_scrape: Your workload shows metrics that a Prometheus server can read.

PrometheusScrape is the interface of a rc.observability Condition.

Field Type Required Description
path str yes The web path where your workload shows its metrics, such as /metrics. The web path. It must start with /.
port int yes The TCP port where your workload shows its metrics. A TCP port, from 1 to 65535.
scheme Scheme yes Whether Prometheus reads the metrics over http or https. http or https.
Values:
http: Read the metrics over plain HTTP.
https: Read the metrics over HTTPS.

rc_observability

rc_observability declares a rc.observability Condition.

Example: a workload that sends its traces and logs with OpenTelemetry over gRPC.

from runtimeconditions_observability import (
    OtlpExport,
    SignalsItem,
    Transport,
    rc_observability,
)

rc_observability(
    OtlpExport(
        signals=[SignalsItem.TRACES, SignalsItem.LOGS],
        transport=Transport.GRPC,
    ),
)

Every class, field and enum member is documented in the package's docstrings.

TypeScript

Package
@runtimeconditions/observability
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

npm install @runtimeconditions/observability

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.observability · otlp_export: Your workload sends telemetry to an OpenTelemetry (OTLP) receiver.

OtlpExport is the interface of a rc.observability Condition.

Field Type Required Description
signals Signals yes The kinds of telemetry that your workload sends, such as traces, metrics and logs. At least one of traces, metrics and logs, each one once.
Values:
logs: Logs, which are the lines of text that your workload writes about what it does.
metrics: Metrics, which are numbers measured over time, such as the number of requests.
traces: Traces, which show how one request moves through your services.
transport Transport yes How your workload sends the telemetry. The receiver must accept this way. grpc, http/protobuf or http/json. The receiver must accept it.
Values:
grpc: OTLP over gRPC, with the data in Protocol Buffers.
http/json: OTLP over HTTP, with the data in JSON.
http/protobuf: OTLP over HTTP, with the data in Protocol Buffers.
rc.observability · prometheus_scrape: Your workload shows metrics that a Prometheus server can read.

PrometheusScrape is the interface of a rc.observability Condition.

Field Type Required Description
path string yes The web path where your workload shows its metrics, such as /metrics. The web path. It must start with /.
port number yes The TCP port where your workload shows its metrics. A TCP port, from 1 to 65535.
scheme Scheme yes Whether Prometheus reads the metrics over http or https. http or https.
Values:
http: Read the metrics over plain HTTP.
https: Read the metrics over HTTPS.

rcObservability

rcObservability declares a rc.observability Condition.

Example: a workload that sends its traces and logs with OpenTelemetry over gRPC.

import { OtlpExport, SignalsItem, Transport, rcObservability } from "@runtimeconditions/observability";

rcObservability(
  new OtlpExport({ signals: [SignalsItem.Traces, SignalsItem.Logs], transport: Transport.Grpc }),
);

Every class, field and enum member is documented in the package's type declarations.

Java

Package
io.runtimeconditions.bindings:runtimeconditions-observability
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

<dependency>
  <groupId>io.runtimeconditions.bindings</groupId>
  <artifactId>runtimeconditions-observability</artifactId>
  <version>0.2.0</version>
</dependency>

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.observability · otlp_export: Your workload sends telemetry to an OpenTelemetry (OTLP) receiver.

OtlpExport is the interface of a rc.observability Condition.

Field Type Required Description
signals Signals yes The kinds of telemetry that your workload sends, such as traces, metrics and logs. At least one of traces, metrics and logs, each one once.
Values:
logs: Logs, which are the lines of text that your workload writes about what it does.
metrics: Metrics, which are numbers measured over time, such as the number of requests.
traces: Traces, which show how one request moves through your services.
transport Transport yes How your workload sends the telemetry. The receiver must accept this way. grpc, http/protobuf or http/json. The receiver must accept it.
Values:
grpc: OTLP over gRPC, with the data in Protocol Buffers.
http/json: OTLP over HTTP, with the data in JSON.
http/protobuf: OTLP over HTTP, with the data in Protocol Buffers.
rc.observability · prometheus_scrape: Your workload shows metrics that a Prometheus server can read.

PrometheusScrape is the interface of a rc.observability Condition.

Field Type Required Description
path String yes The web path where your workload shows its metrics, such as /metrics. The web path. It must start with /.
port Long yes The TCP port where your workload shows its metrics. A TCP port, from 1 to 65535.
scheme Scheme yes Whether Prometheus reads the metrics over http or https. http or https.
Values:
http: Read the metrics over plain HTTP.
https: Read the metrics over HTTPS.

Bindings.rcObservability

Bindings.rcObservability declares a rc.observability Condition.

Example: a workload that sends its traces and logs with OpenTelemetry over gRPC.

import io.runtimeconditions.bindings.observability.Bindings;
import io.runtimeconditions.bindings.observability.OtlpExport;
import io.runtimeconditions.bindings.observability.Signals;
import io.runtimeconditions.bindings.observability.SignalsItem;
import io.runtimeconditions.bindings.observability.Transport;
import java.util.List;

Bindings.rcObservability(
    new OtlpExport(new Signals(List.of(SignalsItem.TRACES, SignalsItem.LOGS)), Transport.GRPC));

Every record, component and enum constant is documented in the Javadoc.

Kinds

rc.observability

Your workload sends telemetry to the platform, or shows telemetry that the platform must collect.

Example: a workload that sends its traces and logs with OpenTelemetry over gRPC.

kind: rc.observability
interface:
  type: otlp_export
  signals: [traces, logs]
  transport: grpc

Interface types

Interface types

otlp_export rc.observability

Your workload sends telemetry to an OpenTelemetry (OTLP) receiver.

Example: a workload that sends its traces, metrics and logs with OpenTelemetry over HTTP.

kind: rc.observability
interface:
  type: otlp_export
  signals: [traces, metrics, logs]
  transport: http/protobuf

Fields

interface.signals

The kinds of telemetry that your workload sends, such as traces, metrics and logs.

interface.transport

How your workload sends the telemetry. The receiver must accept this way.

Allowed values for interface.signals[]
ValueDescription
tracesTraces, which show how one request moves through your services.
metricsMetrics, which are numbers measured over time, such as the number of requests.
logsLogs, which are the lines of text that your workload writes about what it does.
Allowed values for interface.transport
ValueDescription
grpcOTLP over gRPC, with the data in Protocol Buffers.
http/protobufOTLP over HTTP, with the data in Protocol Buffers.
http/jsonOTLP over HTTP, with the data in JSON.

prometheus_scrape rc.observability

Your workload shows metrics that a Prometheus server can read.

Example: a workload that shows its metrics over HTTP, on port 9090, at the path /metrics.

kind: rc.observability
interface:
  type: prometheus_scrape
  port: 9090
  path: /metrics
  scheme: http

Fields

interface.port

The TCP port where your workload shows its metrics.

interface.path

The web path where your workload shows its metrics, such as /metrics.

interface.scheme

Whether Prometheus reads the metrics over http or https.

Allowed values for interface.scheme
ValueDescription
httpRead the metrics over plain HTTP.
httpsRead the metrics over HTTPS.