forked from gbif/pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Spark Slf4jSink.java and configurations
- Loading branch information
Showing
14 changed files
with
155 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ bin | |
.DS_Store | ||
logs | ||
log | ||
temp | ||
temp | ||
tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
pipelines/beam-common/src/main/java/org/gbif/pipelines/common/beam/Slf4jSink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.gbif.pipelines.common.beam; | ||
|
||
import java.util.Properties; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import org.apache.beam.runners.spark.metrics.AggregatorMetric; | ||
import org.apache.beam.runners.spark.metrics.WithMetricsSupport; | ||
|
||
/** | ||
* A Spark {@link org.apache.spark.metrics.sink.Sink} that is tailored to report {@link | ||
* AggregatorMetric} metrics to Slf4j. | ||
*/ | ||
public class Slf4jSink extends org.apache.spark.metrics.sink.Slf4jSink { | ||
public Slf4jSink( | ||
final Properties properties, | ||
final MetricRegistry metricRegistry, | ||
final org.apache.spark.SecurityManager securityMgr) { | ||
super(properties, WithMetricsSupport.forRegistry(metricRegistry), securityMgr); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
pipelines/ingest-gbif-standalone/src/main/resources/log4j.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Set everything to be logged to the console | ||
log4j.rootCategory=INFO, console, file, gelf | ||
log4j.appender.console=org.apache.log4j.ConsoleAppender | ||
log4j.appender.console.target=System.err | ||
log4j.appender.console.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.console.layout.ConversionPattern=%X{datasetId} %d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n | ||
|
||
# Settings to quiet third party logs that are too verbose | ||
log4j.logger.org.spark-project.jetty=WARN | ||
project.jetty.util.component.AbstractLifeCycle=ERROR | ||
log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=INFO | ||
log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=INFO | ||
log4j.logger.org.apache.parquet=ERROR | ||
log4j.logger.parquet=ERROR | ||
|
||
# SPARK-9183: Settings to avoid annoying messages when looking up | ||
nonexistent UDFs in SparkSQL with Hive support | ||
log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL | ||
log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR | ||
|
||
# File appender | ||
log4j.appender.file=org.apache.log4j.RollingFileAppender | ||
log4j.appender.file.File=logs/ingest-gbif.log | ||
log4j.appender.file.ImmediateFlush=true | ||
log4j.appender.file.Append=false | ||
log4j.appender.file.MaxFileSize=100MB | ||
log4j.appender.file.MaxBackupIndex=10 | ||
log4j.appender.file.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.file.layout.ConversionPattern=%X{datasetId} %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n | ||
|
||
# ELK appender | ||
log4j.appender.gelf=biz.paluch.logging.gelf.log4j.GelfLogAppender | ||
log4j.appender.gelf.Threshold=INFO | ||
log4j.appender.gelf.Host=udp:127.0.0.1 | ||
log4j.appender.gelf.Port=12201 | ||
log4j.appender.gelf.Version=1.1 | ||
log4j.appender.gelf.Facility=ingest-gbif | ||
log4j.appender.gelf.ExtractStackTrace=true | ||
log4j.appender.gelf.FilterStackTrace=true | ||
log4j.appender.gelf.MdcProfiling=true | ||
log4j.appender.gelf.TimestampPattern=yyyy-MM-dd HH:mm:ss,SSSS | ||
log4j.appender.gelf.MaximumMessageSize=8192 | ||
log4j.appender.gelf.MdcFields=datasetId,attempt,uuid | ||
log4j.appender.gelf.IncludeFullMdc=true |
22 changes: 0 additions & 22 deletions
22
pipelines/ingest-gbif-standalone/src/main/resources/logback.xml
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
pipelines/ingest-gbif-standalone/src/main/resources/metrics.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
executor.sink.slf4j.class=org.apache.spark.metrics.sink.Slf4jSink | ||
driver.sink.slf4j.class=org.gbif.pipelines.common.beam.Slf4jSink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ines/ingest-gbif/src/main/java/org/gbif/pipelines/ingest/options/DwcaPipelineOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.