diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml b/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml index 7200e67713..ff3c57fe7f 100644 --- a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml +++ b/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.filesystem.file.not.found - message: FILE_NOT_FOUND asyncapi/kafka.yaml + name: CATALOG_FILESYSTEM_FILE_NOT_FOUND + message: Unable to find file at (asyncapi/kafka.yaml) on the host filesystem. catalogs: catalog0: type: filesystem diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java index 1a64df8309..527bde24d8 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java +++ b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java @@ -25,10 +25,8 @@ public final class FilesystemEventFormatter implements EventFormatterSpi { - private static final String FILE_NOT_FOUND = "FILE_NOT_FOUND %s"; - private final EventFW eventRO = new EventFW(); - private final FilesystemEventExFW schemaRegistryEventExRO = new FilesystemEventExFW(); + private final FilesystemEventExFW filesystemEventExRO = new FilesystemEventExFW(); FilesystemEventFormatter( Configuration config) @@ -41,7 +39,7 @@ public String format( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); - final FilesystemEventExFW extension = schemaRegistryEventExRO + final FilesystemEventExFW extension = filesystemEventExRO .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); String result = null; switch (extension.kind()) @@ -49,7 +47,7 @@ public String format( case FILE_NOT_FOUND: { FilesystemFileNotFoundExFW ex = extension.fileNotFound(); - result = String.format(FILE_NOT_FOUND, asString(ex.location())); + result = String.format("Unable to find file at (%s) on the host filesystem.", asString(ex.location())); break; } } diff --git a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java index 175b20f3cf..a2e35d4ca8 100644 --- a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java +++ b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java @@ -263,6 +263,13 @@ public int supplyEventId( return 0; } + @Override + public String supplyEventName( + int eventId) + { + return ""; + } + @Override public BindingHandler streamFactory() { diff --git a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java index 221b3097a8..9ffb72a313 100644 --- a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java +++ b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java @@ -26,8 +26,6 @@ public final class HttpEventFormatter implements EventFormatterSpi { - private static final String REQUEST_ACCEPTED_FORMAT = "REQUEST_ACCEPTED %s %s %s %s %s"; - private final EventFW eventRO = new EventFW(); private final HttpEventExFW httpEventExRO = new HttpEventExFW(); @@ -50,7 +48,7 @@ public String format( case REQUEST_ACCEPTED: { HttpRequestAcceptedExFW ex = extension.requestAccepted(); - result = String.format(REQUEST_ACCEPTED_FORMAT, identity(ex.identity()), asString(ex.scheme()), asString(ex.method()), + result = String.format("%s %s %s://%s%s", identity(ex.identity()), asString(ex.method()), asString(ex.scheme()), asString(ex.authority()), asString(ex.path())); break; } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java index 515aa6f08e..4e6bd691ff 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java @@ -27,9 +27,6 @@ public final class KafkaEventFormatter implements EventFormatterSpi { - private static final String AUTHORIZATION_FAILED_FORMAT = "AUTHORIZATION_FAILED %s"; - private static final String API_VERSION_REJECTED_FORMAT = "API_VERSION_REJECTED %d %d"; - private final EventFW eventRO = new EventFW(); private final KafkaEventExFW kafkaEventExRO = new KafkaEventExFW(); @@ -52,22 +49,22 @@ public String format( case AUTHORIZATION_FAILED: { KafkaAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format(AUTHORIZATION_FAILED_FORMAT, identity(ex.identity())); + result = String.format("Unable to authenticate client with identity (%s).", asString(ex.identity())); break; } case API_VERSION_REJECTED: { final KafkaApiVersionRejectedExFW ex = extension.apiVersionRejected(); - result = String.format(API_VERSION_REJECTED_FORMAT, ex.apiKey(), ex.apiVersion()); + result = String.format("%d %d", ex.apiKey(), ex.apiVersion()); } } return result; } - private static String identity( - StringFW identity) + private static String asString( + StringFW stringFW) { - int length = identity.length(); - return length <= 0 ? "-" : identity.asString(); + String s = stringFW.asString(); + return s == null ? "" : s; } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java index f62228de03..28c595dcd0 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java @@ -53,13 +53,13 @@ public MqttKafkaEventContext( public void onMqttConnectionReset( long traceId, long bindingId, - String16FW reason) + String16FW topic) { MqttKafkaEventExFW extension = mqttKafkaEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .nonCompactSessionsTopic(e -> e .typeId(NON_COMPACT_SESSIONS_TOPIC.value()) - .reason(reason)) + .topic(topic)) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java index 8c66ebbe31..d8163664fd 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java @@ -19,14 +19,12 @@ import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.EventFW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaEventExFW; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaResetMqttConnectionExFW; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaNonCompactSessionsTopicExFW; import io.aklivity.zilla.runtime.engine.Configuration; import io.aklivity.zilla.runtime.engine.event.EventFormatterSpi; public final class MqttKafkaEventFormatter implements EventFormatterSpi { - private static final String NON_COMPACT_SESSIONS_TOPIC_FORMAT = "NON COMPACT SESSIONS TOPIC - %s"; - private final EventFW eventRO = new EventFW(); private final MqttKafkaEventExFW mqttKafkaEventExRO = new MqttKafkaEventExFW(); @@ -48,8 +46,11 @@ public String format( { case NON_COMPACT_SESSIONS_TOPIC: { - MqttKafkaResetMqttConnectionExFW ex = extension.nonCompactSessionsTopic(); - result = String.format(NON_COMPACT_SESSIONS_TOPIC_FORMAT, asString(ex.reason())); + MqttKafkaNonCompactSessionsTopicExFW ex = extension.nonCompactSessionsTopic(); + result = String.format( + "The sessions topic (%s) is not log compacted. Update the cleanup policy to enable log compaction.", + asString(ex.topic()) + ); break; } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java index 990ab929e2..a1332e9e10 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java @@ -170,7 +170,6 @@ public class MqttKafkaSessionFactory implements MqttKafkaStreamFactory public static final int MQTT_NOT_AUTHORIZED = 0x87; public static final int MQTT_IMPLEMENTATION_SPECIFIC_ERROR = 0x83; public static final String MQTT_INVALID_SESSION_TIMEOUT_REASON = "Invalid session expiry interval"; - public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("Sessions Kafka topic in non-compacted"); private static final KafkaConfigFW CONFIG_COMPACT_CLEANUP_POLICY = new KafkaConfigFW.Builder() .wrap(new UnsafeBuffer(new byte[25]), 0, 25) .name("cleanup.policy") @@ -3469,7 +3468,7 @@ protected void onKafkaBegin( .build(); delegate.doMqttWindow(authorization, traceId, 0, 0, 0); delegate.doMqttReset(traceId, mqttResetEx); - events.onMqttConnectionReset(traceId, routedId, MQTT_NON_COMPACT_SESSIONS_TOPIC); + events.onMqttConnectionReset(traceId, routedId, delegate.sessionsTopic); doKafkaWindow(traceId, authorization, 0, 0, 0, 0, 0); doKafkaAbort(traceId, authorization); break onKafkaBegin; diff --git a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java index ba102af34c..a1447176d7 100644 --- a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java +++ b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java @@ -26,8 +26,6 @@ public final class MqttEventFormatter implements EventFormatterSpi { - private static final String CLIENT_CONNECTED_FORMAT = "CLIENT_CONNECTED %s %s"; - private final EventFW eventRO = new EventFW(); private final MqttEventExFW mqttEventExRO = new MqttEventExFW(); @@ -50,7 +48,10 @@ public String format( case CLIENT_CONNECTED: { MqttClientConnectedExFW ex = extension.clientConnected(); - result = String.format(CLIENT_CONNECTED_FORMAT, identity(ex.identity()), asString(ex.clientId())); + result = String.format("Session authorization (%s) was successful for client id (%s).", + identity(ex.identity()), + asString(ex.clientId()) + ); break; } } diff --git a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java index 5fd1716db2..8ac83a0afe 100644 --- a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java +++ b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java @@ -26,8 +26,6 @@ public final class TcpEventFormatter implements EventFormatterSpi { - private static final String DNS_FAILED_FORMAT = "DNS_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final TcpEventExFW tcpEventExRO = new TcpEventExFW(); @@ -50,7 +48,7 @@ public String format( case DNS_FAILED: { final TcpDnsFailedExFW ex = extension.dnsFailed(); - result = String.format(DNS_FAILED_FORMAT, asString(ex.address())); + result = String.format("Unable to resolve host dns for address (%s).", asString(ex.address())); break; } } diff --git a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java index 49a03c9cb5..992946d7f6 100644 --- a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java +++ b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java @@ -24,12 +24,6 @@ public final class TlsEventFormatter implements EventFormatterSpi { - private static final String TLS_FAILED_FORMAT = "TLS_FAILED"; - private static final String PROTOCOL_REJECTED_FORMAT = "PROTOCOL_REJECTED"; - private static final String KEY_REJECTED_FORMAT = "KEY_REJECTED"; - private static final String PEER_NOT_VERIFIED_FORMAT = "PEER_NOT_VERIFIED"; - private static final String HANDSHAKE_FAILED_FORMAT = "HANDSHAKE_FAILED"; - private final EventFW eventRO = new EventFW(); private final TlsEventExFW tlsEventExRO = new TlsEventExFW(); @@ -51,27 +45,27 @@ public String format( { case TLS_FAILED: { - result = TLS_FAILED_FORMAT; + result = "There was a generic error detected by an SSL subsystem."; break; } case TLS_PROTOCOL_REJECTED: { - result = PROTOCOL_REJECTED_FORMAT; + result = "There was an error in the operation of the SSL protocol."; break; } case TLS_KEY_REJECTED: { - result = KEY_REJECTED_FORMAT; + result = "Bad SSL key due to misconfiguration of the server or client SSL certificate and private key."; break; } case TLS_PEER_NOT_VERIFIED: { - result = PEER_NOT_VERIFIED_FORMAT; + result = "The peer's identity could not be verified."; break; } case TLS_HANDSHAKE_FAILED: { - result = HANDSHAKE_FAILED_FORMAT; + result = "The client and server could not negotiate the desired level of security."; break; } } diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java index 8f0ad77e20..308cdd011d 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java @@ -331,6 +331,13 @@ public int supplyEventId( return 0; } + @Override + public String supplyEventName( + int eventId) + { + return ""; + } + @Override public BindingHandler streamFactory() { diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java index 85553059b8..91f2f3be23 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java @@ -44,7 +44,7 @@ public class ApicurioEventContext private final int staleArtifactID; private final int unretrievableArtifactId; private final int retrievableArtifactSubjectVersionId; - private final int retrievableArtifactId; + private final int retrievedArtifactId; private final MessageConsumer eventWriter; private final Clock clock; @@ -57,8 +57,8 @@ public ApicurioEventContext( this.staleArtifactID = context.supplyEventId("catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact"); this.unretrievableArtifactId = context.supplyEventId("catalog.apicurio.unretrievable.artifact.id"); this.retrievableArtifactSubjectVersionId = context.supplyEventId( - "catalog.apicurio.retrievable.artifact.subject.version"); - this.retrievableArtifactId = context.supplyEventId("catalog.apicurio.retrievable.artifact.id"); + "catalog.apicurio.retrieved.artifact.subject.version"); + this.retrievedArtifactId = context.supplyEventId("catalog.apicurio.retrieved.artifact.id"); this.eventWriter = context.supplyEventWriter(); this.clock = context.clock(); } @@ -142,7 +142,7 @@ public void onRetrievableArtifactSubjectVersion( { ApicurioEventExFW extension = apicurioEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableArtifactSubjectVersion(e -> e + .retrievedArtifactSubjectVersion(e -> e .typeId(RETRIEVED_ARTIFACT_SUBJECT_VERSION.value()) .subject(subject) .version(version) @@ -165,14 +165,14 @@ public void onRetrievableArtifactId( { ApicurioEventExFW extension = apicurioEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableArtifactId(e -> e + .retrievedArtifactId(e -> e .typeId(RETRIEVED_ARTIFACT_ID.value()) .artifactId(artifactId) ) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) - .id(retrievableArtifactId) + .id(retrievedArtifactId) .timestamp(clock.millis()) .traceId(0L) .namespacedId(catalogId) diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java index 83947114e7..319d9d1d95 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java @@ -18,8 +18,8 @@ import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.StringFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioEventExFW; -import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievableArtifactIdExFW; -import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievableArtifactSubjectVersionExFW; +import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievedArtifactIdExFW; +import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievedArtifactSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactIdExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW; @@ -29,13 +29,6 @@ public final class ApicurioEventFormatter implements EventFormatterSpi { - private static final String UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION = "UNRETRIEVABLE_ARTIFACT %s %s"; - private static final String UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT = - "UNRETRIEVABLE_ARTIFACT %s %s, USING_STALE_ARTIFACT %d"; - private static final String UNRETRIEVABLE_ARTIFACT_ID = "UNRETRIEVABLE_ARTIFACT_ID %d"; - private static final String RETRIEVED_ARTIFACT_SUBJECT_VERSION = "RETRIEVED_ARTIFACT_SUBJECT_VERSION %s %s"; - private static final String RETRIEVED_ARTIFACT_ID = "RETRIEVED_ARTIFACT_ID %d"; - private final EventFW eventRO = new EventFW(); private final ApicurioEventExFW schemaRegistryEventExRO = new ApicurioEventExFW(); @@ -58,33 +51,44 @@ public String format( case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: { ApicurioUnretrievableArtifactSubjectVersionExFW ex = extension.unretrievableArtifactSubjectVersion(); - result = String.format(UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format( + "Unable to fetch artifact for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: { ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW ex = extension .unretrievableArtifactSubjectVersionStaleArtifact(); - result = String.format(UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT, asString(ex.subject()), - asString(ex.version()), ex.artifactId()); + result = String.format( + "Unable to fetch artifact for subject %s with version %s; using stale artifact with id %d.", + asString(ex.subject()), + asString(ex.version()), + ex.artifactId() + ); break; } case UNRETRIEVABLE_ARTIFACT_ID: { ApicurioUnretrievableArtifactIdExFW ex = extension.unretrievableArtifactId(); - result = String.format(UNRETRIEVABLE_ARTIFACT_ID, ex.artifactId()); + result = String.format("Unable to fetch artifact id %d.", ex.artifactId()); break; } case RETRIEVED_ARTIFACT_SUBJECT_VERSION: { - ApicurioRetrievableArtifactSubjectVersionExFW ex = extension.retrievableArtifactSubjectVersion(); - result = String.format(RETRIEVED_ARTIFACT_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + ApicurioRetrievedArtifactSubjectVersionExFW ex = extension.retrievedArtifactSubjectVersion(); + result = String.format("Successfully fetched artifact for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case RETRIEVED_ARTIFACT_ID: { - ApicurioRetrievableArtifactIdExFW ex = extension.retrievableArtifactId(); - result = String.format(RETRIEVED_ARTIFACT_ID, ex.artifactId()); + ApicurioRetrievedArtifactIdExFW ex = extension.retrievedArtifactId(); + result = String.format("Successfully fetched artifact id %d.", ex.artifactId()); break; } } diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java index 74c78934b8..e6cee3bcd5 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java @@ -44,7 +44,7 @@ public class KarapaceEventContext private final int staleSchemaID; private final int unretrievableSchemaId; private final int retrievableSchemaSubjectVersionId; - private final int retrievableSchemaId; + private final int retrievedSchemaId; private final MessageConsumer eventWriter; private final Clock clock; @@ -55,8 +55,8 @@ public KarapaceEventContext( this.unretrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.unretrievable.schema.subject.version"); this.staleSchemaID = context.supplyEventId("catalog.karapace.unretrievable.schema.subject.version.stale.schema"); this.unretrievableSchemaId = context.supplyEventId("catalog.karapace.unretrievable.schema.id"); - this.retrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.retrievable.schema.subject.version"); - this.retrievableSchemaId = context.supplyEventId("catalog.karapace.retrievable.schema.id"); + this.retrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.retrieved.schema.subject.version"); + this.retrievedSchemaId = context.supplyEventId("catalog.karapace.retrieved.schema.id"); this.eventWriter = context.supplyEventWriter(); this.clock = context.clock(); } @@ -140,7 +140,7 @@ public void onRetrievableSchemaSubjectVersion( { KarapaceEventExFW extension = karapaceEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableSchemaSubjectVersion(e -> e + .retrievedSchemaSubjectVersion(e -> e .typeId(RETRIEVED_SCHEMA_SUBJECT_VERSION.value()) .subject(subject) .version(version) @@ -163,14 +163,14 @@ public void onRetrievableSchemaId( { KarapaceEventExFW extension = karapaceEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableSchemaId(e -> e + .retrievedSchemaId(e -> e .typeId(RETRIEVED_SCHEMA_ID.value()) .schemaId(schemaId) ) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) - .id(retrievableSchemaId) + .id(retrievedSchemaId) .timestamp(clock.millis()) .traceId(0L) .namespacedId(catalogId) diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java index 8c342dd962..2447bcb963 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java @@ -19,8 +19,8 @@ import io.aklivity.zilla.runtime.catalog.karapace.internal.types.StringFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.EventFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceEventExFW; -import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievableSchemaIdExFW; -import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievableSchemaSubjectVersionExFW; +import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievedSchemaIdExFW; +import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievedSchemaSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaIdExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW; @@ -29,13 +29,6 @@ public final class KarapaceEventFormatter implements EventFormatterSpi { - private static final String UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION = "UNRETRIEVABLE_SCHEMA %s %s"; - private static final String UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA = - "UNRETRIEVABLE_SCHEMA %s %s, USING_STALE_SCHEMA %d"; - private static final String UNRETRIEVABLE_SCHEMA_ID = "UNRETRIEVABLE_SCHEMA_ID %d"; - private static final String RETRIEVED_SCHEMA_SUBJECT_VERSION = "RETRIEVED_SCHEMA_SUBJECT_VERSION %s %s"; - private static final String RETRIEVED_SCHEMA_ID = "RETRIEVED_SCHEMA_ID %d"; - private final EventFW eventRO = new EventFW(); private final KarapaceEventExFW karapaceEventExRO = new KarapaceEventExFW(); @@ -58,33 +51,44 @@ public String format( case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: { KarapaceUnretrievableSchemaSubjectVersionExFW ex = extension.unretrievableSchemaSubjectVersion(); - result = String.format(UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format( + "Unable to fetch schema for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: { KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW ex = extension .unretrievableSchemaSubjectVersionStaleSchema(); - result = String.format(UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA, asString(ex.subject()), - asString(ex.version()), ex.schemaId()); + result = String.format( + "Unable to fetch schema for subject %s with version %s; using stale schema with id %d.", + asString(ex.subject()), + asString(ex.version()), + ex.schemaId() + ); break; } case UNRETRIEVABLE_SCHEMA_ID: { KarapaceUnretrievableSchemaIdExFW ex = extension.unretrievableSchemaId(); - result = String.format(UNRETRIEVABLE_SCHEMA_ID, ex.schemaId()); + result = String.format("Unable to fetch schema id %d.", ex.schemaId()); break; } case RETRIEVED_SCHEMA_SUBJECT_VERSION: { - KarapaceRetrievableSchemaSubjectVersionExFW ex = extension.retrievableSchemaSubjectVersion(); - result = String.format(RETRIEVED_SCHEMA_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + KarapaceRetrievedSchemaSubjectVersionExFW ex = extension.retrievedSchemaSubjectVersion(); + result = String.format("Successfully fetched schema for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case RETRIEVED_SCHEMA_ID: { - KarapaceRetrievableSchemaIdExFW ex = extension.retrievableSchemaId(); - result = String.format(RETRIEVED_SCHEMA_ID, ex.schemaId()); + KarapaceRetrievedSchemaIdExFW ex = extension.retrievedSchemaId(); + result = String.format("Successfully fetched schema id %d.", ex.schemaId()); break; } } diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java index 15628a3b60..3c6f81931e 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java @@ -134,6 +134,9 @@ String supplyQName( int supplyEventId( String name); + String supplyEventName( + int eventId); + BindingHandler streamFactory(); GuardHandler supplyGuard( diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java index 0d535e2d8a..bc4b731109 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java @@ -224,6 +224,7 @@ public class EngineWorker implements EngineContext, Agent private final ScalarsLayout gaugesLayout; private final HistogramsLayout histogramsLayout; private final EventsLayout eventsLayout; + private final Int2ObjectHashMap eventNames; private final Supplier supplyEventReader; private final EventFormatterFactory eventFormatterFactory; @@ -311,6 +312,7 @@ public EngineWorker( .path(config.directory().resolve(String.format("events%d", index))) .capacity(config.eventsBufferCapacity()) .build(); + this.eventNames = new Int2ObjectHashMap<>(); this.agentName = String.format("engine/data#%d", index); this.streamsLayout = streamsLayout; @@ -485,6 +487,13 @@ public int supplyEventId( return labels.supplyLabelId(name); } + @Override + public String supplyEventName( + int eventId) + { + return eventNames.computeIfAbsent(eventId, this::computeEventName); + } + @Override public int supplyTypeId( String name) @@ -1733,6 +1742,12 @@ public EventFormatter supplyEventFormatter() return eventFormatterFactory.create(config, this); } + private String computeEventName( + int eventId) + { + return supplyLocalName(eventId).replace('.', '_').toUpperCase(); + } + private MessageConsumer supplyWriter( int index) { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java index 1588e9ab43..2dc8dd772b 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java @@ -70,14 +70,15 @@ private void handleEvent( final EventFW event = eventRO.wrap(buffer, index, index + length); String qname = context.supplyQName(event.namespacedId()); String id = context.supplyLocalName(event.id()); + String name = context.supplyEventName(event.id()); String message = formatter.format(msgTypeId, buffer, index, length); if (options.events != null && eventIndex < options.events.size()) { TestExporterOptionsConfig.Event e = options.events.get(eventIndex); - if (!qname.equals(e.qName) || !id.equals(e.id) || !message.equals(e.message)) + if (!qname.equals(e.qName) || !id.equals(e.id) || !name.equals(e.name) || !message.equals(e.message)) { - throw new IllegalStateException(String.format("event mismatch, expected: %s %s %s, got: %s %s %s", - e.qName, e.id, e.message, qname, id, message)); + throw new IllegalStateException(String.format("event mismatch, expected: %s %s %s %s, got: %s %s %s %s", + e.qName, e.id, e.name, e.message, qname, id, name, message)); } eventIndex++; } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java index ac572a23cc..d148044b07 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java @@ -48,15 +48,18 @@ public static final class Event { public final String qName; public final String id; + public final String name; public final String message; public Event( - String qName, - String id, - String message) + String qName, + String id, + String name, + String message) { this.qName = qName; this.id = id; + this.name = name; this.message = message; } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java index 2af4e8fdf4..5c119416df 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java @@ -33,6 +33,7 @@ public final class TestExporterOptionsConfigAdapter implements OptionsConfigAdap private static final String EVENTS_NAME = "events"; private static final String QNAME_NAME = "qname"; private static final String ID_NAME = "id"; + private static final String NAME_NAME = "name"; private static final String MESSAGE_NAME = "message"; @Override @@ -68,6 +69,7 @@ public JsonObject adaptToJson( JsonObjectBuilder event = Json.createObjectBuilder(); event.add(QNAME_NAME, e.qName); event.add(ID_NAME, e.id); + event.add(NAME_NAME, e.name); event.add(MESSAGE_NAME, e.message); events.add(event); } @@ -98,7 +100,12 @@ public OptionsConfig adaptFromJson( JsonObject e0 = e.asJsonObject(); if (e0.containsKey(QNAME_NAME) && e0.containsKey(MESSAGE_NAME)) { - testOptions.event(e0.getString(QNAME_NAME), e0.getString(ID_NAME), e0.getString(MESSAGE_NAME)); + testOptions.event( + e0.getString(QNAME_NAME), + e0.getString(ID_NAME), + e0.getString(NAME_NAME), + e0.getString(MESSAGE_NAME) + ); } } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java index 6b871d36b0..62c9d57776 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java @@ -52,13 +52,14 @@ public TestExporterOptionsConfigBuilder mode( public TestExporterOptionsConfigBuilder event( String qName, String id, + String name, String message) { if (this.events == null) { this.events = new LinkedList<>(); } - this.events.add(new TestExporterOptionsConfig.Event(qName, id, message)); + this.events.add(new TestExporterOptionsConfig.Event(qName, id, name, message)); return this; } diff --git a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java index 38da490ef9..63cc4349e8 100644 --- a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java +++ b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java @@ -76,10 +76,11 @@ private void handleEvent( eventJson.add(TIME_UNIX_NANO, nanos); eventJson.add(OBSERVED_TIME_UNIX_NANO, nanos); String qname = context.supplyQName(event.namespacedId()); + String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); - addBody(qname, extension); eventAttributesJson = Json.createArrayBuilder(); - addStringAttribute("event.name", context.supplyLocalName(event.id())); + addStringAttribute("event.name", eventName); + addBody(qname, extension); eventJson.add(ATTRIBUTES, eventAttributesJson); eventsJson.add(eventJson); } diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java index c7cdec617b..70658d3b58 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java @@ -64,6 +64,12 @@ public String supplyQName( return context.supplyQName(namespacedId); } + public String supplyEventName( + int eventId) + { + return context.supplyEventName(eventId); + } + public EventFormatter supplyEventFormatter() { return context.supplyEventFormatter(); diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java index 1a866e87c2..9d30138409 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java @@ -29,7 +29,8 @@ public class StdoutEventsStream { - private static final String FORMAT = "%s [%s] %s%n"; // qname [timestamp] extension\n + // {zilla namespace}:{component name} [dd/MMM/yyyy:HH:mm:ss Z] {event name} {event body}\n + private static final String FORMAT = "%s [%s] %s %s%n"; private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd/MMM/yyyy:HH:mm:ss Z"); private final StdoutExporterContext context; @@ -61,8 +62,9 @@ private void handleEvent( { final EventFW event = eventRO.wrap(buffer, index, index + length); String qname = context.supplyQName(event.namespacedId()); + String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); - out.format(FORMAT, qname, asDateTime(event.timestamp()), extension); + out.format(FORMAT, qname, asDateTime(event.timestamp()), eventName, extension); } private static String asDateTime( diff --git a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java index c5b019b33e..c2d49a0075 100644 --- a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java +++ b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java @@ -63,6 +63,6 @@ public class EventIT public void shouldLogEvents() throws Exception { k3po.finish(); - output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] test event message\n")); + output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] BINDING_TEST_CONNECTED test event message\n")); } } diff --git a/runtime/guard-jwt/pom.xml b/runtime/guard-jwt/pom.xml index 00df1533ea..876894d746 100644 --- a/runtime/guard-jwt/pom.xml +++ b/runtime/guard-jwt/pom.xml @@ -26,7 +26,7 @@ 11 11 - 0.98 + 0.97 0 diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java index d5c2ec1d04..a42847a34f 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java @@ -52,13 +52,15 @@ public JwtEventContext( public void authorizationFailed( long traceId, long bindingId, - String identity) + String identity, + String reason) { JwtEventExFW extension = jwtEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .authorizationFailed(e -> e .typeId(AUTHORIZATION_FAILED.value()) .identity(identity) + .reason(reason) ) .build(); EventFW event = eventRW diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java index 36282d3a48..32a1c11875 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java @@ -25,8 +25,6 @@ public final class JwtEventFormatter implements EventFormatterSpi { - private static final String AUTHORIZATION_FAILED_FORMAT = "AUTHORIZATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final JwtEventExFW jwtEventExRO = new JwtEventExFW(); @@ -49,17 +47,20 @@ public String format( case AUTHORIZATION_FAILED: { JwtAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format(AUTHORIZATION_FAILED_FORMAT, identity(ex.identity())); + result = String.format("JWT token authorization failed for identity (%s). %s", + asString(ex.identity()), + asString(ex.reason()) + ); break; } } return result; } - private static String identity( - StringFW identity) + private static String asString( + StringFW stringFW) { - int length = identity.length(); - return length <= 0 ? "-" : identity.asString(); + String s = stringFW.asString(); + return s == null ? "" : s; } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java index d166b336c6..50ec6342bb 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java @@ -128,6 +128,7 @@ public long reauthorize( { JwtSession session = null; String subject = null; + String reason = ""; authorize: try @@ -142,6 +143,7 @@ public long reauthorize( key == null || !Objects.equals(alg, key.getAlgorithm())) { + reason = "Invalid alg or key."; break authorize; } @@ -149,6 +151,7 @@ public long reauthorize( signature.setKey(key.getKey()); if (!signature.verifySignature()) { + reason = "Unable to verify key signature."; break authorize; } @@ -162,10 +165,15 @@ public long reauthorize( long now = Instant.now().toEpochMilli(); if (notBefore != null && now < notBefore.getValueInMillis() || - notAfter != null && now > notAfter.getValueInMillis() || - issuer == null || !issuer.equals(this.issuer) || + notAfter != null && now > notAfter.getValueInMillis()) + { + reason = "Token is expired."; + break authorize; + } + if (issuer == null || !issuer.equals(this.issuer) || audience == null || !audience.contains(this.audience)) { + reason = "Invalid issuer or audience."; break authorize; } @@ -191,11 +199,11 @@ public long reauthorize( } catch (JoseException | InvalidJwtException | MalformedClaimException ex) { - // not authorized + reason = ex.getMessage(); } if (session == null) { - event.authorizationFailed(traceId, bindingId, subject); + event.authorizationFailed(traceId, bindingId, subject, reason); } return session != null ? session.authorized : NOT_AUTHORIZED; } diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java index ab60c4de2f..1c65b2bf08 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java @@ -25,10 +25,8 @@ public final class AvroModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); - private final AvroModelEventExFW jsonModelEventExFW = new AvroModelEventExFW(); + private final AvroModelEventExFW avroModelEventExFW = new AvroModelEventExFW(); AvroModelEventFormatter( Configuration config) @@ -41,7 +39,7 @@ public String format( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); - final AvroModelEventExFW extension = jsonModelEventExFW + final AvroModelEventExFW extension = avroModelEventExFW .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); String result = null; switch (extension.kind()) @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { AvroModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java index 36fef012ce..6ca60dbce5 100644 --- a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java +++ b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java @@ -25,8 +25,6 @@ public final class CoreModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final CoreModelEventExFW coreModelEventExFW = new CoreModelEventExFW(); @@ -49,7 +47,10 @@ public String format( case VALIDATION_FAILED: { CoreModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format( + "A message payload failed validation. A field was not the expected type (%s).", + asString(ex.error()) + ); break; } } diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java index c0886ac5c5..a6ad7a690c 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java @@ -25,8 +25,6 @@ public final class JsonModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final JsonModelEventExFW jsonModelEventExFW = new JsonModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { JsonModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java index ea5ee06b61..259b294486 100644 --- a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java @@ -25,8 +25,6 @@ public final class ProtobufModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final ProtobufModelEventExFW protobufModelEventExFW = new ProtobufModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { ProtobufModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml index 8411e8348e..acaf62c8d7 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.http.request.accepted - message: REQUEST_ACCEPTED - http GET localhost:8080 / + name: BINDING_HTTP_REQUEST_ACCEPTED + message: "- GET http://localhost:8080/" bindings: net0: type: http diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml index 0a1cebed55..78534a2dc1 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.http.request.accepted - message: REQUEST_ACCEPTED - http GET localhost:8080 / + name: BINDING_HTTP_REQUEST_ACCEPTED + message: "- GET http://localhost:8080/" bindings: net0: type: http diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml index 1fde456a84..3610b32b36 100644 --- a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.kafka.api.version.rejected - message: API_VERSION_REJECTED 32 0 + name: BINDING_KAFKA_API_VERSION_REJECTED + message: 32 0 bindings: app0: type: kafka diff --git a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl index 5b5cd547f2..ac11492a6b 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl +++ b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl @@ -38,14 +38,14 @@ scope mqtt_kafka NON_COMPACT_SESSIONS_TOPIC (1) } - struct MqttKafkaResetMqttConnectionEx extends core::stream::Extension + struct MqttKafkaNonCompactSessionsTopicEx extends core::stream::Extension { - string16 reason; + string16 topic; } union MqttKafkaEventEx switch (MqttKafkaEventType) { - case NON_COMPACT_SESSIONS_TOPIC: MqttKafkaResetMqttConnectionEx nonCompactSessionsTopic; + case NON_COMPACT_SESSIONS_TOPIC: MqttKafkaNonCompactSessionsTopicEx nonCompactSessionsTopic; } } } \ No newline at end of file diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml index f6c94af5cc..a7c0e1a685 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.kafka0 id: binding.mqtt.kafka.non.compact.sessions.topic - message: NON COMPACT SESSIONS TOPIC - Sessions Kafka topic in non-compacted + name: BINDING_MQTT_KAFKA_NON_COMPACT_SESSIONS_TOPIC + message: The sessions topic (mqtt-sessions) is not log compacted. Update the cleanup policy to enable log compaction. bindings: mqtt0: type: mqtt-kafka diff --git a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml index 53d5edc154..d321882e7e 100644 --- a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml +++ b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.mqtt.client.connected - message: CLIENT_CONNECTED - client + name: BINDING_MQTT_CLIENT_CONNECTED + message: Session authorization (-) was successful for client id (client). bindings: net0: type: mqtt diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml index b789832a1e..42c0cd6156 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.tcp.dns.failed - message: DNS_FAILED localhost + name: BINDING_TCP_DNS_FAILED + message: Unable to resolve host dns for address (localhost). bindings: app0: type: tcp diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml index 0a9021abdb..3476b91ec5 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.tls.handshake.failed - message: HANDSHAKE_FAILED + name: BINDING_TLS_HANDSHAKE_FAILED + message: The client and server could not negotiate the desired level of security. vaults: client: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml index 97d01e2526..8898502229 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.tls.handshake.failed - message: HANDSHAKE_FAILED + name: BINDING_TLS_HANDSHAKE_FAILED + message: The client and server could not negotiate the desired level of security. vaults: server: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml index f9a4e5a794..7b8ea44799 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.tls.tls.failed - message: TLS_FAILED + name: BINDING_TLS_TLS_FAILED + message: There was a generic error detected by an SSL subsystem. vaults: server: type: filesystem diff --git a/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl b/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl index 2e19e88727..ca87587f99 100644 --- a/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl +++ b/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl @@ -43,13 +43,13 @@ scope apicurio int32 artifactId; } - struct ApicurioRetrievableArtifactSubjectVersionEx extends core::stream::Extension + struct ApicurioRetrievedArtifactSubjectVersionEx extends core::stream::Extension { string8 subject; string8 version; } - struct ApicurioRetrievableArtifactIdEx extends core::stream::Extension + struct ApicurioRetrievedArtifactIdEx extends core::stream::Extension { int32 artifactId; } @@ -59,8 +59,8 @@ scope apicurio case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: ApicurioUnretrievableArtifactSubjectVersionEx unretrievableArtifactSubjectVersion; case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: ApicurioUnretrievableArtifactSubjectVersionStaleArtifactEx unretrievableArtifactSubjectVersionStaleArtifact; case UNRETRIEVABLE_ARTIFACT_ID: ApicurioUnretrievableArtifactIdEx unretrievableArtifactId; - case RETRIEVED_ARTIFACT_SUBJECT_VERSION: ApicurioRetrievableArtifactSubjectVersionEx retrievableArtifactSubjectVersion; - case RETRIEVED_ARTIFACT_ID: ApicurioRetrievableArtifactIdEx retrievableArtifactId; + case RETRIEVED_ARTIFACT_SUBJECT_VERSION: ApicurioRetrievedArtifactSubjectVersionEx retrievedArtifactSubjectVersion; + case RETRIEVED_ARTIFACT_ID: ApicurioRetrievedArtifactIdEx retrievedArtifactId; } } } diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml index b4983ae5ab..b4eaf2d073 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml @@ -23,10 +23,12 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.id - message: UNRETRIEVABLE_ARTIFACT_ID 1 + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_ID + message: Unable to fetch artifact id 1. - qname: test.catalog0 - id: catalog.apicurio.retrievable.artifact.id - message: RETRIEVED_ARTIFACT_ID 1 + id: catalog.apicurio.retrieved.artifact.id + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_ID + message: Successfully fetched artifact id 1. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml index 2c391e7ae5..ef7ad346df 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version - message: UNRETRIEVABLE_ARTIFACT artifactId latest + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: Unable to fetch artifact for subject artifactId with version latest. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml index a47879431e..ca4cad8fae 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml @@ -23,13 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version - message: UNRETRIEVABLE_ARTIFACT artifactId latest + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: Unable to fetch artifact for subject artifactId with version latest. - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact - message: UNRETRIEVABLE_ARTIFACT artifactId latest, USING_STALE_ARTIFACT 1 + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT + message: Unable to fetch artifact for subject artifactId with version latest; using stale artifact with id 1. - qname: test.catalog0 - id: catalog.apicurio.retrievable.artifact.subject.version - message: RETRIEVED_ARTIFACT_SUBJECT_VERSION artifactId latest + id: catalog.apicurio.retrieved.artifact.subject.version + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_SUBJECT_VERSION + message: Successfully fetched artifact for subject artifactId with version latest. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl b/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl index e277c81e52..2004aa856d 100644 --- a/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl +++ b/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl @@ -43,13 +43,13 @@ scope karapace int32 schemaId; } - struct KarapaceRetrievableSchemaSubjectVersionEx extends core::stream::Extension + struct KarapaceRetrievedSchemaSubjectVersionEx extends core::stream::Extension { string8 subject; string8 version; } - struct KarapaceRetrievableSchemaIdEx extends core::stream::Extension + struct KarapaceRetrievedSchemaIdEx extends core::stream::Extension { int32 schemaId; } @@ -59,8 +59,8 @@ scope karapace case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: KarapaceUnretrievableSchemaSubjectVersionEx unretrievableSchemaSubjectVersion; case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: KarapaceUnretrievableSchemaSubjectVersionStaleSchemaEx unretrievableSchemaSubjectVersionStaleSchema; case UNRETRIEVABLE_SCHEMA_ID: KarapaceUnretrievableSchemaIdEx unretrievableSchemaId; - case RETRIEVED_SCHEMA_SUBJECT_VERSION: KarapaceRetrievableSchemaSubjectVersionEx retrievableSchemaSubjectVersion; - case RETRIEVED_SCHEMA_ID: KarapaceRetrievableSchemaIdEx retrievableSchemaId; + case RETRIEVED_SCHEMA_SUBJECT_VERSION: KarapaceRetrievedSchemaSubjectVersionEx retrievedSchemaSubjectVersion; + case RETRIEVED_SCHEMA_ID: KarapaceRetrievedSchemaIdEx retrievedSchemaId; } } } diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml index 47edd6afed..df433b2e95 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml @@ -23,10 +23,12 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id - message: UNRETRIEVABLE_SCHEMA_ID 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID + message: Unable to fetch schema id 9. - qname: test.catalog0 - id: catalog.karapace.retrievable.schema.id - message: RETRIEVED_SCHEMA_ID 9 + id: catalog.karapace.retrieved.schema.id + name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_ID + message: Successfully fetched schema id 9. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml index cfebc5d347..f917cdae5a 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml @@ -23,13 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION + message: Unable to fetch schema for subject items-snapshots-value with version latest. - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version.stale.schema - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest, USING_STALE_SCHEMA 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA + message: Unable to fetch schema for subject items-snapshots-value with version latest; using stale schema with id 9. - qname: test.catalog0 - id: catalog.karapace.retrievable.schema.subject.version - message: RETRIEVED_SCHEMA_SUBJECT_VERSION items-snapshots-value latest + id: catalog.karapace.retrieved.schema.subject.version + name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_SUBJECT_VERSION + message: Successfully fetched schema for subject items-snapshots-value with version latest. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml index 0cdf18ac5f..88f28c49a2 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id - message: UNRETRIEVABLE_SCHEMA_ID 1 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID + message: Unable to fetch schema id 1. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml index 094974fe4b..28de1a1313 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION + message: Unable to fetch schema for subject items-snapshots-value with version latest. catalogs: catalog0: type: karapace diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml index 7700f1a82b..2053ab0d4e 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml @@ -24,6 +24,7 @@ telemetry: events: - qname: test.net0 id: binding.test.connected + name: BINDING_TEST_CONNECTED message: test event message bindings: net0: diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json index 51d1bf8be6..5992cecce6 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json @@ -48,6 +48,10 @@ { "type": "string" }, + "name": + { + "type": "string" + }, "message": { "type": "string" diff --git a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt index ac70d76711..96bb6a9a1e 100644 --- a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt +++ b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt @@ -51,7 +51,7 @@ write '{' '"key":"event.name",' '"value":{' - '"stringValue":"binding.test.connected"' + '"stringValue":"BINDING_TEST_CONNECTED"' '}' '}' ']' diff --git a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt index 8f79319539..8ca3aa4dad 100644 --- a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt +++ b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt @@ -52,7 +52,7 @@ read '{' '"key":"event.name",' '"value":{' - '"stringValue":"binding.test.connected"' + '"stringValue":"BINDING_TEST_CONNECTED"' '}' '}' ']' diff --git a/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl b/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl index 937f7f2cf7..81049bbab9 100644 --- a/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl +++ b/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl @@ -24,6 +24,7 @@ scope jwt struct JwtAuthorizationFailedEx extends core::stream::Extension { string8 identity; + string16 reason; } union JwtEventEx switch (JwtEventType) diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml index 4b85ea2070..e70027751e 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: guard.jwt.authorization.failed - message: AUTHORIZATION_FAILED user + name: GUARD_JWT_AUTHORIZATION_FAILED + message: JWT token authorization failed for identity (user). Token is expired. guards: jwt0: type: jwt diff --git a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml index 2f90087d02..56cb116f69 100644 --- a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml +++ b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.avro.validation.failed - message: VALIDATION_FAILED java.io.EOFException + name: MODEL_AVRO_VALIDATION_FAILED + message: A message payload failed validation. java.io.EOFException. catalogs: test0: type: test diff --git a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml index 0eb313abbe..049ad1f8da 100644 --- a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml +++ b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.core.validation.failed - message: VALIDATION_FAILED string + name: MODEL_CORE_VALIDATION_FAILED + message: A message payload failed validation. A field was not the expected type (string). bindings: net0: kind: server diff --git a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml index af289dce90..92b2894c51 100644 --- a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml +++ b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.json.validation.failed - message: VALIDATION_FAILED [1,10][/id] The value must be of string type, but actual type is integer. + name: MODEL_JSON_VALIDATION_FAILED + message: A message payload failed validation. [1,10][/id] The value must be of string type, but actual type is integer. catalogs: test0: type: test diff --git a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml index 2aa546c91b..8eb83d4407 100644 --- a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml +++ b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.protobuf.validation.failed - message: "VALIDATION_FAILED Cannot find field: date in message example" + name: MODEL_PROTOBUF_VALIDATION_FAILED + message: "A message payload failed validation. Cannot find field: date in message example." catalogs: test0: type: test