Skip to content

Commit

Permalink
Merge pull request #273 from solarwinds/NH-66478-update-pyproject-toml
Browse files Browse the repository at this point in the history
NH-66478 Update pyproject.toml, remove setup.cfg, no more .so.0 symlink, fix smoke tests
  • Loading branch information
tammy-baylis-swi authored Jan 11, 2024
2 parents 852d4f0 + 8108933 commit 7d9ad3e
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 82 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/verify_install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@ jobs:
steps:
- if: ${{ matrix.image == 'amazonlinux:2023' }}
run: yum install -y tar gzip
- uses: actions/checkout@v4
- if: ${{ matrix.image == 'ubuntu:18.04' }}
uses: actions/checkout@v3
- if: ${{ matrix.image != 'ubuntu:18.04' }}
uses: actions/checkout@v4
- name: Setup and run install test
working-directory: ./tests/docker/install
run: ./_helper_run_install_tests.sh
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/solarwinds/apm-python/compare/rel-1.0.2...HEAD)
## [Unreleased](https://github.com/solarwinds/apm-python/compare/rel-1.1.0...HEAD)

## [1.1.0.2](https://github.com/solarwinds/apm-python/releases/tag/rel-1.1.0) - 2024-01-09

### Added
- Added configuration of transaction name in response_time metrics by lambda environment ([#257](https://github.com/solarwinds/apm-python/pull/257))
- Added Dependabot config ([#261](https://github.com/solarwinds/apm-python/pull/261))

### Changed
- Fixed unit tests ([#249](https://github.com/solarwinds/apm-python/pull/249))
- Refactored span processors ([#251](https://github.com/solarwinds/apm-python/pull/251), [#252](https://github.com/solarwinds/apm-python/pull/252), [#253](https://github.com/solarwinds/apm-python/pull/253), [#254](https://github.com/solarwinds/apm-python/pull/254), [#255](https://github.com/solarwinds/apm-python/pull/255))
- Add API unit tests ([#256](https://github.com/solarwinds/apm-python/pull/256))
- Refactor c-lib init ([#258](https://github.com/solarwinds/apm-python/pull/258))
- SolarWinds c-lib 14.0.0 ([#259](https://github.com/solarwinds/apm-python/pull/259))
- Upgraded workflow dependencies ([#263](https://github.com/solarwinds/apm-python/pull/263), [#264](https://github.com/solarwinds/apm-python/pull/264), [#265](https://github.com/solarwinds/apm-python/pull/265), [#266](https://github.com/solarwinds/apm-python/pull/266), [#271](https://github.com/solarwinds/apm-python/pull/271))
- Move build configuration to pyproject.toml ([#273](https://github.com/solarwinds/apm-python/pull/273))

### Removed
- Removed unused mend/whitesource config ([#260](https://github.com/solarwinds/apm-python/pull/260))

## [1.0.2](https://github.com/solarwinds/apm-python/releases/tag/rel-1.0.2) - 2023-12-04

Expand Down
91 changes: 90 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,96 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = [
"setuptools >= 61.0",
"wheel >= 0.41"
]
build-backend = "setuptools.build_meta"

[project]
name = "solarwinds_apm"
dynamic = ["version"]
authors = [
{name = "SolarWinds, LLC", email = "SWO-support@solarwinds.com"}
]
maintainers = [
{name = "Tammy Baylis", email = "tammy.baylis@solarwinds.com"}
]
description = "OpenTelemetry custom distro to connect to SolarWinds"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
keywords = [
"solarwinds_apm",
"appoptics_apm",
"traceview",
"tracelytics",
"oboe",
"liboboe",
"instrumentation",
"performance",
"opentelemetry",
"observability",
]
classifiers = [
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Typing :: Typed",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
]
requires-python = ">=3.7"
dependencies = [
'opentelemetry-api == 1.20.0',
'opentelemetry-sdk == 1.20.0',
'opentelemetry-instrumentation == 0.41b0',
'opentelemetry-instrumentation-logging == 0.41b0',
]

[project.urls]
Homepage = "https://www.solarwinds.com/solarwinds-observability/use-cases/python-performance-monitoring"
Download = "https://pypi.org/project/solarwinds-apm/"
Documentation = "https://documentation.solarwinds.com/en/success_center/observability/content/configure/services/python/python.htm"
Changelog = "https://documentation.solarwinds.com/en/success_center/observability/content/release_notes/python-release-notes.htm"

[project.entry-points.opentelemetry_distro]
solarwinds_distro = "solarwinds_apm.distro:SolarWindsDistro"

[project.entry-points.opentelemetry_configurator]
solarwinds_configurator = "solarwinds_apm.configurator:SolarWindsConfigurator"

[project.entry-points.opentelemetry_propagator]
solarwinds_propagator = "solarwinds_apm.propagator:SolarWindsPropagator"

[project.entry-points.opentelemetry_traces_exporter]
solarwinds_exporter = "solarwinds_apm.exporter:SolarWindsSpanExporter"

[project.entry-points.opentelemetry_traces_sampler]
solarwinds_sampler = "solarwinds_apm.sampler:ParentBasedSwSampler"

[tool.setuptools]
include-package-data = false
packages = [
"solarwinds_apm",
"solarwinds_apm.api",
"solarwinds_apm.certs",
"solarwinds_apm.extension",
"solarwinds_apm.extension.bson",
"solarwinds_apm.trace",
]

[tool.setuptools.package-data]
solarwinds_apm = [
"extension/liboboe.so",
"extension/VERSION",
"extension/bson/bson.h",
"extension/bson/platform_hacks.h",
]

[tool.setuptools.dynamic]
version = {attr = "solarwinds_apm.version.__version__"}

[tool.black]
line-length = 79
exclude = '''
Expand Down
46 changes: 0 additions & 46 deletions setup.cfg

This file was deleted.

61 changes: 31 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,29 @@ def os_supported():
return is_linux and is_x86_64_or_aarch64

def link_oboe_lib(src_lib):
"""Set up the C-extension libraries.
"""Set up the C-extension library.
Create two .so library symlinks, namely 'liboboe.so' and 'liboboe.so.0 which are needed when the
Creates a .so library symlink ('liboboe.so') needed when the
solarwinds_apm package is built from source. This step is needed since Oboe library is platform specific.
The src_lib parameter is the name of the library file under solarwinds_apm/extension the above mentioned symlinks will
The src_lib parameter is the name of the library file under solarwinds_apm/extension the above mentioned symlink will
point to. If a file with the provided name does not exist, no symlinks will be created."""

logger.info("Create links to platform specific liboboe library file")
link_dst = ('liboboe.so', 'liboboe.so.0')
logger.info("Create link to platform specific liboboe library file")
link_dst = 'liboboe.so'
cwd = os.getcwd()
try:
os.chdir('./solarwinds_apm/extension/')
if not os.path.exists(src_lib):
raise Exception("C-extension library file {} does not exist.".format(src_lib))
for dst in link_dst:
if os.path.exists(dst):
# if the destination library files exist already, they need to be deleted, otherwise linking will fail
os.remove(dst)
logger.info("Removed %s" % dst)
os.symlink(src_lib, dst)
logger.info("Created new link at {} to {}".format(dst, src_lib))
if os.path.exists(link_dst):
# if the destination library file exists already, it needs to be deleted, otherwise linking will fail
os.remove(link_dst)
logger.info("Removed %s" % link_dst)
os.symlink(src_lib, link_dst)
logger.info("Created new link at {} to {}".format(link_dst, src_lib))
except Exception as ecp:
logger.info("[SETUP] failed to set up links to C-extension library: {e}".format(e=ecp))
logger.info("[SETUP] failed to set up link to C-extension library: {e}".format(e=ecp))
finally:
os.chdir(cwd)

Expand Down Expand Up @@ -104,23 +103,25 @@ def run(self):
"Other platform or python versions may not work as expected.")

ext_modules = [
Extension('solarwinds_apm.extension._oboe',
sources=[
'solarwinds_apm/extension/oboe_wrap.cxx',
'solarwinds_apm/extension/oboe_api.cpp'
],
depends=[
'solarwinds_apm/extension/oboe_api.h'
],
include_dirs=[
'solarwinds_apm/certs',
'solarwinds_apm/extension',
'solarwinds_apm'
],
libraries=['oboe', 'rt'],
library_dirs=['solarwinds_apm/extension'],
extra_compile_args=["-std=c++14"],
runtime_library_dirs=['$ORIGIN']),
Extension(
name='solarwinds_apm.extension._oboe',
sources=[
'solarwinds_apm/extension/oboe_wrap.cxx',
'solarwinds_apm/extension/oboe_api.cpp'
],
depends=[
'solarwinds_apm/extension/oboe_api.h',
],
include_dirs=[
'solarwinds_apm/certs',
'solarwinds_apm/extension/bson',
'solarwinds_apm'
],
libraries=['oboe', 'rt'],
library_dirs=['solarwinds_apm/extension'],
extra_compile_args=["-std=c++14"],
runtime_library_dirs=['$ORIGIN']
),
]

setup(
Expand Down
2 changes: 1 addition & 1 deletion solarwinds_apm/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# 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.

"""Version of SolarWinds Custom-Distro for OpenTelemetry agents"""
__version__ = "1.0.2"
__version__ = "1.1.0.2"
4 changes: 2 additions & 2 deletions tests/docker/install/install_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ function check_agent_startup(){
expected_agent_return=1

TEST_EXP_LOG_MESSAGES=(
">> SSL Reporter using host='apm.collector.cloud.solarwinds.com' port='443' log='' clientid='inva...7890:servicename' buf=1000 maxTransactions='200' flushMaxWaitTime='5000' eventsFlushInterval='2' maxRequestSizeBytes='3000000' proxy=''"
">> SSL Reporter using host='apm.collector.na-01.cloud.solarwinds.com' port='443' log='' clientid='inva...7890:servicename' buf='1000' maxTransactions='200' flushMaxWaitTime='5000' eventsFlushInterval='2' maxRequestSizeBytes='3000000' proxy=''"
"Warning: There is an problem getting the API token authorized. Metrics and tracing for this agent are currently disabled. If you'd like to learn more about resolving this issue, please contact support (see https://support.solarwinds.com/working-with-support)."
)

# unset stop on error so we can catch debug messages in case of failures
set +e

result=$(opentelemetry-instrument python -c 'from solarwinds_apm.api import solarwinds_ready; r=solarwinds_ready(wait_milliseconds=10000, integer_response=True); print(r)' 2>startup.log)
result=$(opentelemetry-instrument python -c 'from solarwinds_apm.api import solarwinds_ready; r=solarwinds_ready(wait_milliseconds=10000, integer_response=True); print(r)' 2>startup.log | tail -1)

if [ "$result" != "$expected_agent_return" ]; then
echo "FAILED! Expected solarwinds_ready to return $expected_agent_return, but got: $result"
Expand Down

0 comments on commit 7d9ad3e

Please sign in to comment.