Skip to content

Commit bcf1205

Browse files
authored
Add External Type Checking (#1603)
The purpose of this is to ensure we understand the API surface area. Anything exposed by a crate like a type can affect the possible compatibility. This means that if we bump an external type it could cause breaking changes. This tracks them to limit this possibility. Affected Crates: opentelemetry-otlp opentelemetry-zipkin
1 parent 4aa4827 commit bcf1205

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
external-types:
5454
strategy:
5555
matrix:
56-
example: [opentelemetry, opentelemetry-sdk]
56+
example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
5757
runs-on: ubuntu-latest
5858
steps:
5959
- uses: actions/checkout@v4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
# This is used with cargo-check-external-types to reduce the surface area of downstream crates from
4+
# the public API. Ideally this can have a few exceptions as possible.
5+
allowed_external_types = [
6+
"opentelemetry::*",
7+
"opentelemetry_http::*",
8+
"opentelemetry_sdk::*",
9+
# http is a pre 1.0 crate
10+
"http::uri::InvalidUri",
11+
"http::header::name::InvalidHeaderName",
12+
"http::header::value::InvalidHeaderValue",
13+
# prost is a pre 1.0 crate
14+
"prost::error::EncodeError",
15+
# tonic is a pre 1.0 crate
16+
"tonic::status::Code",
17+
"tonic::status::Status",
18+
"tonic::metadata::map::MetadataMap",
19+
"tonic::transport::channel::Channel",
20+
"tonic::transport::error::Error",
21+
"tonic::service::interceptor::Interceptor",
22+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
# This is used with cargo-check-external-types to reduce the surface area of downstream crates from
4+
# the public API. Ideally this can have a few exceptions as possible.
5+
allowed_external_types = [
6+
"opentelemetry::*",
7+
"opentelemetry_http::*",
8+
"opentelemetry_sdk::*",
9+
# http is a pre 1.0 crate
10+
"http::error::Error",
11+
"http::uri::InvalidUri",
12+
]

0 commit comments

Comments
 (0)