Skip to content
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

[opentelemetry-instrumentation] add version flag #1065

Merged
merged 9 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactoring custom header collection API for consistency
([#1064](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1064))

### Added
- `opentelemetry-instrument` and `opentelemetry-bootstrap` now include a `--version` flag
([#1065](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1065))

## [1.11.1-0.30b1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.11.1-0.30b1) - 2022-04-21

### Added
- `opentelemetry-instrumentation-starlette` Capture custom request/response headers in span attributes
([#1046])(https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1046)

### Fixed
srikanthccv marked this conversation as resolved.
Show resolved Hide resolved
- Prune autoinstrumentation sitecustomize module directory from PYTHONPATH immediately
([#1066](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1066))

## [1.11.0-0.30b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.11.0-0.30b0) - 2022-04-18

### Fixed
Expand All @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#999](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/999))
- `opentelemetry-instrumentation-tornado` Fix non-recording span bug
([#999](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/999))
- Prune autoinstrumentation sitecustomize module directory from PYTHONPATH immediately
([#1066](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1066))

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

from pkg_resources import iter_entry_points

from opentelemetry.instrumentation.version import __version__

_logger = getLogger(__name__)


Expand All @@ -34,7 +36,7 @@ def run() -> None:
program and its dependencies and then runs the program.
""",
epilog="""
Optional arguments (except for --help) for opentelemetry-instrument
Optional arguments (except for --help and --version) for opentelemetry-instrument
directly correspond with OpenTelemetry environment variables. The
corresponding optional argument is formed by removing the OTEL_ or
OTEL_PYTHON_ prefix from the environment variable and lower casing the
Expand Down Expand Up @@ -66,6 +68,12 @@ def run() -> None:
)
argument_otel_environment_variable[argument] = attribute

parser.add_argument(
srikanthccv marked this conversation as resolved.
Show resolved Hide resolved
"--version",
help="print version information",
action="version",
version="%(prog)s " + __version__,
)
parser.add_argument("command", help="Your Python application.")
parser.add_argument(
"command_args",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
default_instrumentations,
libraries,
)
from opentelemetry.instrumentation.version import __version__

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -133,6 +134,12 @@ def run() -> None:
installs the relevant instrumentation packages for them.
"""
)
parser.add_argument(
"--version",
help="print version information",
action="version",
version="%(prog)s " + __version__,
)
parser.add_argument(
"-a",
"--action",
Expand Down