Skip to content

Switch to SPDX license headers #5170

@MikeGoldsmith

Description

@MikeGoldsmith

Description

All Python files in this repo currently use the full Apache 2.0 license header (13 lines):

# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Other OTel SDKs have already moved to the shorter SPDX format (2 lines):

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

This is functionally and legally equivalent. It reduces visual noise and is consistent with the direction other SDKs have taken.

Precedent

Scope

~779 .py files in this repo would be updated.

Steps

  • Write a script to replace the 13-line Apache header with the 2-line SPDX header across all .py files
  • Verify no files are missed (check for header variations)
  • Update any CI or pre-commit checks that validate the header format
  • Submit PR (single large PR, best timed during a quiet period to minimize rebase conflicts)
  • Update contributing docs if they reference the old header format
  • Coordinate with opentelemetry-python-contrib to do the same

Notes

There is no runtime performance impact — Python strips comments during bytecode compilation. The benefit is purely reduced boilerplate and consistency with other OTel SDKs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions