Browse Source

Fixed observation convention issues

pull/1188/head
Marcin Grzejszczak 2 years ago
parent
commit
31cade5948
  1. 26
      docs/pom.xml
  2. 8
      spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/observation/CircuitBreakerObservationDocumentation.java
  3. 8
      spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/observation/DefaultCircuitBreakerObservationConvention.java

26
docs/pom.xml

@ -54,29 +54,13 @@ @@ -54,29 +54,13 @@
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-metrics-metadata</id>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>io.micrometer.docs.metrics.DocsFromSources</mainClass>
<includePluginDependencies>true</includePluginDependencies>
<arguments>
<argument>${micrometer-docs-generator.inputPath}</argument>
<argument>${micrometer-docs-generator.inclusionPattern}</argument>
<argument>${micrometer-docs-generator.outputPath}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>generate-tracing-metadata</id>
<phase>prepare-package</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>io.micrometer.docs.spans.DocsFromSources</mainClass>
<mainClass>io.micrometer.docs.DocsGeneratorCommand</mainClass>
<includePluginDependencies>true</includePluginDependencies>
<arguments>
<argument>${micrometer-docs-generator.inputPath}</argument>
@ -88,11 +72,9 @@ @@ -88,11 +72,9 @@
</executions>
<dependencies>
<dependency>
<groupId>io.micrometer
</groupId>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-docs-generator</artifactId>
<version>${micrometer-docs-generator.version}
</version>
<version>${micrometer-docs-generator.version}</version>
<type>jar</type>
</dependency>
</dependencies>

8
spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/observation/CircuitBreakerObservationDocumentation.java

@ -42,10 +42,6 @@ enum CircuitBreakerObservationDocumentation implements ObservationDocumentation @@ -42,10 +42,6 @@ enum CircuitBreakerObservationDocumentation implements ObservationDocumentation
return "spring.cloud.circuitbreaker";
}
@Override
public String getContextualName() {
return "circuit-breaker";
}
},
/**
@ -68,10 +64,6 @@ enum CircuitBreakerObservationDocumentation implements ObservationDocumentation @@ -68,10 +64,6 @@ enum CircuitBreakerObservationDocumentation implements ObservationDocumentation
return "spring.cloud.circuitbreaker";
}
@Override
public String getContextualName() {
return "circuit-breaker fallback";
}
};
public enum LowCardinalityTags implements KeyName {

8
spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/observation/DefaultCircuitBreakerObservationConvention.java

@ -44,4 +44,12 @@ public class DefaultCircuitBreakerObservationConvention implements CircuitBreake @@ -44,4 +44,12 @@ public class DefaultCircuitBreakerObservationConvention implements CircuitBreake
return "spring.cloud.circuitbreaker";
}
@Override
public String getContextualName(CircuitBreakerObservationContext context) {
if (context.getType() == CircuitBreakerObservationContext.Type.SUPPLIER) {
return "circuit-breaker";
}
return "circuit-breaker fallback";
}
}

Loading…
Cancel
Save