Skip to content

Commit 83b78ba

Browse files
authored
Rename CloudWatch o-tel commands to otel with hidden backward-compat aliases (aws#10228)
Rename the 3 CloudWatch OTel enrichment CLI commands from o-tel to otel naming, consistent with the OpenTelemetry community convention: - get-o-tel-enrichment -> get-otel-enrichment - start-o-tel-enrichment -> start-otel-enrichment - stop-o-tel-enrichment -> stop-otel-enrichment The old o-tel names are kept as hidden/undocumented aliases for backward compatibility.
1 parent 1cee26b commit 83b78ba

4 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"category": "``cloudwatch``",
4+
"description": "Rename ``get-o-tel-enrichment``, ``start-o-tel-enrichment``, and ``stop-o-tel-enrichment`` commands to ``get-otel-enrichment``, ``start-otel-enrichment``, and ``stop-otel-enrichment``. The old names are kept as hidden aliases for backward compatibility.",
5+
"type": "bugfix"
6+
}
7+
]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
from awscli.customizations.utils import make_hidden_command_alias
14+
from awscli.customizations.utils import rename_command
15+
16+
17+
def register_rename_otel_commands(event_emitter):
18+
event_emitter.register(
19+
'building-command-table.cloudwatch',
20+
rename_otel_commands
21+
)
22+
23+
24+
def rename_otel_commands(command_table, **kwargs):
25+
"""Rename o-tel commands to otel, keeping o-tel as hidden aliases."""
26+
renames = {
27+
'get-o-tel-enrichment': 'get-otel-enrichment',
28+
'start-o-tel-enrichment': 'start-otel-enrichment',
29+
'stop-o-tel-enrichment': 'stop-otel-enrichment',
30+
}
31+
for old_name, new_name in renames.items():
32+
if old_name in command_table:
33+
rename_command(command_table, old_name, new_name)
34+
make_hidden_command_alias(
35+
command_table, new_name, old_name
36+
)

awscli/handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from awscli.customizations.cloudsearch import initialize as cloudsearch_init
3232
from awscli.customizations.cloudsearchdomain import register_cloudsearchdomain
3333
from awscli.customizations.cloudtrail import initialize as cloudtrail_init
34+
from awscli.customizations.cloudwatch import register_rename_otel_commands
3435
from awscli.customizations.codeartifact import register_codeartifact_commands
3536
from awscli.customizations.codecommit import initialize as codecommit_init
3637
from awscli.customizations.codedeploy.codedeploy import (
@@ -208,6 +209,7 @@ def awscli_initialize(event_handlers):
208209
register_alias_mturk_command(event_handlers)
209210
register_alias_sagemaker_runtime_command(event_handlers)
210211
register_alias_socialmessaging_command(event_handlers)
212+
register_rename_otel_commands(event_handlers)
211213
register_servicecatalog_commands(event_handlers)
212214
register_translate_import_terminology(event_handlers)
213215
register_history_mode(event_handlers)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
from awscli.testutils import BaseAWSCommandParamsTest
14+
15+
16+
class TestOTelAlias(BaseAWSCommandParamsTest):
17+
def test_get_otel_enrichment_alias(self):
18+
self.run_cmd('cloudwatch get-otel-enrichment', expected_rc=0)
19+
self.run_cmd('cloudwatch get-o-tel-enrichment', expected_rc=0)
20+
21+
def test_start_otel_enrichment_alias(self):
22+
self.run_cmd('cloudwatch start-otel-enrichment', expected_rc=0)
23+
self.run_cmd('cloudwatch start-o-tel-enrichment', expected_rc=0)
24+
25+
def test_stop_otel_enrichment_alias(self):
26+
self.run_cmd('cloudwatch stop-otel-enrichment', expected_rc=0)
27+
self.run_cmd('cloudwatch stop-o-tel-enrichment', expected_rc=0)

0 commit comments

Comments
 (0)