Skip to content

Commit

Permalink
[opentelemetry-instrumentation] add version flag (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Boten committed Apr 27, 2022
1 parent 6f620ee commit 9e53939
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ 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
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(
"--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

0 comments on commit 9e53939

Please sign in to comment.