Class OtelUtils

java.lang.Object
io.jenkins.plugins.opentelemetry.OtelUtils

public class OtelUtils extends Object
  • Field Details

  • Constructor Details

    • OtelUtils

      public OtelUtils()
  • Method Details

    • getSystemPropertyOrEnvironmentVariable

      @CheckForNull public static String getSystemPropertyOrEnvironmentVariable(String environmentVariableName)
    • spanToDebugString

      @NonNull public static Function<io.opentelemetry.api.trace.Span,String> spanToDebugString()
    • getProjectType

      @NonNull public static String getProjectType(Run run)
    • getMultibranchType

      @NonNull public static String getMultibranchType(Run run)
    • isMultibranchTag

      public static boolean isMultibranchTag(Run run)
    • isMultibranchChangeRequest

      public static boolean isMultibranchChangeRequest(Run run)
    • isMultibranchBranch

      public static boolean isMultibranchBranch(Run run)
    • isMultibranch

      public static boolean isMultibranch(Run run)
    • isWorkflow

      public static boolean isWorkflow(Run run)
    • isFreestyle

      public static boolean isFreestyle(Run run)
    • isMatrix

      @NonNull public static boolean isMatrix(Run run)
    • isMaven

      public static boolean isMaven(Run run)
    • toDebugString

      @NonNull public static String toDebugString(@Nullable io.opentelemetry.api.trace.Span span)
    • toDebugString

      @NonNull public static String toDebugString(org.jenkinsci.plugins.workflow.graph.FlowNode flowNode)
    • flowNodeToDebugString

      @NonNull public static Function<org.jenkinsci.plugins.workflow.graph.FlowNode,String> flowNodeToDebugString()
    • urlEncode

      @NonNull public static String urlEncode(String value)
    • getJenkinsVersion

      @NonNull public static String getJenkinsVersion()
    • getOpentelemetryPluginVersion

      @NonNull public static String getOpentelemetryPluginVersion()
    • prettyPrintOtelSdkConfig

      public static String prettyPrintOtelSdkConfig(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties, io.opentelemetry.sdk.resources.Resource resource)
    • prettyPrintConfiguration

      public static String prettyPrintConfiguration(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties config)
    • noteworthyConfigProperties

      public static Map<String,String> noteworthyConfigProperties(io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties configProperties)
    • getW3cTraceContext

      public static Map<String,String> getW3cTraceContext(io.opentelemetry.api.trace.Span span)
    • prettyPrintResource

      public static String prettyPrintResource(@Nullable io.opentelemetry.sdk.resources.Resource resource)
    • hasOpentelemetryData

      public static boolean hasOpentelemetryData(Run<?,?> run)
      Check if the run has Opentelemetry data To validate it search for the MonitoringAction in the build actions.
      Parameters:
      run - the Build
      Returns:
      true if the run has Opentelemetry data