Skip to content

Commit

Permalink
Merge pull request #3949 from atlanhq/dev/otel3
Browse files Browse the repository at this point in the history
fix docker file
  • Loading branch information
rpsadarangani authored Jan 8, 2025
2 parents e135c5e + 2b754a3 commit a0e30fd
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ RUN apt-get update \
RUN ln -s /usr/bin/python2 /usr/bin/python

COPY atlas-hub/atlas_start.py.patch atlas-hub/atlas_config.py.patch /opt/apache-atlas/bin/
COPY atlas-hub/pre-conf/atlas-log4j.xml /opt/apache-atlas/conf/
COPY atlas-hub/pre-conf/atlas-log4j2.xml /opt/apache-atlas/conf/
COPY atlas-hub/pre-conf/atlas-logback.xml /opt/apache-atlas/conf/
COPY atlas-hub/pre-conf/atlas-auth/ /opt/apache-atlas/conf/

RUN mkdir /opt/apache-atlas/libext
Expand Down
167 changes: 161 additions & 6 deletions atlas-hub/atlas-logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,27 @@
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<param name="Target" value="System.out"/>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
<pattern>
logback: %d %-5p - [%t:%X{context-key}] - X-Atlan-Request-Id:[%X{X-Atlan-Request-Id}] - traceId:[%X{trace_id}] - span_id:[%X{span_id}] ~ %m (%C{1}:%L)%n
</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>

<appender name="OpenTelemetry"
class="io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender">
<!-- Additional capture options -->
<captureExperimentalAttributes>true</captureExperimentalAttributes>
<captureMdcAttributes>*</captureMdcAttributes>
<captureLoggerContext>true</captureLoggerContext>
<captureKeyValuePairAttributes>true</captureKeyValuePairAttributes>
</appender>


<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/${atlas.log.file</file>
<file>${atlas.log.dir}/${atlas.log.file}</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
Expand All @@ -40,8 +52,151 @@
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<root level="info">
<appender-ref ref="FILE"/>

<appender name="LARGE_MESSAGES" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/large_messages.log</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${atlas.log.dir}/large_messages-%d.log</fileNamePattern>
<maxHistory>20</maxHistory>
<cleanHistoryOnStart>false</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<appender name="AUDIT" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/audit.log</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${atlas.log.dir}/audit-%d.log</fileNamePattern>
<maxHistory>20</maxHistory>
<cleanHistoryOnStart>false</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<appender name="TASKS" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/tasks.log</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${atlas.log.dir}/tasks-%d.log</fileNamePattern>
<maxHistory>20</maxHistory>
<cleanHistoryOnStart>false</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<appender name="METRICS" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/metrics.log</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${atlas.log.dir}/metrics-%d.log</fileNamePattern>
<maxHistory>20</maxHistory>
<cleanHistoryOnStart>false</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<appender name="FAILED" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/failed.log</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${atlas.log.dir}/failed-%d.log</fileNamePattern>
<maxHistory>20</maxHistory>
<cleanHistoryOnStart>false</cleanHistoryOnStart>
</rollingPolicy>
</appender>

<!-- Uncomment the following for perf logs -->
<!--
<appender name="perf_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${atlas.log.dir}/atlas_perf.log</file>
<append>true</append>
<encoder>
<pattern>%date [%thread] %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${atlas.log.dir}/atlas_perf-%d.log</fileNamePattern>
<maxHistory>20</maxHistory>
<cleanHistoryOnStart>false</cleanHistoryOnStart>
</rollingPolicy>
</appender>
-->
<logger name="perf_appender" additivity="false" level="debug">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>


<logger name="org.apache.atlas" additivity="false" level="info">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="org.janusgraph" additivity="false" level="warn">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="org.springframework" additivity="false" level="warn">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="org.eclipse" additivity="false" level="warn">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="com.sun.jersey" additivity="false" level="warn">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<!-- to avoid logs - The configuration log.flush.interval.messages = 1 was supplied but isn't a known config -->
<logger name="org.apache.kafka.common.config.AbstractConfig" additivity="false" level="error">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="AUDIT" additivity="false" level="info">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="LARGE_MESSAGES" additivity="false" level="warn">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="METRICS" additivity="false" level="debug">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="FAILED" additivity="false" level="info">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<logger name="TASKS" additivity="false" level="info">
<appender-ref ref="console"/>
<appender-ref ref="OpenTelemetry"/>
</logger>

<root level="INFO">
<appender-ref ref="OpenTelemetry"/>
<appender-ref ref="console"/>
</root>
</configuration>
</configuration>

0 comments on commit a0e30fd

Please sign in to comment.