Forge documentation
Library referenceKotlin

com.l1fe.forge:forge-telemetry

Kotlin/JVM forge-telemetry module.

Kotlin/JVM forge-telemetry module.

Package contract

FieldValue
Languagekotlin
Source version0.1.0
Manifestforge-kt/forge-telemetry/build.gradle.kts
Source files4
EvidenceSource reference; registry publication and runtime conformance are separate checks

Import boundary

import com.l1fe.forge.telemetry.*

Use a source checkout or your verified private registry. Manifest coordinates identify the package; they do not establish that a public registry release exists.

Source reference

Download package reference JSON. Each original source file and generated declaration artifact has its own SHA-256 digest. Function bodies and constant values are omitted from downloads. These are source declaration inventories, not compiler-resolved rustdoc, TypeDoc, DocC, or Dokka output. Private modules can contain public declarations that are not reachable through the package boundary; consult the entry point before importing.

com/l1fe/forge/telemetry/AuditTrail.kt

Read declaration text · 11 declaration entries

public enum class AuditEntryType

public data class AuditEntry(
val id: String,
val type: AuditEntryType,
@SerialName("agent_did")
val agentDid: String,
val description: String,
val metadata: Map<String, String>;

public class AuditTrail(
private val agentDid: String,
)

public fun record(
type: AuditEntryType,
description: String,
metadata: Map<String, String>;

public fun recordLifecycleTransition(
fromState: String,
toState: String,
reason: String,
): AuditEntry;

public fun recordToolInvocation(
toolName: String,
tier: String,
success: Boolean,
): AuditEntry;

public fun recordCapabilityCheck(
capability: String,
granted: Boolean,
actId: String;

public fun allEntries(): List<AuditEntry>;

public fun entriesByType(type: AuditEntryType): List<AuditEntry> =

public fun size(): Int;

public fun recent(count: Int): List<AuditEntry> =

com/l1fe/forge/telemetry/SpanCollector.kt

Read declaration text · 9 declaration entries

public data class MetricPoint(
val name: String,
val value: Double,
val attributes: Map<String, SpanAttribute>;

public class InMemorySpanCollector(
private val maxSpans: Int;

public fun spans(): List<ForgeSpan>;

public fun events(): List<ForgeEvent>;

public fun metrics(): List<MetricPoint>;

public fun spansByName(namePrefix: String): List<ForgeSpan> =

public fun spanCount(): Int;

public fun eventCount(): Int;

public fun clear()

com/l1fe/forge/telemetry/TelemetryContract.kt

Read declaration text · 7 declaration entries

public interface TelemetryCollector

public fun recordSpan(span: ForgeSpan)

/**
* Record a telemetry event.
*
* ANVIL Spec Section 12.4
*
* @param event The event to record.
*/
public fun recordEvent(event: ForgeEvent)

/**
* Record a metric data point.
*
* ANVIL Spec Section 12.7 -- Metrics
*
* @param name The metric name (e.g., "forge.agent.tool_invocations").
* @param value The metric value.
* @param attributes Optional attributes for dimensional querying.
*/
public fun recordMetric(
name: String,
value: Double,
attributes: Map<String, SpanAttribute>;

public fun recordEvent(event: ForgeEvent)

/**
* Record a metric data point.
*
* ANVIL Spec Section 12.7 -- Metrics
*
* @param name The metric name (e.g., "forge.agent.tool_invocations").
* @param value The metric value.
* @param attributes Optional attributes for dimensional querying.
*/
public fun recordMetric(
name: String,
value: Double,
attributes: Map<String, SpanAttribute>;

public fun recordMetric(
name: String,
value: Double,
attributes: Map<String, SpanAttribute>;

public fun flush(timeoutMs: Long;

public fun shutdown()
}

/**
* A telemetry collector that discards all data.
*
* Used as the default when no telemetry backend is configured.
*
* ANVIL Spec Section 12.5
*/
public object NoopCollector : TelemetryCollector

public object NoopCollector : TelemetryCollector

com/l1fe/forge/telemetry/TelemetryError.kt

Read declaration text · 14 declaration entries

public sealed class ForgeTelemetryError(
message: String,
cause: Throwable?;

public class SpanError(
public val spanName: String,
public val reason: String,
) : ForgeTelemetryError(
"telemetry span '$spanName' error: $reason (see ANVIL Spec SS12.3)"
)

/**
* The audit trail could not be written.
*
* ANVIL Spec Section 12.6 -- Audit Trail
*
* @property entryType The type of audit entry that failed.
* @property reason The failure reason.
*/
public class AuditWriteFailed(
public val entryType: String,
public val reason: String,
cause: Throwable?;

public val spanName: String,
public val reason: String,
) : ForgeTelemetryError(
"telemetry span '$spanName' error: $reason (see ANVIL Spec SS12.3)"
)

/**
* The audit trail could not be written.
*
* ANVIL Spec Section 12.6 -- Audit Trail
*
* @property entryType The type of audit entry that failed.
* @property reason The failure reason.
*/
public class AuditWriteFailed(
public val entryType: String,
public val reason: String,
cause: Throwable?;

public val reason: String,
) : ForgeTelemetryError(
"telemetry span '$spanName' error: $reason (see ANVIL Spec SS12.3)"
)

/**
* The audit trail could not be written.
*
* ANVIL Spec Section 12.6 -- Audit Trail
*
* @property entryType The type of audit entry that failed.
* @property reason The failure reason.
*/
public class AuditWriteFailed(
public val entryType: String,
public val reason: String,
cause: Throwable?;

public class AuditWriteFailed(
public val entryType: String,
public val reason: String,
cause: Throwable?;

public val entryType: String,
public val reason: String,
cause: Throwable?;

public val reason: String,
cause: Throwable?;

public class ExportFailed(
public val backend: String,
public val reason: String,
cause: Throwable?;

public val backend: String,
public val reason: String,
cause: Throwable?;

public val reason: String,
cause: Throwable?;

public class CapacityExceeded(
public val collectorName: String,
public val currentSize: Int,
public val maxSize: Int,
) : ForgeTelemetryError(
"telemetry collector '$collectorName' capacity exceeded: " +
"$currentSize items (max $maxSize)"
)
}

public val collectorName: String,
public val currentSize: Int,
public val maxSize: Int,
) : ForgeTelemetryError(
"telemetry collector '$collectorName' capacity exceeded: " +
"$currentSize items (max $maxSize)"
)
}

public val currentSize: Int,
public val maxSize: Int,
) : ForgeTelemetryError(
"telemetry collector '$collectorName' capacity exceeded: " +
"$currentSize items (max $maxSize)"
)
}

public val maxSize: Int,
) : ForgeTelemetryError(
"telemetry collector '$collectorName' capacity exceeded: " +
"$currentSize items (max $maxSize)"
)
}

Continue

On this page