-
Notifications
You must be signed in to change notification settings - Fork 703
Use BoundedAttributes instead of raw dict to extract attributes from LogRecord #3114 #3310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ocelotl
merged 26 commits into
open-telemetry:main
from
nstawski:ns-3114-bounded-attributes-insteadof-dict-LogRecord
May 24, 2023
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
3fd450d
Switched to using BoundedAttributes as per #3114
nstawski 986ba7d
Switched to using BoundedAttributes as per #3114
nstawski 6a3b62a
Code linting
nstawski 2d88ce4
Code linting
nstawski 1c5b20c
Code linting
nstawski bdae2f2
Comment
nstawski deff884
Moved the instantiating of BoundedAttributes into the LogRecord class…
nstawski 58b734d
Properly serializing the items from BoundedAttributes in to_json sinc…
nstawski 2dd23e5
Update version to 1.19.0.dev/0.40b0.dev (#3297)
opentelemetrybot 13f2426
Merge branch 'open-telemetry:main' into ns-3114-bounded-attributes-in…
nstawski 9f88cd5
Lint
nstawski f626411
Tests + changelog update
nstawski 820eb09
Lint
nstawski 4749c8e
Added limits + tests
nstawski 7c39620
Updated changelog
nstawski cb17281
Added LogLimits and tests
nstawski 387c928
Lint
nstawski 3e6e5ea
Lint
nstawski b1a646d
Lint
nstawski 95c9c22
Lint
nstawski 8fba6c8
Lint
nstawski a8c6332
Lint
nstawski 4946e18
Addressed pull request comments
nstawski 08df03c
Merge branch 'main' into ns-3114-bounded-attributes-insteadof-dict-Lo…
ocelotl 72fade9
Addressed pull request comment, removed private variable from __all__
nstawski 93beb55
lint
nstawski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import unittest | ||
|
||
from opentelemetry.sdk._logs import ( | ||
_DEFAULT_OTEL_ATTRIBUTE_COUNT_LIMIT, | ||
LogLimits, | ||
) | ||
|
||
|
||
class TestLogLimits(unittest.TestCase): | ||
def test_log_limits_repr_unset(self): | ||
expected = f"LogLimits(max_attributes={_DEFAULT_OTEL_ATTRIBUTE_COUNT_LIMIT}, max_attribute_length=None)" | ||
limits = str(LogLimits()) | ||
|
||
self.assertEqual(expected, limits) | ||
|
||
def test_log_limits_max_attributes(self): | ||
expected = 1 | ||
limits = LogLimits(max_attributes=1) | ||
|
||
self.assertEqual(expected, limits.max_attributes) | ||
|
||
def test_log_limits_max_attribute_length(self): | ||
expected = 1 | ||
limits = LogLimits(max_attribute_length=1) | ||
|
||
self.assertEqual(expected, limits.max_attribute_length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.