markusthoemmes commented on a change in pull request #3421: Add ElasticSearch Log Store URL: https://github.com/apache/incubator-openwhisk/pull/3421#discussion_r177688994
########## File path: common/scala/src/main/scala/whisk/core/containerpool/logging/ElasticSearchLogStore.scala ########## @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package whisk.core.containerpool.logging + +import java.nio.file.{Path, Paths} + +import akka.actor.ActorSystem +import akka.stream.scaladsl.Flow +import akka.http.scaladsl.model._ + +import whisk.core.entity.{ActivationLogs, Identity, WhiskActivation} +import whisk.core.containerpool.logging.ElasticSearchJsonProtocol._ +import whisk.core.ConfigKeys + +import scala.concurrent.{Future, Promise} +import scala.util.Try + +import spray.json._ + +import pureconfig._ + +case class ElasticSearchLogStoreConfig(protocol: String, + host: String, + port: Int, + path: String, + userLogsField: String, + messageField: String, + activationIdField: String, + streamField: String, + timeField: String, Review comment: It might be worth to extract the fields into another case class, like: ```scala case class ElasticSearchLogStoreConfig(protocol: String, host: String, port: Int, path: String, requiredHeaders: Seq[String], logSchema: ElasticSearchLogStoreFieldsConfig) ElasticSearchLogStoreFieldsConfig(message: String, activationId: String, stream: String, time: String) ``` that'd enable a configuration like so: ``` whisk.logstore.elasticsearch { ... log-schema { message: message time: time_date ... } } ``` WDYT? On the userlogsField: Should that be called "type". It's not strictly a field in terms of a schema but rather something to match on? In my mind, that'd go to the top-level configuration. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
