Skip to content

CarlDownsOracle/oci-opentelemetry

Repository files navigation

Oracle Cloud Infrastructure OpenTelemetry Integration


Overview

Let's take a look at bringing Oracle Cloud Infrastructure (OCI)’s rich observability data to OpenTelemetry-compatible 3rd party systems.

The function samples contained in this repo show how to perform simple JSON-to-JSON transformation of the OCI log and metric events to OpenTelemetry's API contract. Transformed messages are then sent to an OTEL Collector.

Here are the sample functions for sending logs and metrics ... and a sample function showing how to include OCI tags with your payloads.

Here are some useful OpenTelemetry resources:


OTEL Collector


Setting up OTEL Collector Testbed

WARNING: These instructions are NOT suitable for production environments!

Provision OCI VCN & Compute Node

You will need a VCN and a Compute node. Create a new VCN ... or use the VCN your Functions will be using. NOTE: Be sure to add a VCN security list Ingress Rule to allow traffic to pass from the Functions to your Compute node. The remainder of this README assumes you have provisioned an Oracle 8 Linux Compute node with an ssh public key.

Install Docker (Compose) on Oracle 8

I recommend following Kyle Schwartz's excellent article to Install Docker (Compose) on Oracle Linux 8 on your Compute node.

Configure, start and test the Collector

Copy the docker-compose.yaml file found in the Install the Collector docs to your Compute node. Copy otel-collector-config.yaml to your node. This configuration enables HTTP protocol ... a must have ... otherwise the Functions will NOT work.

Start the Collector

sudo docker-compose up -d
sudo docker-compose logs

Test the Collector's HTTP Protocol Locally

To test locally (where the OTEL Collector is running), you can copy this example metrics.json file to that node and then perform an HTTP post using curl:

curl -X POST -H "Content-Type: application/json" -d @metrics.json -i localhost:4318/v1/metrics

Logging can be tested as well with logs.json:

curl -X POST -H "Content-Type: application/json" -d @logs.json -i localhost:4318/v1/logs

View docker-compose logs:

sudo docker-compose logs

If the logs and metrics are shown, your Testbed OTEL Collector is ready to receive HTTP POST's from OCI Functions.

About

Sample code showing how to export OCI cloud-native logs and metrics to the OpenTelemetry world

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages