|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + ~ Licensed to the Apache Software Foundation (ASF) under one |
| 4 | + ~ or more contributor license agreements. See the NOTICE file |
| 5 | + ~ distributed with this work for additional information |
| 6 | + ~ regarding copyright ownership. The ASF licenses this file |
| 7 | + ~ to you under the Apache License, Version 2.0 (the |
| 8 | + ~ "License"); you may not use this file except in compliance |
| 9 | + ~ with the License. You may obtain a copy of the License at |
| 10 | + ~ |
| 11 | + ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + ~ |
| 13 | + ~ Unless required by applicable law or agreed to in writing, |
| 14 | + ~ software distributed under the License is distributed on an |
| 15 | + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | + ~ KIND, either express or implied. See the License for the |
| 17 | + ~ specific language governing permissions and limitations |
| 18 | + ~ under the License. |
| 19 | + --> |
| 20 | +<project xmlns="http://maven.apache.org/POM/4.0.0" |
| 21 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 22 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 23 | + <parent> |
| 24 | + <groupId>org.apache.druid</groupId> |
| 25 | + <artifactId>druid</artifactId> |
| 26 | + <version>0.23.0-SNAPSHOT</version> |
| 27 | + <relativePath>../../pom.xml</relativePath> |
| 28 | + </parent> |
| 29 | + <modelVersion>4.0.0</modelVersion> |
| 30 | + |
| 31 | + <groupId>org.apache.druid.extensions.contrib</groupId> |
| 32 | + <artifactId>opentelemetry-emitter</artifactId> |
| 33 | + <name>opentelemetry-emitter</name> |
| 34 | + <description>Extension support for emitting OpenTelemetry spans for Druid queries</description> |
| 35 | + |
| 36 | + <properties> |
| 37 | + <opentelemetry.version>1.7.0</opentelemetry.version> |
| 38 | + <opentelemetry.instrumentation.version>1.7.0-alpha</opentelemetry.instrumentation.version> |
| 39 | + <!-- These guava and grpc versions are used only in the opentelemetry-extension. |
| 40 | + Look at build section for more details about shading. --> |
| 41 | + <shade.guava.version>30.1.1-jre</shade.guava.version> |
| 42 | + <shade.grpc.version>1.41.0</shade.grpc.version> |
| 43 | + </properties> |
| 44 | + <dependencyManagement> |
| 45 | + <dependencies> |
| 46 | + <dependency> |
| 47 | + <groupId>io.opentelemetry</groupId> |
| 48 | + <artifactId>opentelemetry-bom</artifactId> |
| 49 | + <version>${opentelemetry.version}</version> |
| 50 | + <type>pom</type> |
| 51 | + <scope>import</scope> |
| 52 | + </dependency> |
| 53 | + <dependency> |
| 54 | + <groupId>io.opentelemetry</groupId> |
| 55 | + <artifactId>opentelemetry-bom-alpha</artifactId> |
| 56 | + <version>${opentelemetry.version}-alpha</version> |
| 57 | + <type>pom</type> |
| 58 | + <scope>import</scope> |
| 59 | + </dependency> |
| 60 | + <dependency> |
| 61 | + <groupId>io.opentelemetry.instrumentation</groupId> |
| 62 | + <artifactId>opentelemetry-instrumentation-bom-alpha</artifactId> |
| 63 | + <version>${opentelemetry.instrumentation.version}</version> |
| 64 | + <type>pom</type> |
| 65 | + <scope>compile</scope> |
| 66 | + </dependency> |
| 67 | + </dependencies> |
| 68 | + </dependencyManagement> |
| 69 | + <dependencies> |
| 70 | + <dependency> |
| 71 | + <groupId>org.apache.druid</groupId> |
| 72 | + <artifactId>druid-core</artifactId> |
| 73 | + <version>${project.parent.version}</version> |
| 74 | + <scope>provided</scope> |
| 75 | + </dependency> |
| 76 | + <dependency> |
| 77 | + <groupId>io.opentelemetry</groupId> |
| 78 | + <artifactId>opentelemetry-context</artifactId> |
| 79 | + </dependency> |
| 80 | + <dependency> |
| 81 | + <groupId>io.opentelemetry</groupId> |
| 82 | + <artifactId>opentelemetry-api</artifactId> |
| 83 | + </dependency> |
| 84 | + <dependency> |
| 85 | + <groupId>io.opentelemetry</groupId> |
| 86 | + <artifactId>opentelemetry-sdk</artifactId> |
| 87 | + </dependency> |
| 88 | + <dependency> |
| 89 | + <groupId>io.opentelemetry</groupId> |
| 90 | + <artifactId>opentelemetry-sdk-trace</artifactId> |
| 91 | + </dependency> |
| 92 | + <dependency> |
| 93 | + <groupId>io.opentelemetry</groupId> |
| 94 | + <artifactId>opentelemetry-sdk-common</artifactId> |
| 95 | + </dependency> |
| 96 | + <!-- OpenTelemetry extension bundles the OpenTelemetry auto-instrumentation, |
| 97 | + So it could potentially affect performance --> |
| 98 | + <dependency> |
| 99 | + <groupId>io.opentelemetry</groupId> |
| 100 | + <artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId> |
| 101 | + </dependency> |
| 102 | + <dependency> |
| 103 | + <groupId>io.grpc</groupId> |
| 104 | + <artifactId>grpc-netty-shaded</artifactId> |
| 105 | + <version>${shade.grpc.version}</version> |
| 106 | + </dependency> |
| 107 | + <dependency> |
| 108 | + <groupId>com.google.code.findbugs</groupId> |
| 109 | + <artifactId>jsr305</artifactId> |
| 110 | + </dependency> |
| 111 | + <dependency> |
| 112 | + <groupId>com.google.inject</groupId> |
| 113 | + <artifactId>guice</artifactId> |
| 114 | + </dependency> |
| 115 | + <dependency> |
| 116 | + <groupId>com.google.guava</groupId> |
| 117 | + <artifactId>guava</artifactId> |
| 118 | + <version>${shade.guava.version}</version> |
| 119 | + </dependency> |
| 120 | + <!-- explicitly include perfmark dependency of grpc we exclude from the shaded jar |
| 121 | + Note: we could use promoteTransitiveDependencies=true in the shade plugin, but that promotes all |
| 122 | + transitive dependencies as well, which unnecessarily pollutes the final pom --> |
| 123 | + <dependency> |
| 124 | + <groupId>io.perfmark</groupId> |
| 125 | + <artifactId>perfmark-api</artifactId> |
| 126 | + <version>0.23.0</version> |
| 127 | + <scope>runtime</scope> |
| 128 | + </dependency> |
| 129 | + <dependency> |
| 130 | + <groupId>joda-time</groupId> |
| 131 | + <artifactId>joda-time</artifactId> |
| 132 | + <scope>provided</scope> |
| 133 | + </dependency> |
| 134 | + <dependency> |
| 135 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 136 | + <artifactId>jackson-databind</artifactId> |
| 137 | + <scope>provided</scope> |
| 138 | + </dependency> |
| 139 | + <dependency> |
| 140 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 141 | + <artifactId>jackson-core</artifactId> |
| 142 | + <scope>provided</scope> |
| 143 | + </dependency> |
| 144 | + <dependency> |
| 145 | + <groupId>junit</groupId> |
| 146 | + <artifactId>junit</artifactId> |
| 147 | + <scope>test</scope> |
| 148 | + </dependency> |
| 149 | + <dependency> |
| 150 | + <groupId>pl.pragmatists</groupId> |
| 151 | + <artifactId>JUnitParams</artifactId> |
| 152 | + <scope>test</scope> |
| 153 | + </dependency> |
| 154 | + </dependencies> |
| 155 | + |
| 156 | + <build> |
| 157 | + <plugins> |
| 158 | + <plugin> |
| 159 | + <groupId>org.apache.maven.plugins</groupId> |
| 160 | + <artifactId>maven-dependency-plugin</artifactId> |
| 161 | + <configuration> |
| 162 | + <ignoredUnusedDeclaredDependencies> |
| 163 | + <!-- Transitive dependencies from opentelemetry but explicitly added to be shadowed --> |
| 164 | + <ignoredUnusedDeclaredDependency>io.grpc:grpc-netty-shaded</ignoredUnusedDeclaredDependency> |
| 165 | + <ignoredUnusedDeclaredDependency>com.google.guava:guava</ignoredUnusedDeclaredDependency> |
| 166 | + </ignoredUnusedDeclaredDependencies> |
| 167 | + </configuration> |
| 168 | + </plugin> |
| 169 | + <plugin> |
| 170 | + <groupId>org.apache.maven.plugins</groupId> |
| 171 | + <artifactId>maven-shade-plugin</artifactId> |
| 172 | + <executions> |
| 173 | + <execution> |
| 174 | + <id>opentelemetry-extension</id> |
| 175 | + <phase>package</phase> |
| 176 | + <goals> |
| 177 | + <goal>shade</goal> |
| 178 | + </goals> |
| 179 | + <configuration> |
| 180 | + <transformers> |
| 181 | + <!-- grpc stores service providers in META-INF/services/* files, |
| 182 | + so we need to relocate the class names of the implementation classes. |
| 183 | + More about SPI - https://docs.oracle.com/javase/tutorial/ext/basics/spi.html. |
| 184 | + https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html. --> |
| 185 | + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> |
| 186 | + </transformers> |
| 187 | + <artifactSet> |
| 188 | + <includes> |
| 189 | + <include>io.opentelemetry</include> |
| 190 | + <include>io.grpc</include> |
| 191 | + <include>com.google.guava</include> |
| 192 | + </includes> |
| 193 | + </artifactSet> |
| 194 | + <relocations> |
| 195 | + <relocation> |
| 196 | + <pattern>com.google.common</pattern> |
| 197 | + <shadedPattern>org.apache.druid.opentelemetry.shaded.com.google.common</shadedPattern> |
| 198 | + </relocation> |
| 199 | + <relocation> |
| 200 | + <pattern>io.grpc</pattern> |
| 201 | + <shadedPattern>org.apache.druid.opentelemetry.shaded.io.grpc</shadedPattern> |
| 202 | + <includes> |
| 203 | + <include>io.grpc.*</include> |
| 204 | + </includes> |
| 205 | + </relocation> |
| 206 | + <relocation> |
| 207 | + <pattern>io.opentelemetry</pattern> |
| 208 | + <shadedPattern>org.apache.druid.opentelemetry.shaded.io.opentelemetry</shadedPattern> |
| 209 | + </relocation> |
| 210 | + </relocations> |
| 211 | + </configuration> |
| 212 | + </execution> |
| 213 | + </executions> |
| 214 | + </plugin> |
| 215 | + </plugins> |
| 216 | + </build> |
| 217 | +</project> |
0 commit comments