Skip to content

Commit 6c7770b

Browse files
authored
Add forward slash to InstrumentName log message (open-telemetry#6343)
1 parent 1c64445 commit 6c7770b

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

api/all/src/main/java/io/opentelemetry/api/metrics/Meter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public interface Meter {
6565
* callbacks).
6666
*
6767
* @param name the name of the Counter. Instrument names must consist of 255 or fewer characters
68-
* including alphanumeric, _, ., -, and start with a letter.
68+
* including alphanumeric, _, ., -, /, and start with a letter.
6969
* @return a builder for configuring a Counter instrument. Defaults to recording long values, but
7070
* may be changed.
7171
* @see <a
@@ -81,7 +81,7 @@ public interface Meter {
8181
* callbacks).
8282
*
8383
* @param name the name of the UpDownCounter. Instrument names must consist of 255 or fewer
84-
* characters including alphanumeric, _, ., -, and start with a letter.
84+
* characters including alphanumeric, _, ., -, /, and start with a letter.
8585
* @return a builder for configuring an UpDownCounter instrument. Defaults to recording long
8686
* values, but may be changed.
8787
* @see <a
@@ -94,7 +94,7 @@ public interface Meter {
9494
* Constructs a Histogram instrument.
9595
*
9696
* @param name the name of the Histogram. Instrument names must consist of 255 or fewer characters
97-
* including alphanumeric, _, ., -, and start with a letter.
97+
* including alphanumeric, _, ., -, /, and start with a letter.
9898
* @return a builder for configuring a Histogram synchronous instrument. Defaults to recording
9999
* double values, but may be changed.
100100
* @see <a
@@ -107,7 +107,7 @@ public interface Meter {
107107
* Constructs an Asynchronous Gauge instrument.
108108
*
109109
* @param name the name of the Gauge. Instrument names must consist of 255 or fewer characters
110-
* including alphanumeric, _, ., -, and start with a letter.
110+
* including alphanumeric, _, ., -, /, and start with a letter.
111111
* @return a builder used for configuring a Gauge instrument. Defaults to recording double values,
112112
* but may be changed.
113113
* @see <a

sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/SdkMeter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static boolean checkValidInstrumentName(String name) {
163163
Level.WARNING,
164164
"Instrument name \""
165165
+ name
166-
+ "\" is invalid, returning noop instrument. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, and start with a letter.",
166+
+ "\" is invalid, returning noop instrument. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.",
167167
new AssertionError());
168168
}
169169

sdk/metrics/src/test/java/io/opentelemetry/sdk/metrics/SdkMeterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void builder_InvalidName() {
9494
void checkValidInstrumentName_InvalidNameLogs() {
9595
assertThat(checkValidInstrumentName("1")).isFalse();
9696
sdkMeterLogs.assertContains(
97-
"Instrument name \"1\" is invalid, returning noop instrument. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, and start with a letter.");
97+
"Instrument name \"1\" is invalid, returning noop instrument. Instrument names must consist of 255 or fewer characters including alphanumeric, _, ., -, /, and start with a letter.");
9898
}
9999

100100
@Test

0 commit comments

Comments
 (0)