public class ManifestUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ManifestUtil.ManifestGauge |
| Constructor and Description |
|---|
ManifestUtil() |
| Modifier and Type | Method and Description |
|---|---|
static ManifestUtil.ManifestGauge |
createManifestGauge(Manifest manifest)
Creates a Gauge metric used to show the title and version of a given microservice.
|
Optional<Manifest> |
findManifestForJar(String bootJarName)
Scan the complete classpath and tries to find the MANIFEST.MF file within a jar where the given name
bootJarName
is part of the jar file name. |
public Optional<Manifest> findManifestForJar(String bootJarName)
bootJarName
is part of the jar file name. In case a MANIFEST.MF file is found, this is parsed and provided as a Manifest
optional.bootJarName - public static ManifestUtil.ManifestGauge createManifestGauge(Manifest manifest)
new ManifestUtil().findManifestForJar("leanix-webhooks").ifPresent(manifest -> {
environment.metrics().register("a.service", ManifestUtil.createManifestGauge(manifest));
});
manifest - A Manifest objects which contains the information used for this metric.Copyright © 2020 LeanIX GmbH. All rights reserved.