This file contains hidden or 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
func initMeterProvider() (func(context.Context) error, error) { | |
res := resource.Default() | |
metricExporter, err := otlpmetrichttp.New(context.TODO()) | |
// metricExporter, err := otlpmetricgrpc.New(context.TODO()) | |
if err != nil { | |
return nil, fmt.Errorf("failed to create metrics exporter: %w", err) | |
} | |
// グローバルのprometheusのregistryを使う。 | |
// client_golangのinitでNewGoCollectorで登録しているが |
This file contains hidden or 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
package com.github.wreulicke.otel; | |
import io.opentelemetry.api.GlobalOpenTelemetry; | |
import io.opentelemetry.api.trace.Span; | |
import io.opentelemetry.api.trace.Tracer; | |
import io.opentelemetry.context.Scope; | |
import io.opentelemetry.sdk.OpenTelemetrySdk; | |
import io.opentelemetry.sdk.common.CompletableResultCode; | |
import io.opentelemetry.sdk.trace.SdkTracerProvider; | |
import io.opentelemetry.sdk.trace.data.SpanData; |
This file contains hidden or 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
tasks.named('shadowJar').configure { | |
dependsOn tasks.named('classes') | |
from sourceSets.main.runtimeClasspath.find { it.name.startsWith('hogehoge') } | |
archiveBaseName.set("hogehoge") | |
archiveClassifier.set("relocated") | |
relocate 'some.package', 'relocated.some.package' | |
dependencies { | |
exclude({ true }) | |
} | |
} |
This file contains hidden or 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
publishing { | |
publications { | |
create<MavenPublication>("library") { // この行適当にコピペしてきたのでミスってたらごめん | |
from(components.java) | |
// delete BOM from pom.xml to avoid conflicts | |
pom { | |
withXml { | |
def pomNode = asNode() | |
if (pomNode.dependencyManagement.size() > 0) { |
This file contains hidden or 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
tasks.withType<JavaCompile> { | |
options.compilerArgs.add("--enable-preview") | |
} | |
// Apply a specific Java toolchain to ease working on different environments. | |
java { | |
toolchain { | |
languageVersion.set(JavaLanguageVersion.of(22)) | |
} | |
} |
This file contains hidden or 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
//JAVA 21 | |
//DEPS ch.qos.logback.tyler:tyler-base:0.9 com.google.googlejavaformat:google-java-format:1.24.0 | |
// | |
//RUNTIME_OPTIONS --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED |
This file contains hidden or 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
module.exports = async function * customReporter(source) { | |
let roots = [] | |
let currentSuite = null; | |
function startTest(event) { | |
const parent = currentSuite; | |
currentSuite = { | |
name: event.data.name, | |
nesting: event.data.nesting, |
This file contains hidden or 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
package com.github.wreulicke.mdc; | |
import org.slf4j.MDC; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.*; | |
public class DelegatingMDCInheritableExecutorService extends AbstractExecutorService { |
NewerOlder