Skip to content

Commit

Permalink
Increase the character limit of the `MeterProviderBuilderSdk1's Instr…
Browse files Browse the repository at this point in the history
…umentNameRegex
  • Loading branch information
B3zaleel committed Aug 23, 2023
1 parent 0d1cc36 commit 6477c3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public MeterProviderBuilderSdk(IServiceProvider serviceProvider)
// Customers: This is not guaranteed to work forever. We may change this
// mechanism in the future do this at your own risk.
public static Regex InstrumentNameRegex { get; set; } = new(
@"^[a-z][a-z0-9-._]{0,62}$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
@"^[a-z][a-z0-9-._]{0,254}$", RegexOptions.IgnoreCase | RegexOptions.Compiled);

public List<InstrumentationRegistration> Instrumentation { get; } = new();

Expand Down
4 changes: 2 additions & 2 deletions test/OpenTelemetry.Tests/Metrics/MetricTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static IEnumerable<object[]> InvalidInstrumentNames
new object[] { "-first-char-not-alphabetic" },
new object[] { "1first-char-not-alphabetic" },
new object[] { "invalid+separator" },
new object[] { new string('m', 64) },
new object[] { new string('m', 256) },
new object[] { "a\xb5" }, // `\xb5` is the Micro character
};

Expand All @@ -37,7 +37,7 @@ public static IEnumerable<object[]> ValidInstrumentNames
new object[] { "my-2-instrument" },
new object[] { "my.metric" },
new object[] { "my_metric2" },
new object[] { new string('m', 63) },
new object[] { new string('m', 255) },
new object[] { "CaSe-InSeNsItIvE" },
};

Expand Down

0 comments on commit 6477c3b

Please sign in to comment.