[opentelemetry-instrumentation] add version flag (#1065)
This commit is contained in:
parent
6f620ee142
commit
9e539391b2
|
|
@ -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
|
- Refactoring custom header collection API for consistency
|
||||||
([#1064](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1064))
|
([#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
|
## [1.11.1-0.30b1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.11.1-0.30b1) - 2022-04-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ from shutil import which
|
||||||
|
|
||||||
from pkg_resources import iter_entry_points
|
from pkg_resources import iter_entry_points
|
||||||
|
|
||||||
|
from opentelemetry.instrumentation.version import __version__
|
||||||
|
|
||||||
_logger = getLogger(__name__)
|
_logger = getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -34,7 +36,7 @@ def run() -> None:
|
||||||
program and its dependencies and then runs the program.
|
program and its dependencies and then runs the program.
|
||||||
""",
|
""",
|
||||||
epilog="""
|
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
|
directly correspond with OpenTelemetry environment variables. The
|
||||||
corresponding optional argument is formed by removing the OTEL_ or
|
corresponding optional argument is formed by removing the OTEL_ or
|
||||||
OTEL_PYTHON_ prefix from the environment variable and lower casing the
|
OTEL_PYTHON_ prefix from the environment variable and lower casing the
|
||||||
|
|
@ -66,6 +68,12 @@ def run() -> None:
|
||||||
)
|
)
|
||||||
argument_otel_environment_variable[argument] = attribute
|
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", help="Your Python application.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"command_args",
|
"command_args",
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ from opentelemetry.instrumentation.bootstrap_gen import (
|
||||||
default_instrumentations,
|
default_instrumentations,
|
||||||
libraries,
|
libraries,
|
||||||
)
|
)
|
||||||
|
from opentelemetry.instrumentation.version import __version__
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
@ -133,6 +134,12 @@ def run() -> None:
|
||||||
installs the relevant instrumentation packages for them.
|
installs the relevant instrumentation packages for them.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--version",
|
||||||
|
help="print version information",
|
||||||
|
action="version",
|
||||||
|
version="%(prog)s " + __version__,
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-a",
|
"-a",
|
||||||
"--action",
|
"--action",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue