Skip to content

Commit

Permalink
Send pipeline logs to OpenTelemetry endpoint (#304)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Fernandez Calvo <[email protected]>
  • Loading branch information
cyrille-leclerc and kuisathaverat authored Feb 20, 2022
1 parent 0e8a772 commit 0397b31
Show file tree
Hide file tree
Showing 81 changed files with 4,892 additions and 337 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ private/
agent.jar
local.pid

.env


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You can look at this video tutorial to get started: [![Tracing Your Jenkins Pipe
|------------------------------------------|-------|------------|
| otel.instrumentation.jenkins.job.dsl.collapse.job.name | Boolean, default `false` | When using Job DSL generated jobs, make the pipeline run root span name a low cardinality name using the name "Job from seed '${job.jobDslSeedJob.fullName}'" rather than using "${job.fullName}". Useful when the Job DSL plugin creates a lot of jobs |
| otel.instrumentation.jenkins.job.matrix.expand.job.name | Boolean, default `false` | When using Matrix Projects, the name of the combination jobs is by default collapsed to "${matrix-job-name}/execution" rather than using the full name that is generated joining the axis values of the combination |

| otel.instrumentation.jenkins.web.enabled | Boolean, default `true` | Disable the instrumentation of Jenkins web requests (ie the instrumentation of Jenkins Stapler) |


## Configuration as code
Expand Down
1 change: 0 additions & 1 deletion opentelemetry-collector/.gitignore

This file was deleted.

58 changes: 0 additions & 58 deletions opentelemetry-collector/opentelemetry-collector.yaml

This file was deleted.

61 changes: 0 additions & 61 deletions opentelemetry-collector/run-opentelemetry-collector.sh

This file was deleted.

66 changes: 49 additions & 17 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<opentelemetry.version>1.11.0</opentelemetry.version>
<opentelemetry-alpha.version>1.11.0-alpha</opentelemetry-alpha.version>
<useBeta>true</useBeta>
<elasticstack.version>7.17.0</elasticstack.version>
</properties>
<name>OpenTelemetry Plugin</name>
<description>Publish Jenkins metrics to an OpenTelemetry endpoint, including distributed traces of job executions and health metrics of the controller.</description>
Expand Down Expand Up @@ -59,16 +61,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<!--
conflict between io.opentelemetry:opentelemetry-sdk-extension-aws and io.jenkins.configuration-as-code:test-harness
-->
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.13.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<!-- okhttp:4.9.3 -> okio:2.8.0 versus okhttp:4.9.3 -> okio:2.8.0 - kotlin-stdlib-->
<groupId>org.jetbrains.kotlin</groupId>
Expand Down Expand Up @@ -191,12 +183,15 @@
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-logging</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp-logs</artifactId>
</dependency>

<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
</dependency>

<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>okhttp-api</artifactId>
Expand All @@ -223,6 +218,10 @@
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
Expand Down Expand Up @@ -334,6 +333,21 @@
<version>1.1.19</version>
<optional>true</optional>
</dependency>
<dependency>
<!--
Use the old `org.elasticsearch.client:elasticsearch-rest-high-level-client` waiting for
`co.elastic.clients:elasticsearch-java` to fix https://github.com/elastic/elasticsearch-java/issues/163
-->
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>${elasticstack.version}</version>
<exclusions>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-cli</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-testing</artifactId>
Expand Down Expand Up @@ -413,6 +427,11 @@
<artifactId>configuration-as-code</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-slaves</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.configuration-as-code</groupId>
<artifactId>test-harness</artifactId>
Expand All @@ -426,12 +445,6 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<!--
<exclusion>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
</exclusion>
-->
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
Expand Down Expand Up @@ -460,6 +473,22 @@
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.16.3</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -470,6 +499,9 @@
<!-- JENKINS-50520: since we need a custom version of Guava -->
<maskClasses>com.google.common.</maskClasses>
<minimumJavaVersion>8</minimumJavaVersion>
<loggers>
<io.jenkins.plugins.opentelemetry.job.log>FINE</io.jenkins.plugins.opentelemetry.job.log>
</loggers>
</configuration>
</plugin>
<plugin>
Expand Down
7 changes: 0 additions & 7 deletions prometheus/prometheus.yml

This file was deleted.

26 changes: 0 additions & 26 deletions prometheus/run-prometheus.sh

This file was deleted.

Loading

0 comments on commit 0397b31

Please sign in to comment.