Skip to content

stackstate-lab/static-topology-dsl-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackState Static Topology DSL

Overview

StackState Static Topology DSL allows you to easily define components, relations, events and health in .topo files using a Topology Language.

Example Topo file

The topology can be sent to the StackState server via a CLI or configured as an Agent Check.

See documentation for more information.

Development

Prerequisites:

Topology grammar

The Topology language is defined in topology.tx using Textx meta-language

Visualization of the model topoloy.topo

Visualization of the model

Syntax Highlighting

For VSCode, copy ./grammar/topo-vscode to ~/.vscode/extensions

For Intellij import the ./grammar/topo-tmbundle. See Textmate Bundles

Quick-Start for stsdev

stsdev is a tool to aid with the development StackState Agent integrations.

Managing dependencies

Poetry is used as the packaging and dependency management system.

Dependencies for your project can be managed through poetry add or poetry add -D for development dependency.

$ poetry add PyYAML

###Build the project To build the project,

$ stsdev build --no-run-tests

This will automatically run code formatting, linting, tests and finally the build.

###Unit Testing To run tests in the project,

$ stsdev test

This will automatically run code formatting, linting, and tests.

###Dry-run a check

A check can be dry-run inside the StackState Agent by running

$ sudo -u stackstate-agent check xxx

stsdev makes this take simple by packaging your checks and running the agent check using docker.

$ stsdev agent check static_topology_dsl

Before running the command, remember to copy the example conf tests/resources/conf.d/static_topology_dsl.d/conf.yaml.example to tests/resources/conf.d/static_topology_dsl.d/conf.yaml.

###Running checks in the Agent

Starts the StackState Agent in the foreground using the test configuration tests/resources/conf.d

$ stsdev agent run

Packaging checks

$  stsdev package --no-run-tests

This will automatically run code formatting, linting, tests and finally the packaging. A zip file is created in the dist directory. Copy this to the host running the agent and unzip it. Run the install.sh.

About

A tool that allows you to easily define StackState topology using a Topology Language.

Resources

Stars

Watchers

Forks

Contributors

Languages