Skip to content

Commit ededd6f

Browse files
authored
Rename CloudWatch o-tel commands to otel with hidden backward-compat aliases (aws#10229)
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 a71abca commit ededd6f

4 files changed

Lines changed: 68 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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 alias_command
14+
15+
16+
def register_rename_otel_commands(event_emitter):
17+
event_emitter.register(
18+
'building-command-table.cloudwatch',
19+
rename_otel_commands
20+
)
21+
22+
23+
def rename_otel_commands(command_table, **kwargs):
24+
"""Rename o-tel commands to otel, keeping o-tel as hidden aliases."""
25+
renames = {
26+
'get-o-tel-enrichment': 'get-otel-enrichment',
27+
'start-o-tel-enrichment': 'start-otel-enrichment',
28+
'stop-o-tel-enrichment': 'stop-otel-enrichment',
29+
}
30+
for old_name, new_name in renames.items():
31+
if old_name in command_table:
32+
alias_command(command_table, old_name, new_name)

awscli/handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from awscli.customizations.cloudsearch import initialize as cloudsearch_init
3535
from awscli.customizations.cloudsearchdomain import register_cloudsearchdomain
3636
from awscli.customizations.cloudtrail import initialize as cloudtrail_init
37+
from awscli.customizations.cloudwatch import register_rename_otel_commands
3738
from awscli.customizations.codeartifact import register_codeartifact_commands
3839
from awscli.customizations.codecommit import initialize as codecommit_init
3940
from awscli.customizations.codedeploy.codedeploy import (
@@ -223,6 +224,7 @@ def awscli_initialize(event_handlers):
223224
cloudformation_init(event_handlers)
224225
register_servicecatalog_commands(event_handlers)
225226
register_translate_import_terminology(event_handlers)
227+
register_rename_otel_commands(event_handlers)
226228
register_history_mode(event_handlers)
227229
register_history_commands(event_handlers)
228230
register_event_stream_arg(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)