---
name: otel-tracing-8864a600f4d1
description: OpenTelemetry tracing for agent observations and SPI verification
version: 1.0.0
---

# OpenTelemetry Tracing Skill

**Trit**: -1 (VALIDATOR)
**Bundle**: infrastructure
**Role**: Verification of execution traces and distributed contexts.

## Overview

This skill provides a standard interface for emitting OpenTelemetry spans from agent actions. It is crucial for:
1.  **SPI Verification**: Tracing execution paths to ensure determinism.
2.  **Debugging**: Visualizing distributed agent interactions.
3.  **Performance**: Measuring latency in ACSet bridge operations.

## Integration

### Python

```python
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor

def init_tracer(service_name="agent-skill"):
    provider = TracerProvider()
    processor = SimpleSpanProcessor(ConsoleSpanExporter())
    provider.add_span_processor(processor)
    trace.set_tracer_provider(provider)
    return trace.get_tracer(service_name)

tracer = init_tracer()

with tracer.start_as_current_span("agent_action") as span:
    span.set_attribute("agent.trit", -1)
    span.set_attribute("agent.id", "minus_validator")
    # ... perform action ...
```

## SPI Verification Pattern

To verify Strong Parallelism Invariance (SPI), traces must be deterministic given a seed.

```python
def verify_spi_trace(seed, trace_id):
    expected_hash = compute_spi_hash(seed)
    actual_hash = hash(trace_id)
    assert expected_hash == actual_hash
```

## Neo4j Mapping

*   **Nodes**: `Span`, `Trace`
*   **Relationships**: `PARENT_OF`, `NEXT_SIBLING`
*   **Properties**: `start_time`, `end_time`, `attributes` (JSON)

## Commands

*   `trace-agent <agent_id>`: Start a trace for an agent.
*   `export-traces`: Dump traces to JSON.


---
Source attribution: plurigrid
Original project: https://github.com/plurigrid/asi/blob/293ce9f76e3abcd5ba18db284688bc0d9ac6691d/skills/otel-tracing/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 SkillCreator.ai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: plurigrid
Original project: https://github.com/plurigrid/asi/blob/293ce9f76e3abcd5ba18db284688bc0d9ac6691d/skills/otel-tracing/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Data Engineer, DevOps / SRE, ML / AI Engineer
Specialties: API, Backend
Tools: Opentelemetry
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 4469a33ff87f8db247ebf05fd02202e2395bd8ab7085847f50b7b38f1c328cef
