Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-4510

Events are too big and hard to parse

    Details

    • Type: Task
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Backend
    • Labels:
      None

      Description

      Events should:
      1. be flat (without nested objects)
      2. fit in 100B JSON message

      We can achieve both by removing DeploymentPlan from events and stick only with DeploymentPlan.Id.

      Below you can see how we should change events. Unfortunately change won't be backward compatible.
      <details>

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
      diff --git a/src/main/scala/mesosphere/marathon/core/event/Events.scala b/src/main/scala/mesosphere/marathon/core/event/Events.scala
      index e9995a7..3b4eaad 100644
      --- a/src/main/scala/mesosphere/marathon/core/event/Events.scala
      +++ b/src/main/scala/mesosphere/marathon/core/event/Events.scala
      @@ -2,15 +2,12 @@ package mesosphere.marathon.core.event
       
       import akka.event.EventStream
       import mesosphere.marathon.core.condition.Condition
      -import mesosphere.marathon.core.health.HealthCheck
      +import mesosphere.marathon.core.instance.Instance
       import mesosphere.marathon.core.instance.update.InstanceChange
       import mesosphere.marathon.core.task.Task
      -import mesosphere.marathon.core.instance.Instance
      -import mesosphere.marathon.state.{ AppDefinition, PathId, Timestamp }
      -import mesosphere.marathon.upgrade.{ DeploymentPlan, DeploymentStep }
      -import org.apache.mesos.{ Protos => Mesos }
      -
      -import scala.collection.immutable.Seq
      +import mesosphere.marathon.state.{PathId, Timestamp}
      +import mesosphere.marathon.upgrade.DeploymentStep
      +import org.apache.mesos.{Protos => Mesos}
       
       sealed trait MarathonEvent {
         val eventType: String
      @@ -22,7 +19,6 @@ sealed trait MarathonEvent {
       case class ApiPostEvent(
         clientIp: String,
         uri: String,
      -  appDefinition: AppDefinition,
         eventType: String = "api_post_event",
         timestamp: String = Timestamp.now().toString) extends MarathonEvent
       
      @@ -107,7 +103,8 @@ sealed trait MarathonHealthCheckEvent extends MarathonEvent {
       case class AddHealthCheck(
         appId: PathId,
         version: Timestamp,
      -  healthCheck: HealthCheck,
      +  healthCheckProtocol: String,
      +  healthCheckPortIndex: Int,
         eventType: String = "add_health_check_event",
         timestamp: String = Timestamp.now().toString)
           extends MarathonHealthCheckEvent
      @@ -121,7 +118,8 @@ case class RemoveHealthCheck(
       case class FailedHealthCheck(
         appId: PathId,
         instanceId: Instance.Id,
      -  healthCheck: HealthCheck,
      +  healthCheckProtocol: String,
      +  healthCheckPortIndex: Int,
         eventType: String = "failed_health_check_event",
         timestamp: String = Timestamp.now().toString)
           extends MarathonHealthCheckEvent
      @@ -170,31 +168,29 @@ case class GroupChangeFailed(
       
       case class DeploymentSuccess(
         id: String,
      -  plan: DeploymentPlan,
         eventType: String = "deployment_success",
         timestamp: String = Timestamp.now().toString) extends UpgradeEvent
       
       case class DeploymentFailed(
         id: String,
      -  plan: DeploymentPlan,
         eventType: String = "deployment_failed",
         timestamp: String = Timestamp.now().toString) extends UpgradeEvent
       
       case class DeploymentStatus(
      -  plan: DeploymentPlan,
      +  id: String,
         currentStep: DeploymentStep,
         eventType: String = "deployment_info",
         timestamp: String = Timestamp.now().toString) extends UpgradeEvent
       
       case class DeploymentStepSuccess(
      -  plan: DeploymentPlan,
      -  currentStep: DeploymentStep,
      +  id: String,
      +  currentStepId: String,
         eventType: String = "deployment_step_success",
         timestamp: String = Timestamp.now().toString) extends UpgradeEvent
       
       case class DeploymentStepFailure(
      -  plan: DeploymentPlan,
      -  currentStep: DeploymentStep,
      +  id: String,
      +  currentStepId: String,
         eventType: String = "deployment_step_failure",
         timestamp: String = Timestamp.now().toString) extends UpgradeEvent
       
      @@ -206,19 +202,6 @@ case class AppTerminatedEvent(
         eventType: String = "app_terminated_event",
         timestamp: String = Timestamp.now().toString) extends MarathonEvent
       
      -case class MesosStatusUpdateEvent(
      -  slaveId: String,
      -  taskId: Task.Id,
      -  taskStatus: Mesos.TaskState,
      -  message: String,
      -  appId: PathId,
      -  host: String,
      -  ipAddresses: Seq[org.apache.mesos.Protos.NetworkInfo.IPAddress],
      -  ports: Seq[Int],
      -  version: String,
      -  eventType: String = "status_update_event",
      -  timestamp: String = Timestamp.now().toString) extends MarathonEvent
      -
       /** Event indicating a status change for a known instance */
       case class InstanceChanged(
           id: Instance.Id,
      

      </details>

      Original: https://github.com/mesosphere/marathon/issues/3154

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              janisz janisz
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support