Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Nov 10, 2022
1 parent 981e3e0 commit dc75cb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/OpenTelemetry.Instrumentation.EventCounters/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Unreleased

* Update OpenTelemetry.Api to 1.3.1.
* Changed `EventCounter` prefix to `ec` and started abbreviating event source name
when instrument name is longer that 63 characters.
* Change `EventCounter` prefix to `ec` and abbreviate event source name
when instrument name is longer than 63 characters.
([#740](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/740))

## 1.0.0-alpha.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ private static string GetInstrumentName(string sourceName, string eventName)
}

var maxEventSourceLength = MaxInstrumentNameLength - Prefix.Length - 1 - eventName.Length;
if (maxEventSourceLength < 2)
if (maxEventSourceLength < 2)
{
// event name is too long, there is not enough space for sourceName.
// let ec.<eventName> flow to metrics SDK and filter if needed.
// let ec.<eventName> flow to metrics SDK and it will suppress it if needed.
return string.Concat(Prefix, ".", eventName);
}

Expand All @@ -159,12 +159,12 @@ private static string GetInstrumentName(string sourceName, string eventName)

if (ind < sourceName.Length)
{
abbreviation.Append(char.ToLowerInvariant(sourceName[ind])).Append('.');
if (abbreviation.Length + 2 >= maxEventSourceLength)
{
// stop if there is no room to add another letter and a dot after
break;
}

abbreviation.Append(char.ToLowerInvariant(sourceName[ind])).Append('.');
}

int nextDot = sourceName.IndexOf('.', ind);
Expand Down

0 comments on commit dc75cb0

Please sign in to comment.