Skip to content

Zenmo/opentelemetry-anylogic-processor

Repository files navigation

OpenTelemetry AnyLogic processor

This is a log processor which enriches logs of the AnyLogic Cloud Executor with information about the AnyLogic model, such as the name and version.

Development

Building the collector

This project is built using the OpenTelemetry Collector Builder (ocb). See Build your own collector.

To build run:

./ocb --config builder-config.yaml

This will create the otelcol-anylogic binary in the build/ directory.

Running

  1. Edit/copy the config.yaml file.
  2. Run the collector:
./build/otelcol-anylogic --config=config.yaml

This will tail logs from the ./testlogs/ directory.

Deployment

  1. Copy the config.yaml to config.production.yaml and adjust it to your needs.
  2. Build and push the container image:
podman build --tag ghcr.io/zenmo/otelcol-anylogic:latest .
podman push ghcr.io/zenmo/otelcol-anylogic:latest
  1. In /home/alcadm/alc/controller/applications.json, change the configuration of the AnyLogic executor to mount a directory to write logs to:
{
  "name": "executor",
  "volumes": [
    {
      "host": "executor/log",
      "container": "/var/log/executor"
    }
  ]
}
  1. Restart the executor.
docker stop executor \
    && docker rm executor \
    && docker restart controller
  1. Run the otelcol container on the AnyLogic private cloud instance, mounting the same log directory:
docker pull ghcr.io/zenmo/otelcol-anylogic:latest
docker stop otelcol
docker rm otelcol
docker run \
    --env ANYLOGIC_API_KEY=00000000-0000-0000-0000-000000000000 \
    --detach \
    --name otelcol \
    --volume /home/alcadm/alc/cache/executor/log:/var/log/executor \
    --restart unless-stopped \
    ghcr.io/zenmo/otelcol-anylogic:latest

About

Log processor for AnyLogic Cloud model runs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published