Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Sep 19, 2024
2 parents 7dd9bf4 + 6baea36 commit 4e4b572
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/contrib_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2060,6 +2060,34 @@ jobs:
- name: Run tests
run: tox -e py38-test-instrumentation-aio-pika-3 -- -ra

py38-test-instrumentation-aiokafka:
name: instrumentation-aiokafka
runs-on: ubuntu-latest
steps:
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
uses: actions/checkout@v4
with:
repository: open-telemetry/opentelemetry-python-contrib
ref: ${{ env.CONTRIB_REPO_SHA }}

- name: Checkout core repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
with:
repository: open-telemetry/opentelemetry-python
path: opentelemetry-python-core

- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
architecture: "x64"

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e py38-test-instrumentation-aiokafka -- -ra

py38-test-instrumentation-kafka-python:
name: instrumentation-kafka-python
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
runs-on: ubuntu-latest
if: |
!contains(github.event.pull_request.labels.*.name, 'Approve Public API check')
&& github.actor != 'opentelemetrybot'
&& github.actor != 'opentelemetrybot' && github.event_name == 'pull_request'
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Every public symbol is something that has to be kept in order to maintain backwa

To check if your PR is adding public symbols, run `tox -e public-symbols-check`. This will always fail if public symbols are being added/removed. The idea
behind this is that every PR that adds/removes public symbols fails in CI, forcing reviewers to check the symbols to make sure they are strictly necessary.
If after checking them, it is considered that they are indeed necessary, the PR will be labeled with `Skip Public API check` so that this check is not
If after checking them, it is considered that they are indeed necessary, the PR will be labeled with `Approve Public API check` so that this check is not
run.

Also, we try to keep our console output as clean as possible. Most of the time this means catching expected log messages in the test cases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ def test_synchronous_delta_temporality(self):

results.append(reader.get_metrics_data())

provider.shutdown()

for metrics_data in results:
self.assertIsNone(metrics_data)

Expand Down
4 changes: 2 additions & 2 deletions scripts/public_symbols_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def remove_common_symbols():
print(
"Please make sure that all of them are strictly necessary, if not, "
"please consider prefixing them with an underscore to make them "
'private. After that, please label this PR with "Skip Public API '
'private. After that, please label this PR with "Approve Public API '
'check".'
)
print()
Expand All @@ -154,7 +154,7 @@ def remove_common_symbols():
print(
"Please make sure no public symbols are removed, if so, please "
"consider deprecating them instead. After that, please label this "
'PR with "Skip Public API check".'
'PR with "Approve Public API check".'
)
exit(1)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def disable_logging(highest_level=logging.CRITICAL):
logging.disable(logging.NOTSET)

def get_sorted_metrics(self):
metrics_data = self.memory_metrics_reader.get_metrics_data()
resource_metrics = (
self.memory_metrics_reader.get_metrics_data().resource_metrics
metrics_data.resource_metrics if metrics_data else []
)

all_metrics = []
Expand Down
21 changes: 21 additions & 0 deletions tests/opentelemetry-test-utils/tests/test_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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.

from opentelemetry.test.test_base import TestBase


class TestBaseTestCase(TestBase):
def test_get_sorted_metrics_works_without_metrics(self):
metrics = self.get_sorted_metrics()
self.assertEqual(metrics, [])

0 comments on commit 4e4b572

Please sign in to comment.